@layer base, layout, components, responsive;

@layer base {
  :root {
    color-scheme: dark;
    --bg: #0e1210;
    --sidebar: #121713;
    --surface: #161d18;
    --surface-hover: #1c251f;
    --border: #2b352e;
    --text: #edf0e9;
    --muted: #a0ada2;
    --dim: #819084;
    --green: #b2e1b8;
    --green-dark: #1b3223;
    --danger: #f3a59e;
    --font-sans: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-mono: 'Geist Mono Variable', ui-monospace, Consolas, 'Courier New', monospace;
    font-family: var(--font-sans);
    font-synthesis: none;
    font-size: 14px;
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
  a { color: inherit; text-decoration: none; }
  button, input, textarea, select { font: inherit; }
  button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  button { color: inherit; }
  button:disabled { opacity: .45; cursor: not-allowed; }
  button, a { touch-action: manipulation; }
  :focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
  h1:focus, main:focus { outline: none; }
  ::selection { background: #416b4c; color: #fff; }
  h1, h2, h3, p { margin: 0; }
  h1, h2, h3 { line-height: 1.25; }
  h1 { font-size: clamp(28px, 2.7vw, 38px); letter-spacing: -1.2px; font-weight: 600; }
  h2 { font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
  h3 { font-size: 17px; font-weight: 600; letter-spacing: -.25px; }
  svg { flex-shrink: 0; }
  [hidden] { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }
  .skip-link { position: fixed; top: -80px; left: 20px; padding: 12px 20px; border-radius: 8px; color: var(--bg); background: var(--green); z-index: 100; }
  .skip-link:focus { top: 12px; }
  .icon { display: inline-block; vertical-align: middle; }
  .noscript { padding: 40px; }
}

@layer layout {
  .sidebar { width: 236px; height: 100dvh; position: fixed; inset: 0 auto 0 0; border-right: 1px solid var(--border); background: var(--sidebar); display: flex; flex-direction: column; padding: 31px 19px 0; z-index: 40; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 10px; width: fit-content; padding-left: 10px; }
  .brand > span { font-size: 26px; line-height: 1; letter-spacing: -1px; font-weight: 700; }
  .brand-caption { margin: 14px 0 38px 10px; font-size: 11px; letter-spacing: .2px; color: var(--muted); }
  .nav-label { font-size: 11px; font-weight: 500; color: var(--dim); padding: 0 13px; margin-bottom: 10px; }
  .main-nav, .category-nav { display: flex; flex-direction: column; gap: 5px; }
  .main-nav a, .category-nav a { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 12px; transition: background .15s, color .15s; }
  .main-nav .icon, .category-nav .icon { width: 18px; height: 18px; }
  .main-nav a:hover, .category-nav a:hover { color: var(--text); background: var(--surface-hover); }
  .main-nav a.active { color: var(--green); background: #233126; border-color: #344739; }
  .nav-count { margin-left: auto; font-size: 10px; padding: 0 6px; border: 1px solid #35433a; border-radius: 4px; color: #b1bdb2; }
  .category-label { margin-top: 35px; }
  .category-nav { gap: 1px; }
  .category-nav a { font-size: 12px; min-height: 40px; padding-block: 7px; }
  .sidebar-bottom { margin-top: auto; padding-top: 38px; }
  .guest-wrap { position: relative; padding: 14px 0; }
  .guest { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; }
  .guest:hover, .guest[aria-expanded="true"] { background: var(--surface-hover); }
  .guest[aria-expanded="true"] > .icon:last-child { transform: rotate(-90deg); }
  .guest-panel { position: absolute; left: 0; right: 0; bottom: calc(100% - 8px); z-index: 5; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 28px #0007; }
  .guest-panel strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
  .guest-panel p { color: var(--muted); font-size: 12px; line-height: 1.6; }
  .guest-panel p + p { margin-top: 8px; }
  .guest-panel a { display: inline-block; margin-top: 12px; color: var(--green); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
  .guest-avatar { background: #26302a; border: 1px solid #35423a; color: #b2c0b5; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; }
  .guest-avatar .icon { width: 16px; height: 16px; }
  .guest strong { display: block; font-size: 11px; font-weight: 500; }
  .guest small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
  .guest > .icon { width: 14px; height: 14px; color: var(--dim); margin-left: auto; }
  .page { margin-left: 236px; min-height: 100dvh; display: flex; flex-direction: column; }
  .topbar { height: 74px; border-bottom: 1px solid var(--border); padding: 0 40px; display: flex; align-items: center; gap: 12px; }
  .breadcrumbs { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
  .breadcrumbs .icon { width: 12px; height: 12px; color: #627266; }
  #breadcrumb { color: #d4dbd2; }
  .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 24px; }
  .topbar-note { font-size: 11px; color: var(--muted); }
  .version-pill { min-height: 32px; display: flex; align-items: center; gap: 8px; font-size: 10px; background: #1e2821; border: 1px solid #324237; padding: 5px 11px; border-radius: 5px; color: #c0cdbd; }
  .version-pill .icon { width: 12px; height: 12px; }
  main { width: 100%; max-width: 1430px; padding: 42px 40px 50px; margin-inline: auto; flex: 1; }
  .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
  .page-heading p { color: var(--muted); font-size: 13px; margin-top: 13px; line-height: 1.8; }
  .footer { margin: auto 40px 0; padding: 21px 0 25px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; font-size: 10px; color: var(--dim); }
  .footer strong { letter-spacing: 1px; font-size: 11px; font-weight: 600; color: #aebbb0; }
  .footer-separator { margin: 0 12px; color: #46574a; }
  .footer a { display: inline-flex; align-items: center; min-height: 24px; }
  .footer a:hover { color: var(--text); }
  .section { margin-top: 32px; }
  .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; min-height: 36px; }
  .section-heading h2 { display: flex; align-items: center; gap: 9px; }
  .section-heading h2 > .icon { width: 17px; height: 17px; color: #a7baaa; }
  .section-heading p { color: var(--dim); font-size: 11px; margin-top: 6px; }
  .featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .personal-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
  .category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
}

@layer components {
  .panel-meta { font-size: 11px; color: var(--muted); }
  .button { border: 1px solid transparent; border-radius: 7px; padding: 11px 17px; min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; font-size: 12px; line-height: 1.4; font-weight: 600; transition: background .15s, border-color .15s; }
  .button .icon { width: 16px; height: 16px; }
  .button.primary { background: var(--green); color: #14291a; border-color: var(--green); }
  .button.primary:hover { background: #c8efcb; }
  .button.secondary { background: #1c261f; border-color: #3b4c3f; color: #d8e3d7; }
  .button.secondary:hover:not(:disabled) { background: #29362c; border-color: #617764; }
  .button.small { padding: 8px 12px; font-size: 11px; }
  .wide { width: 100%; }
  .icon-button { width: 38px; height: 38px; min-width: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); }
  .icon-button:hover:not(:disabled) { background: #27332a; border-color: #415046; color: var(--text); }
  .icon-button .icon { width: 18px; height: 18px; }
  .favorite.selected { color: var(--green); }
  .favorite.selected .icon { fill: #648b66; }
  .subtle-button { border: 0; background: none; color: #b3d4b7; display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 11px; padding: 0 8px; }
  .subtle-button:hover { color: #e0f6e2; }
  .subtle-button .icon { width: 14px; height: 14px; }
  .text-link { display: flex; align-items: center; gap: 8px; color: #bed7c1; font-size: 11px; min-height: 36px; }
  .text-link .icon { width: 15px; height: 15px; }
  .text-link:hover { color: #fff; }
  .subtle-link { color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 2px; min-height: 36px; }
  .subtle-link .icon { width: 14px; height: 14px; }
  .search-box { display: flex; align-items: center; gap: 13px; padding: 0 17px; height: 55px; border: 1px solid #37463b; border-radius: 8px; background: #172019; }
  .search-box:focus-within { border-color: var(--green); outline: 1px solid var(--green); }
  .search-box > .icon { color: #91aa95; width: 18px; height: 18px; }
  .search-box input { min-width: 0; flex: 1; background: none; border: none; color: var(--text); height: 100%; padding: 0; font-size: 12px; outline: 0; }
  .search-box input::placeholder { color: #8fa091; }
  kbd { background: #222d26; border: 1px solid #3a4b3e; border-radius: 4px; width: 24px; height: 25px; text-align: center; line-height: 23px; color: #9baf9e; font: 12px/23px var(--font-mono); }
  .tool-card { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; display: flex; flex-direction: column; min-width: 0; transition: border-color .15s, background .15s; }
  .tool-card:hover { border-color: var(--tone-border, #526653); background: #1a231d; }
  .tool-card.featured { background: #19221b; border-color: #374b3c; padding: 23px 25px 0; }
  .card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
  /* Category color coding: one hue per category, used for icons, labels and hover borders. Green stays reserved for brand and actions. */
  .tone-sky { --tone: #8cc8ff; --tone-bg: #172735; --tone-border: #2c4459; }
  .tone-amber { --tone: #f0c36c; --tone-bg: #2c2516; --tone-border: #4b3f23; }
  .tone-violet { --tone: #bda9ff; --tone-bg: #221e36; --tone-border: #3c3459; }
  .tone-coral { --tone: #ff9e8b; --tone-bg: #321f1b; --tone-border: #55342d; }
  .tone-pink { --tone: #f29fd3; --tone-bg: #301c29; --tone-border: #543049; }
  .tone-teal { --tone: #6fd8e3; --tone-bg: #132a2d; --tone-border: #26494d; }
  .tool-icon, .small-tool-icon, .category-icon { color: var(--tone, var(--green)); background: var(--tone-bg, #2b3c2d); border: 1px solid var(--tone-border, #415d47); }
  .tool-icon { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
  .tool-icon .icon { width: 22px; height: 22px; }
  .card-category { display: inline-block; color: var(--tone, var(--muted)); font-size: 11px; font-weight: 500; margin-bottom: 6px; }
  a.card-category:hover { text-decoration: underline; text-underline-offset: 3px; }
  .card-body { flex: 1; }
  .card-body h3 { font-size: 16px; }
  .featured .card-body h3 { font-size: 20px; letter-spacing: -.5px; }
  .card-body a:hover { color: var(--green); }
  .card-body p { margin-top: 9px; color: #a6b3a7; font-size: 12px; line-height: 1.7; }
  .card-bottom { display: flex; justify-content: flex-end; align-items: center; gap: 8px; border-top: 1px solid #2b392f; padding-top: 12px; margin-top: 22px; }
  .featured .card-bottom { margin: 22px -25px 0; padding: 10px 25px; background: #172019; border-radius: 0 0 11px 11px; }
  .card-link { color: #c2e4c5; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
  .card-link .icon { width: 15px; height: 15px; }
  .upcoming-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #a9b5aa; background: #222b25; padding: 3px 8px; border: 1px solid #37413a; border-radius: 4px; width: fit-content; }
  .empty-state { border: 1px dashed #3a4a3f; border-radius: 9px; min-height: 174px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 23px; background: #111813; }
  .empty-icon { color: #a1b4a4; background: #202c23; width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px; }
  .empty-icon .icon { width: 18px; height: 18px; }
  .empty-state h3 { font-size: 12px; letter-spacing: 0; font-weight: 500; color: #d5dfd3; }
  .empty-state p { font-size: 11px; color: #96a398; margin-top: 7px; max-width: 290px; line-height: 1.8; }
  .empty-state .button { margin-top: 20px; }
  .recent-section .empty-state { background: #131a15; border-style: solid; border-color: var(--border); }
  .compact-list { border: 1px solid var(--border); background: #141c16; border-radius: 9px; padding: 4px 15px; }
  .compact-row { display: flex; gap: 12px; align-items: center; padding: 15px 0; }
  .compact-row + .compact-row { border-top: 1px solid var(--border); }
  .small-tool-icon { height: 34px; width: 34px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
  .small-tool-icon .icon { width: 17px; height: 17px; }
  .compact-row a { min-width: 0; flex: 1; }
  .compact-row a:hover strong { color: var(--green); }
  .compact-row strong { display: block; font-size: 12px; font-weight: 500; }
  .compact-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
  .compact-row > .icon { width: 14px; height: 14px; color: var(--dim); }
  .category-card { display: flex; flex-direction: column; align-items: flex-start; background: #151d17; border: 1px solid var(--border); border-radius: 9px; padding: 17px 15px; transition: background .15s, border-color .15s; }
  .category-card:hover { background: #1b241e; border-color: var(--tone-border, #59715d); }
  .category-icon { display: grid; place-items: center; border-radius: 7px; width: 32px; height: 32px; margin-bottom: 14px; }
  .category-icon .icon { width: 17px; height: 17px; }
  .category-card strong { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
  .category-card small { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 12px; }
  .category-card > span:last-child { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: auto; color: var(--dim); font-size: 10px; }
  .category-card > span:last-child .icon { width: 13px; height: 13px; }
  .bottom-note { display: flex; align-items: center; gap: 10px; margin-top: 29px; color: var(--muted); font-size: 10px; }
  .bottom-note > .icon { width: 16px; height: 16px; color: #9bbda1; }
  .bottom-note a { margin-left: auto; color: #b1cbb6; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .bottom-note a .icon { width: 14px; height: 14px; }
  .filters { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 21px; flex-wrap: wrap; }
  .filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip { border: 1px solid var(--border); border-radius: 6px; background: transparent; padding: 9px 12px; font-size: 11px; display: flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); }
  .chip .icon { width: 14px; height: 14px; color: var(--tone, currentColor); }
  .chip:hover { background: #1d2620; color: var(--text); }
  .chip[aria-pressed="true"] { background: var(--tone-bg, #2b3f2f); color: var(--tone, #c9e9cc); border-color: var(--tone-border, #536f58); }
  .category-nav a .icon { color: var(--tone); }
  input[type="checkbox"] { accent-color: var(--green); width: 15px; height: 15px; }
  .results-caption { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); font-size: 10px; margin: 25px 0 16px; }
  .search-results-heading { margin-top: 28px; }
  .search-results-heading > span { font-size: 11px; color: var(--muted); }
  .collection-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 25px; }
  .collection-note .icon { width: 16px; height: 16px; }
  #collection-results > .empty-state { min-height: 320px; }
  .back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); min-height: 36px; margin: -12px 0 19px; }
  .back-link .icon { width: 15px; height: 15px; }
  .back-link:hover { color: var(--green); }
  .tool-heading { display: flex; align-items: center; gap: 17px; }
  .tool-heading > .tool-icon { height: 54px; width: 54px; border-radius: 13px; }
  .tool-heading > .tool-icon .icon { width: 26px; height: 26px; }
  .tool-heading h1 { font-size: 30px; letter-spacing: -.9px; margin-top: 5px; }
  .tool-heading p { font-size: 13px; color: var(--muted); margin-top: 8px; }
  .tool-heading .card-category { margin-bottom: 0; }
  .heading-favorite { margin-left: auto; border: 1px solid var(--border); width: 44px; height: 44px; flex-shrink: 0; }
  .tool-trust { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; margin: 22px 0 28px; }
  .tool-trust .icon { width: 14px; height: 14px; color: var(--green); }
  .word-layout, .calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 20px; align-items: start; }
  .editor-panel, .calculator-form { border: 1px solid #3a4b3e; background: #151c17; border-radius: 10px; overflow: hidden; min-width: 0; }
  .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--border); min-height: 61px; }
  .panel-heading label, .panel-heading h2 { font-size: 12px; font-weight: 500; letter-spacing: 0; }
  #word-input { display: block; width: 100%; min-height: 326px; background: #111813; border: 0; color: #e0e8dd; font-size: 14px; line-height: 1.95; padding: 24px; resize: vertical; outline-offset: -3px; }
  #word-input::placeholder { color: #92a097; }
  .editor-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--border); padding: 11px 17px; color: var(--muted); font-size: 10px; }
  .editor-footer > div { display: flex; align-items: center; gap: 7px; }
  .stats-panel, .result-panel { padding: 23px; border: 1px solid #3a4d3e; background: #1a251d; border-radius: 10px; min-width: 0; }
  .stats-heading { color: #c3d0c1; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 500; }
  .stats-heading .icon { width: 15px; height: 15px; color: var(--muted); }
  .primary-stat { padding: 17px 0 23px; display: flex; align-items: baseline; gap: 10px; }
  .primary-stat > span:first-child { font-size: 56px; line-height: 1.3; color: #c7e8c7; letter-spacing: -2px; font-weight: 500; overflow-wrap: anywhere; }
  .primary-stat > span:last-child { color: #a8bdac; font-size: 12px; }
  .secondary-stats { border-top: 1px solid #344738; border-bottom: 1px solid #344738; padding: 9px 0; }
  .secondary-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 11px; color: #b0c0b0; }
  .secondary-stats strong { font-size: 15px; color: #e5ede1; font-weight: 500; font-variant-numeric: tabular-nums; }
  .stats-note { margin: 17px 0; font-size: 10px; line-height: 1.9; color: #a8bcab; }
  .technical-details { border: 1px solid var(--border); border-radius: 8px; margin-top: 24px; background: #141c16; }
  .technical-details summary { padding: 17px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; color: #b7c8b9; font-size: 12px; }
  .technical-details summary::-webkit-details-marker { display: none; }
  .technical-details summary > .icon { width: 16px; height: 16px; }
  .technical-details summary > .icon:last-child { margin-left: auto; }
  .technical-details[open] summary > .icon:last-child { transform: rotate(90deg); }
  .details-body { border-top: 1px solid var(--border); padding: 19px 22px; color: var(--muted); font-size: 12px; line-height: 1.9; }
  .details-body p + p { margin-top: 12px; }
  .details-body strong { font-weight: 500; color: #d8e4d7; }
  .mode-switch { display: flex; width: fit-content; padding: 5px; border: 1px solid var(--border); background: #151c17; border-radius: 8px; margin-bottom: 23px; gap: 3px; }
  .mode-switch button { min-height: 42px; background: transparent; border: 1px solid transparent; border-radius: 5px; color: #a9b9ab; font-size: 12px; padding: 10px 17px; }
  .mode-switch button[aria-pressed="true"] { background: #2e4333; color: #daf1db; border-color: #536f58; }
  .calculator-form .panel-heading { padding-inline: 22px; }
  .form-description { color: var(--muted); margin: 22px 23px 0; font-size: 12px; }
  .number-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 23px 17px; }
  .number-fields label { display: block; margin-bottom: 9px; font-size: 12px; color: #c3d0c0; }
  .number-input { display: flex; border: 1px solid #526657; background: #101812; border-radius: 6px; align-items: center; }
  .number-input:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
  .number-input input { width: 100%; min-width: 0; height: 52px; background: none; border: none; outline: 0; padding: 0 13px; font-variant-numeric: tabular-nums; color: var(--text); }
  .number-input input::placeholder { color: #8e9c90; font-size: 12px; }
  .number-input span { padding-right: 13px; color: var(--muted); }
  .number-input span:empty { display: none; }
  .input-hint { font-size: 10px; color: var(--muted); margin: 0 23px; line-height: 1.8; }
  .input-hint strong { font-weight: 500; color: #becfbe; }
  .form-actions { display: flex; gap: 10px; margin: 26px 23px 23px; }
  .form-actions .primary { flex: 1; }
  .result-panel { min-height: 309px; display: flex; flex-direction: column; }
  #calculation-output { flex: 1; padding: 23px 0; }
  #calculation-output p { color: #a6b9a8; font-size: 11px; line-height: 1.8; margin-top: 12px; }
  .result-placeholder { display: block; color: #708c78; font-size: 40px; line-height: 1; }
  .result-number { color: #c7e8c7; font-size: 40px; letter-spacing: -1.5px; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .result-number > span { font-size: 24px; margin-left: 4px; }
  .rounding-note { display: block; color: #d5cdae; font-size: 10px; margin-top: 10px; }
  .field-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin-top: 8px; }
  #word-error { margin: 0; padding: 12px 20px; border-top: 1px solid #6c4039; }
  #calculation-error { margin: 14px 23px 0; }
  .coming-panel { margin-top: 32px; border: 1px solid var(--border); border-radius: 11px; background: #151e18; padding: 36px; max-width: 760px; }
  .coming-panel h2 { font-size: 23px; margin-top: 22px; }
  .coming-panel p { max-width: 540px; color: var(--muted); font-size: 13px; margin: 14px 0 24px; line-height: 1.9; }
  .about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; margin: 32px 0; }
  .info-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
  .info-panel > .icon { color: var(--green); width: 27px; height: 27px; margin-bottom: 19px; }
  .info-panel h2 { margin-bottom: 17px; }
  .info-panel p { color: var(--muted); font-size: 13px; line-height: 1.9; }
  .info-panel p + p { margin-top: 15px; }
  .legal { max-width: 820px; margin-bottom: 32px; }
  .legal-section + .legal-section { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--border); }
  .legal h2 { margin-bottom: 12px; }
  .legal ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.9; }
  .legal h2 + ul { margin-top: 0; }
  .legal li + li { margin-top: 6px; }
  .legal ul + p { margin-top: 15px; }
  .legal a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
  .legal-notice { margin-bottom: 26px; padding: 12px 15px; border: 1px solid #6b5939; border-radius: 8px; background: #362e20; }
  .info-panel .legal-notice, .legal-notice strong { color: #f2deb3; }
  .legal-todo { padding: 1px 5px; border: 1px solid #6b5939; border-radius: 4px; background: #362e20; color: #f2deb3; overflow-wrap: anywhere; }
  .footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
  .not-found { padding: 70px 0; }
  .not-found h1 { margin-bottom: 15px; }
  .not-found p { color: var(--muted); margin-bottom: 25px; }
  .storage-warning { color: #f2deb3; background: #362e20; border-bottom: 1px solid #6b5939; padding: 12px 40px; font-size: 12px; }
  .toast { position: fixed; bottom: 25px; left: calc(50% + 118px); transform: translateX(-50%); padding: 13px 20px; background: #cbe5ca; border: 1px solid #e2f4df; color: #1a311f; border-radius: 8px; z-index: 80; font-size: 12px; max-width: min(550px, calc(100% - 32px)); box-shadow: 0 8px 30px #0004; }
}

@layer responsive {
  .menu-button { display: none; }
  @media (min-width: 1600px) { main { padding-top: 52px; } }
  @media (max-width: 1200px) {
    .sidebar { width: 216px; padding-inline: 13px; }
    .page { margin-left: 216px; }
    main { padding: 33px 28px 40px; }
    .topbar { padding-inline: 28px; }
    .footer { margin-inline: 28px; }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    h1 { font-size: 31px; }
    .word-layout, .calculator-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
    .stats-panel, .result-panel { padding: 19px; }
    .number-fields { grid-template-columns: 1fr; gap: 15px; }
    .personal-grid { gap: 18px; }
    .category-grid { gap: 8px; }
    .category-card { padding: 14px 11px; }
    .category-card strong { font-size: 11px; }
    .toast { left: calc(50% + 108px); }
  }
  @media (max-width: 960px) {
    .sidebar { width: 190px; padding-inline: 10px; }
    .page { margin-left: 190px; }
    .main-nav a { font-size: 11px; padding-inline: 10px; gap: 8px; }
    .brand-caption { font-size: 10px; }
    main { padding-inline: 24px; }
    h1 { font-size: 29px; }
    .topbar { padding-inline: 24px; }
    .topbar-right { gap: 10px; }
    .topbar-note { display: none; }
    .word-layout, .calculator-layout { grid-template-columns: 1fr; }
    .stats-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; }
    .stats-heading { grid-column: 1 / -1; }
    .primary-stat { align-self: center; padding: 0; }
    .secondary-stats { border-top: 0; border-bottom: 0; }
    .stats-note { margin: 8px 0; }
    .result-panel { min-height: 200px; }
    .number-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .featured .card-body h3 { font-size: 18px; }
    .card-body p { font-size: 11px; }
    .tool-card.featured { padding-inline: 18px; }
    .featured .card-bottom { margin-inline: -18px; padding-inline: 18px; }
    .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bottom-note { flex-wrap: wrap; }
    .bottom-note > span { flex: 1; }
    .bottom-note a { margin-left: 26px; }
    .personal-grid { grid-template-columns: 1fr; gap: 0; }
    .personal-grid .empty-state { min-height: 158px; }
    .about-grid { grid-template-columns: 1fr; }
    .toast { left: calc(50% + 95px); }
  }
  @media (max-width: 700px) {
    .sidebar { visibility: hidden; transform: translateX(-100%); width: 270px; transition: transform .2s; padding: 25px 20px 0; }
    .menu-open .sidebar { visibility: visible; transform: translateX(0); }
    .menu-open { overflow: hidden; }
    .mobile-scrim { position: fixed; inset: 0; background: #0009; z-index: 35; backdrop-filter: blur(2px); }
    .menu-button { display: inline-flex; margin-left: -7px; }
    .page { margin-left: 0; }
    .topbar { padding-inline: 20px; height: 63px; }
    .breadcrumbs { gap: 7px; font-size: 10px; min-width: 0; }
    .breadcrumbs > span:first-child, .breadcrumbs > .icon { display: none; }
    #breadcrumb { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .topbar-right { flex-shrink: 0; }
    .version-pill { font-size: 9px; min-height: 32px; padding-inline: 9px; }
    main { padding: 29px 20px 35px; }
    .page-heading { gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
    h1 { font-size: 29px; line-height: 1.23; letter-spacing: -1px; }
    .page-heading p { font-size: 12px; margin-top: 10px; }
    .search-box { padding-inline: 13px; height: 52px; }
    .search-box input { font-size: 16px; }
    .search-box input::placeholder { font-size: 11px; }
    .search-box kbd { display: none; }
    .section { margin-top: 28px; }
    .section-heading { gap: 8px; margin-bottom: 15px; }
    .section-heading h2 { font-size: 15px; gap: 6px; }
    .section-heading p { font-size: 10px; max-width: 220px; }
    .text-link { font-size: 10px; gap: 5px; white-space: nowrap; }
    .featured-grid { gap: 13px; }
    .featured .card-body h3 { font-size: 16px; }
    .card-top { margin-bottom: 14px; }
    .tool-card.featured { padding-top: 16px; padding-inline: 16px; }
    .featured .card-bottom { margin-inline: -16px; padding-inline: 16px; }
    .tool-card.featured .tool-icon { width: 38px; height: 38px; }
    .tool-card.featured .tool-icon .icon { width: 20px; height: 20px; }
    .featured .card-bottom { flex-wrap: wrap; gap: 5px; }
    .featured .card-link { margin-left: auto; }
    .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .category-card { padding: 14px; }
    .category-card strong { font-size: 11px; }
    .bottom-note { margin-top: 25px; font-size: 10px; align-items: flex-start; }
    .bottom-note > .icon { margin-top: 2px; }
    .footer { margin-inline: 20px; font-size: 9px; flex-wrap: wrap; }
    .footer-separator { margin-inline: 7px; }
    .footer a { min-height: 30px; }
    .footer > span { display: flex; align-items: center; }
    .tool-grid { gap: 12px; }
    .tool-card { padding: 17px; }
    .card-body h3 { font-size: 15px; }
    .filters { gap: 9px; margin-top: 18px; }
    .chip { min-height: 44px; font-size: 11px; padding: 9px 11px; }
    .tool-heading { gap: 12px; align-items: flex-start; }
    .tool-heading > .tool-icon { width: 42px; height: 42px; border-radius: 10px; }
    .tool-heading > .tool-icon .icon { width: 22px; height: 22px; }
    .tool-heading h1 { font-size: 25px; letter-spacing: -.8px; }
    .tool-heading p { font-size: 11px; margin-top: 8px; }
    .heading-favorite { width: 38px; height: 38px; }
    .tool-trust { font-size: 9px; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
    .editor-panel .panel-heading { padding-inline: 15px; }
    #word-input { font-size: 16px; padding: 18px; min-height: 270px; }
    .editor-footer { padding: 10px 12px; gap: 7px; flex-wrap: wrap; }
    .editor-footer .icon-button { width: 44px; height: 44px; }
    .stats-panel { padding: 19px; gap: 8px 20px; }
    .primary-stat > span:first-child { font-size: 46px; }
    .secondary-stats > div { padding-block: 7px; font-size: 10px; }
    .stats-note { font-size: 10px; }
    .technical-details summary { padding: 17px; }
    .details-body { padding: 18px; }
    .mode-switch { width: 100%; gap: 2px; }
    .mode-switch button { flex: 1; font-size: 10px; padding: 9px 7px; }
    .number-fields { grid-template-columns: 1fr; gap: 18px; }
    .number-input input { font-size: 16px; }
    .calculator-form .panel-heading { padding-inline: 18px; gap: 8px; }
    .calculator-form .panel-heading h2 { font-size: 11px; }
    .calculator-form .subtle-button { font-size: 10px; }
    .form-description, .number-fields, .form-actions { margin-inline: 18px; }
    .input-hint { margin-inline: 18px; }
    .coming-panel { padding: 25px; }
    .coming-panel h2 { font-size: 21px; }
    .info-panel { padding: 22px; }
    .toast { left: 50%; width: max-content; bottom: 16px; }
    .storage-warning { padding-inline: 20px; }
    .main-nav a, .category-nav a { font-size: 13px; min-height: 44px; }
    .brand-caption { font-size: 11px; }
  }
  @media (max-width: 430px) {
    .featured-grid, .tool-grid { grid-template-columns: 1fr; }
    .tool-card.featured { padding: 19px 21px 0; }
    .featured .card-body h3 { font-size: 19px; }
    .featured .card-body p { font-size: 12px; }
    .featured .card-bottom { margin: 21px -21px 0; padding: 10px 21px; flex-wrap: nowrap; }
    .card-top { margin-bottom: 12px; }
    .stats-panel { grid-template-columns: 1fr; }
    .secondary-stats { border-top: 1px solid #344738; }
    .primary-stat { padding-block: 8px; }
    .stats-note { margin-block: 8px; }
    .section-heading p { max-width: 185px; }
    .tool-card .favorite { width: 44px; height: 44px; }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-heading h1 { font-size: 23px; }
    .tool-heading > .tool-icon { display: none; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; animation: none !important; } }
}

@layer components {
  .transform-hint { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 20px; max-width: 820px; }
  .transform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .transform-grid .panel-heading { flex-wrap: wrap; gap: 8px; }
  .transform-text { display: block; width: 100%; min-height: 320px; padding: 20px; resize: vertical; border: 0; background: #111813; color: var(--text); font-size: 14px; line-height: 1.8; outline-offset: -3px; }
  .transform-text::placeholder { color: #92a097; }
  .code-text { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
  .output-panel { border-color: #4a6350; }
  .output-panel .transform-text { background: #18231c; }
  .output-panel .editor-footer { min-height: 48px; }
  .transform-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 17px 20px; border-top: 1px solid var(--border); }
  .transform-actions .primary { flex: 1; }
  .transform-modes { flex-wrap: wrap; }
  .cleanup-options { display: flex; flex-wrap: wrap; gap: 10px 24px; border: 1px solid var(--border); border-radius: 8px; padding: 14px 20px 18px; margin: 0 0 18px; }
  .cleanup-options legend { font-size: 12px; color: var(--muted); padding-inline: 7px; }
  .cleanup-options label { display: flex; gap: 8px; align-items: center; font-size: 12px; min-height: 36px; cursor: pointer; }
  .transform-error { border: 1px solid #704a43; background: #2e211e; border-radius: 8px; padding: 14px 18px; margin-top: 20px; overflow-wrap: anywhere; }
  .uuid-grid { grid-template-columns: minmax(230px, .65fr) minmax(0, 1.35fr); }
  .uuid-count { padding: 24px 20px; }
  .uuid-count input { width: 100%; padding: 14px; border: 1px solid #526657; border-radius: 6px; color: var(--text); background: #101812; font-size: 20px; }
  .uuid-count p { color: var(--muted); font-size: 12px; margin-top: 12px; }
  .qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .qr-grid .panel-heading { flex-wrap: wrap; gap: 8px; }
  .qr-grid .panel-heading h2 { font-size: 13px; margin: 0; }
  .qr-grid .transform-text { min-height: 235px; }
  .qr-preview { min-height: 278px; padding: 24px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; }
  .qr-preview svg { width: 36px; height: 36px; margin-bottom: 12px; opacity: .6; }
  .qr-preview canvas { display: block; max-width: 100%; max-height: 330px; width: auto; height: auto; object-fit: contain; }
  .qr-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; font-size: 12px; }
  .qr-options select { border: 1px solid #526657; border-radius: 6px; background: #101812; color: var(--text); padding: 10px 14px; min-height: 44px; }
  .qr-download-row { display: flex; justify-content: center; padding: 0 20px 20px; }
  .qr-dropzone { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: 20px; padding: 26px 18px; border: 1px dashed #647a69; border-radius: 8px; background: #18231c; }
  .qr-dropzone > svg { width: 28px; height: 28px; color: var(--green); }
  .qr-dropzone strong { font-size: 14px; }
  .qr-dropzone p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0; }
  .qr-dropzone.drag-over { border-color: var(--green); background: #243729; }
  .qr-file-label { position: relative; overflow: hidden; cursor: pointer; }
  .qr-file-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .qr-file-label:focus-within { outline: 2px solid var(--green); outline-offset: 4px; }
  .qr-filename, .qr-result-note { padding: 0 20px; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
  .qr-grid + .transform-hint, #qr-form + .transform-hint { margin-top: 20px; }
  .utility-form .panel-heading { flex-wrap: wrap; gap: 10px; }
  .utility-form .number-fields { margin-top: 24px; }
  .utility-category, .unit-pair { margin: 22px 23px; }
  .utility-category label, .unit-pair label { display: block; font-size: 12px; color: #c0cfc3; margin-bottom: 8px; }
  .utility-form select { width: 100%; min-width: 0; min-height: 48px; padding: 10px; background: #111813; border: 1px solid #526657; border-radius: 6px; color: var(--text); }
  .utility-number { grid-template-columns: 1fr; }
  .unit-pair { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 8px; align-items: end; }
  .unit-swap { height: 48px; width: 44px; border: 1px solid var(--border); }
  .utility-form .input-hint + .input-hint { margin-top: 10px; }
  .utility-error { margin: 16px 23px 0; }
  .date-inclusive { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 23px; min-height: 44px; font-size: 12px; cursor: pointer; }
  .date-inclusive span { color: var(--muted); }
  #utility-output { flex: 1; padding: 23px 0; min-width: 0; }
  #utility-output p { font-size: 12px; color: #b2c5b5; line-height: 1.8; margin-top: 16px; overflow-wrap: anywhere; }
  .utility-result { font-size: clamp(28px, 3vw, 40px); }
  .money-result { font-size: clamp(24px, 2.8vw, 36px); }
  .discount-breakdown { font-size: 12px; margin: 24px 0 0; }
  .discount-breakdown div { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid #344738; }
  .discount-breakdown dt { color: #b2c5b5; }
  .discount-breakdown dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
}

@layer responsive {
  @media (max-width: 960px) { .transform-grid, .qr-grid { grid-template-columns: 1fr; } }
  @media (max-width: 960px) { .utility-layout { grid-template-columns: 1fr; } }
  @media (max-width: 700px) {
    .utility-category, .unit-pair, .date-inclusive { margin-inline: 18px; }
    .unit-pair { grid-template-columns: minmax(0, 1fr) 44px; }
    .unit-pair > div:last-child { grid-column: 1; grid-row: 2; }
    .unit-swap { grid-row: 1 / 3; align-self: center; }
    .utility-form select { font-size: 16px; }
    .utility-form input[type="date"] { max-width: 100%; }
  }
  @media (max-width: 700px) {
    .transform-text { min-height: 250px; font-size: 16px; padding: 16px; }
    .transform-modes { width: 100%; }
    .transform-modes button { min-height: 44px; }
    .cleanup-options { display: grid; gap: 4px; padding: 12px 16px; }
    .cleanup-options label { min-height: 44px; }
    .transform-actions { padding: 16px; }
  }
}

@layer components {
  .currency-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .currency-privacy { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 18px 23px 0; }
  .currency-privacy a, .currency-source a { text-decoration: underline; text-underline-offset: 3px; }
  #currency-output .result-number > span { display: block; margin: 14px 0 8px; font-size: 16px; letter-spacing: .6px; }
  .currency-source { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--border); border-radius: 12px; margin: 20px 0; }
  .currency-source h2 { font-size: 14px; margin: 0 0 8px; }
  .currency-source p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 6px 0 0; }
  .currency-source button { flex-shrink: 0; }
  #currency-output { flex: 1; overflow-wrap: anywhere; }
  #currency-output p { font-size: 13px; line-height: 1.7; color: var(--muted); }
}
@layer responsive {
  @media (max-width: 1100px) { .currency-layout { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 600px) { .currency-source { flex-direction: column; padding: 20px; } }
}

@layer components {
  .word-results { padding: 22px; min-height: 220px; font-size: 13px; color: var(--muted); }
  .word-chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
  .word-chips li { border: 1px solid #415646; background: #1d2b21; color: #d9e8db; padding: 10px 14px; border-radius: 7px; font-size: 16px; }
  #random-total { font-size: 12px; color: var(--muted); }
  .image-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .image-workspace h2 { font-size: 13px; }
  .image-previews { display: grid; gap: 20px; min-width: 0; }
  .image-preview { min-height: 170px; padding: 18px; display: grid; place-items: center; background: repeating-conic-gradient(#202b23 0% 25%, #18211b 0% 50%) 50% / 20px 20px; }
  .image-preview img { max-width: 100%; max-height: 240px; width: auto; height: auto; object-fit: contain; }
  .image-preview p { color: var(--muted); font-size: 12px; text-align: center; }
  .image-filename, .image-metadata { margin: 14px 20px; font-size: 12px; color: #c0cfc3; line-height: 1.8; overflow-wrap: anywhere; }
  .image-options { margin: 24px 20px 0; padding: 18px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
  .image-options legend { font-size: 12px; padding: 0 8px; color: var(--muted); }
  .image-options:disabled { opacity: .5; }
  .image-options label { display: block; font-size: 12px; margin: 4px 0 10px; }
  .image-options input:not([type="checkbox"]), .image-options select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px; background: #101812; color: var(--text); border: 1px solid #526657; border-radius: 6px; font: inherit; }
  .image-options input[type="color"] { padding: 4px; }
  .image-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .image-options .image-check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 10px 0 0; }
  .image-help, .image-status { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 14px; }
  .image-note { margin: 18px 20px; }
  .image-help a { text-decoration: underline; }
  #image-background-row, #image-quality-row { margin-top: 16px; }
  .image-status { min-height: 24px; margin-bottom: 20px; }
  #image-error, #random-error { margin: 16px 20px; }
}
@layer responsive {
  @media (max-width: 960px) { .image-workspace { grid-template-columns: 1fr; } }
  @media (max-width: 600px) { .image-options input:not([type="checkbox"]), .image-options select { font-size: 16px; } }
}

@layer components {
  .welcome { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 16px 20px 18px; margin-bottom: 20px; }
  .welcome-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .welcome h2 { font-size: 15px; }
  .welcome-tips { list-style: none; margin: 10px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
  .welcome-tips li { display: flex; gap: 10px; align-items: flex-start; }
  .welcome-tips .icon { width: 16px; height: 16px; color: var(--green); margin-top: 2px; }
  .welcome-tips kbd { width: auto; height: auto; padding: 0 5px; font-size: 11px; line-height: 1.5; }
  .about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
  .about-facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .about-facts li { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 16px 18px; }
  .about-facts strong { display: block; font-size: 15px; margin-bottom: 4px; }
  .about-facts span { color: var(--muted); font-size: 12px; line-height: 1.6; }
  .about-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .about-shot { margin: 0; min-width: 0; }
  .about-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
  .about-shot a:hover img { border-color: var(--tone-border, #526653); }
  .about-shot figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
  .about-shot figcaption strong { color: var(--tone, var(--text)); font-weight: 600; margin-right: 6px; }
  .info-panel a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
}
@layer responsive {
  @media (max-width: 960px) { .welcome-tips { grid-template-columns: 1fr; gap: 8px; } }
  @media (max-width: 700px) {
    .about-facts, .about-gallery { grid-template-columns: 1fr; }
    .welcome { padding: 14px 16px 16px; }
  }
}

/* Tool illustrations (D-032): tool page heading, featured cards, and 44 px on the other tool cards. */
@layer components {
  .tool-art { display: block; flex-shrink: 0; border-radius: 18px; border: 1px solid var(--tone-border, var(--border)); background: var(--tone-bg, var(--surface)); }
  .tool-card:not(.featured) .tool-art { width: 44px; height: 44px; border-radius: 11px; }
  .tool-heading > .tool-art { width: 96px; height: 96px; border-radius: 22px; }
  .tool-card.featured .tool-art { width: 72px; height: 72px; }
}
@layer responsive {
  @media (max-width: 700px) {
    .tool-heading > .tool-art { width: 72px; height: 72px; border-radius: 17px; }
    .tool-card.featured .tool-art { width: 64px; height: 64px; border-radius: 15px; }
  }
}

/* Accounts (Paket C): sign-in, profile, merge banner. */
@layer components {
  .guest-panel .button { display: flex; margin-top: 12px; color: #14291a; text-decoration: none; }
  .guest-panel .guest-panel-link { display: inline-block; }
  .account-link.active { background: #233126; border-color: #344739; }
  .account-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
  .guest-avatar { flex: none; font-weight: 600; font-size: 13px; }
  .account-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 14px 40px; border-bottom: 1px solid #344739; background: #18241b; font-size: 12px; }
  .account-banner strong { font-weight: 600; }
  .account-banner p { color: var(--muted); margin-top: 4px; line-height: 1.7; max-width: 720px; }
  .account-banner .form-actions { margin: 0; }
  .account-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: start; }
  .account-panel > .button.wide { margin-top: 22px; }
  .account-panel label { display: block; margin: 0 0 8px; font-size: 12px; color: #c0cfc3; }
  .account-panel input[type="email"] { width: 100%; min-height: 48px; padding: 10px 13px; background: #111813; border: 1px solid #526657; border-radius: 6px; color: var(--text); }
  .account-panel input[aria-invalid="true"] { border-color: var(--danger); }
  .account-panel .input-hint { margin: 8px 0 16px; }
  .account-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--dim); font-size: 11px; }
  .account-divider::before, .account-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
  .email-sent { margin-top: 22px; padding: 16px; border: 1px solid #344739; border-radius: 8px; background: #18241b; }
  .email-sent strong { font-weight: 600; }
  .email-sent .form-actions, .account-warning .form-actions, .danger-zone .form-actions, .account-panel .form-actions { margin: 16px 0 0; flex-wrap: wrap; }
  .account-facts ul { margin: 0 0 15px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.9; }
  .account-facts a, .account-panel a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
  .account-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .account-identity .guest-avatar { width: 44px; height: 44px; font-size: 16px; }
  .account-identity div { min-width: 0; }
  .account-identity strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
  .account-identity small { color: var(--muted); font-size: 12px; }
  .sync-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
  .sync-box h2 { margin-bottom: 4px; }
  .info-panel .sync-counts { font-size: 12px; margin-top: 10px; }
  .account-warning { margin-top: 16px; padding: 14px 16px; border: 1px solid #6b5939; border-radius: 8px; background: #362e20; }
  .info-panel .account-warning p { color: #f2deb3; }
  .danger-zone { border-color: #5a3532; }
  .button.danger { background: #3a2220; border-color: #7a3f3a; color: #ffd9d4; }
  .button.danger:hover:not(:disabled) { background: #4a2a27; border-color: #a0544c; }
  .danger-zone > .button { margin-top: 18px; }
  .account-loading { color: var(--muted); }
  @media (max-width: 960px) { .account-layout { grid-template-columns: 1fr; } }
  @media (max-width: 700px) {
    .account-banner { padding: 14px 20px; }
    .account-panel input[type="email"] { font-size: 16px; }
    .sync-box { flex-wrap: wrap; }
  }
}

@layer responsive {
  @media (max-width: 700px) { .account-panel .input-hint { margin-inline: 0; } }
}

/* QR Code Generator: colors and logo (Paket D). */
@layer components {
  .qr-fieldset { margin: 0; padding: 16px 20px; border: 0; border-top: 1px solid var(--border); min-width: 0; }
  .qr-fieldset legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-size: 12px; color: #c3d0c0; }
  .qr-fieldset legend span { color: var(--muted); }
  .qr-fieldset.drag-over { background: #18231c; outline: 1px dashed var(--green); outline-offset: -4px; }
  .qr-color-row { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .qr-color-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
  .qr-fieldset input[type="color"] { width: 44px; height: 44px; padding: 3px; border: 1px solid #526657; border-radius: 6px; background: #101812; cursor: pointer; }
  .qr-note { display: block; clear: both; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
  .qr-note.warning { color: #f2deb3; }
  .qr-logo-row { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .qr-logo-row .qr-note { flex: 1; min-width: 160px; margin: 0; overflow-wrap: anywhere; }
  .qr-logo-row .qr-file-label .icon { width: 15px; height: 15px; }
  .qr-logo-options { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; margin-top: 14px; font-size: 12px; }
  .qr-logo-options output { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 4px; }
  .qr-logo-options input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--green); }
  .qr-logo-options select { border: 1px solid #526657; border-radius: 6px; background: #101812; color: var(--text); padding: 10px 14px; min-height: 44px; }
}

@layer responsive {
  @media (max-width: 430px) { .qr-logo-options { grid-template-columns: 1fr; } .qr-logo-options select { font-size: 16px; } }
}

@layer components {
  .qr-logo-options .qr-check-row { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
}

/* Paper Builder (Paket F1). */
@layer components {
  .paper-app { display: flex; flex-direction: column; gap: 16px; }
  .paper-app input[type="text"], .paper-app input[type="email"], .paper-app input[type="url"], .paper-app input[type="number"], .paper-app textarea, .paper-app select, .paper-dialog textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: #111813; border: 1px solid #526657; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; }
  .paper-app textarea, .paper-dialog textarea { resize: vertical; line-height: 1.6; }
  .paper-app input[type="checkbox"] { width: 16px; height: 16px; }
  .paper-app .paper-code, .paper-dialog .paper-code { font-family: var(--font-mono); font-size: 12px; }
  .paper-label { display: block; margin: 14px 0 6px; font-size: 12px; color: #c0cfc3; }
  .paper-count { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
  .paper-hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 6px 0; }
  .paper-note { color: #f2deb3; background: #362e20; border: 1px solid #6b5939; border-radius: 8px; padding: 10px 14px; font-size: 12px; }
  .paper-warning { display: flex; gap: 10px; align-items: flex-start; color: #f2deb3; background: #362e20; border: 1px solid #6b5939; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }
  .paper-warning .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
  .paper-projects { display: flex; flex-direction: column; gap: 18px; }
  .paper-projects-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
  .paper-projects-head p { color: var(--muted); font-size: 12px; margin-top: 6px; }
  .paper-actions, .paper-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .paper-project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .paper-project-list li { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 8px 6px 6px; }
  .paper-project-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit; padding: 10px 12px; border-radius: 6px; min-height: 44px; }
  .paper-project-open:hover { background: var(--surface-hover); }
  .paper-project-open strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
  .paper-project-open small { color: var(--muted); font-size: 11px; }
  .paper-empty { padding: 36px 16px; }
  .paper-claim { color: var(--muted); font-size: 12px; line-height: 1.8; max-width: 760px; }
  .paper-bar { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
  .paper-save { color: var(--muted); font-size: 12px; margin-right: auto; }
  .paper-tabs { display: none; }
  .paper-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .paper-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .paper-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px 20px; }
  .paper-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
  .paper-authors { display: grid; gap: 12px; margin-top: 14px; }
  .paper-author { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px 14px; min-width: 0; }
  .paper-author legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
  .paper-author-remove { position: absolute; top: 4px; right: 6px; }
  .paper-section-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .paper-app .paper-section-head .paper-section-title { flex: 1 1 220px; width: auto; font-weight: 600; font-size: 14px; }
  .paper-app .paper-section-head select, .paper-app .paper-add select { width: auto; }
  .paper-block { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
  .paper-block-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
  .paper-block-type { margin-right: auto; font-size: 11px; color: var(--tone, var(--muted)); }
  .paper-toolbar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
  .paper-toolbar .subtle-button { min-height: 36px; }
  .paper-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: #c0cfc3; }
  .paper-inline label, label.paper-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
  .paper-figure { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: start; }
  .paper-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #101611; border: 1px dashed #4a5c4e; border-radius: 8px; overflow: hidden; color: var(--muted); font-size: 11px; text-align: center; }
  .paper-thumb span { display: grid; gap: 6px; justify-items: center; }
  .paper-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
  .paper-figure-fields small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; overflow-wrap: anywhere; }
  .paper-table-wrap { overflow-x: auto; margin-top: 10px; }
  .paper-table { border-collapse: collapse; }
  .paper-table th, .paper-table td { padding: 3px; }
  .paper-app .paper-table input, .paper-app .paper-table select { min-width: 96px; min-height: 38px; padding: 6px 8px; }
  .paper-head-row input { font-weight: 600; }
  .paper-add { margin-top: 14px; }
  .paper-refs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
  .paper-ref-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
  .paper-ref-head code { color: var(--tone, var(--green)); font-family: var(--font-mono); font-size: 12px; }
  .paper-more { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
  .paper-more summary { cursor: pointer; font-size: 12px; color: #c0cfc3; min-height: 32px; display: flex; align-items: center; }
  .paper-more .button { margin-top: 10px; }
  .paper-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 10px; }
  .paper-form-grid label { display: grid; gap: 6px; font-size: 12px; color: #c0cfc3; }
  .paper-preview { position: sticky; top: 64px; max-height: calc(100vh - 90px); overflow: auto; background: #0b0f0d; border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-width: 0; }
  .paper-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
  .paper-preview progress { width: 100%; margin-top: 8px; accent-color: var(--green); }
  .paper-pages { display: grid; gap: 14px; margin-top: 12px; }
  .paper-pages canvas { width: 100%; height: auto; background: #fff; border-radius: 2px; box-shadow: 0 2px 12px #0008; }
  .paper-errors { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
  .paper-errors li, .paper-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.6; }
  .paper-errors li { color: #ffd9d4; background: #3a2220; border: 1px solid #7a3f3a; border-radius: 8px; padding: 10px 12px; }
  .paper-errors li > span, .paper-check > span { flex: 1; min-width: 0; }
  .paper-errors small { display: block; color: #e7b9b2; font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; margin-top: 2px; }
  .paper-errors .icon, .paper-check .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; }
  .paper-errors .subtle-button, .paper-check .subtle-button { min-height: 32px; flex: none; }
  .paper-log { max-height: 280px; overflow: auto; white-space: pre-wrap; font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: #0f1411; padding: 10px; border-radius: 6px; }
  .paper-dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
  .paper-dialog::backdrop { background: #000a; }
  .paper-dialog h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
  .paper-dialog h4 { font-size: 12px; color: var(--muted); font-weight: 500; margin: 16px 0 8px; }
  .paper-dialog p { color: var(--muted); font-size: 13px; line-height: 1.7; }
  .paper-dialog .form-actions { margin: 18px 0 0; flex-wrap: wrap; }
  .paper-symbols { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
  .paper-symbol { min-height: 44px; border: 1px solid var(--border); border-radius: 6px; background: #111813; color: var(--text); font-size: 16px; }
  .paper-symbol:hover { border-color: var(--green); }
  .paper-pick { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; max-height: 50vh; overflow: auto; }
  .paper-pick label { display: flex; gap: 10px; align-items: center; font-size: 13px; min-height: 40px; }
  .paper-pick label span { color: var(--muted); }
  .paper-pick-row { text-align: left; background: #111813; border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 10px 12px; min-height: 44px; font-size: 13px; overflow-wrap: anywhere; }
  .paper-pick-row:hover { border-color: var(--green); }
  .paper-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .paper-check-error { color: #ffd9d4; }
  .paper-check-tip { color: var(--muted); }
  .paper-dialog .paper-ok { color: var(--green); }
  .paper-flash { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 6px; }
  .icon.rot-up { transform: rotate(90deg); }
  .icon.rot-down { transform: rotate(-90deg); }
}

@layer responsive {
  /* Side-by-side needs about 1,100 px of content width; narrower screens switch between Edit and Preview. */
  @media (max-width: 1280px) {
    .paper-tabs { display: flex; gap: 6px; }
    .paper-tabs button { flex: 1; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); }
    .paper-tabs button[aria-selected="true"] { color: var(--green); border-color: #344739; background: #233126; }
    .paper-split { grid-template-columns: minmax(0, 1fr); }
    .paper-split[data-tab-current="edit"] .paper-preview, .paper-split[data-tab-current="preview"] .paper-editor { display: none; }
    .paper-preview { position: static; max-height: none; }
    .paper-bar { position: static; }
  }
  @media (max-width: 700px) {
    .paper-app input[type="text"], .paper-app input[type="email"], .paper-app input[type="url"], .paper-app input[type="number"], .paper-app textarea, .paper-app select, .paper-dialog textarea { font-size: 16px; }
    .paper-figure, .paper-form-grid { grid-template-columns: minmax(0, 1fr); }
    .paper-card { padding: 16px; }
  }
}

@layer components {
  .license-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .license-list li { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.7; }
  .license-list li span { color: var(--muted); }
  .license-list a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
  .legal-note { color: var(--muted); font-size: 12px; }
}
