    :root {
      color-scheme: light;
      --bg: #f6f7f2;
      --bg-2: #eef3ee;
      --panel: #ffffff;
      --panel-soft: #f9faf6;
      --ink: #17201f;
      --muted: #68736f;
      --soft: #8d9893;
      --line: #d9e1dc;
      --line-strong: #bdc9c2;
      --accent: #16746b;
      --accent-2: #d1495b;
      --accent-3: #e0a526;
      --accent-soft: #dcece8;
      --danger: #b42335;
      --danger-soft: #fae4e8;
      --success: #2f7d53;
      --shadow: 0 18px 45px rgba(19, 33, 30, 0.11);
      --shadow-soft: 0 10px 24px rgba(19, 33, 30, 0.08);
      --radius: 8px;
      --sidebar: #17201f;
      --sidebar-soft: rgba(255, 255, 255, 0.08);
      --font: ui-sans-serif, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
      --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    }

    [data-theme="dark"] {
      color-scheme: dark;
      --bg: #121715;
      --bg-2: #19211e;
      --panel: #1d2522;
      --panel-soft: #18201d;
      --ink: #edf4ef;
      --muted: #aeb9b4;
      --soft: #82908a;
      --line: #33413b;
      --line-strong: #485650;
      --accent: #42b8a9;
      --accent-2: #ff7284;
      --accent-3: #e7b94b;
      --accent-soft: #203b37;
      --danger: #ff6b7c;
      --danger-soft: #40242b;
      --success: #75d09e;
      --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
      --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.24);
      --sidebar: #0f1412;
      --sidebar-soft: rgba(255, 255, 255, 0.09);
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      min-height: 100%;
      width: 100%;
      overflow-x: hidden;
    }

    body {
      margin: 0;
      background:
        linear-gradient(120deg, rgba(22, 116, 107, 0.08), transparent 30%),
        radial-gradient(circle at 100% 0, rgba(224, 165, 38, 0.12), transparent 28%),
        var(--bg);
      color: var(--ink);
      font-family: var(--font);
      font-size: 14px;
      line-height: 1.45;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button {
      color: inherit;
    }

    a {
      color: inherit;
    }

    .app {
      display: grid;
      grid-template-columns: 264px minmax(0, 1fr);
      align-items: start;
      height: 100vh;
      width: 100%;
      overflow: hidden;
    }

    .sidebar {
      position: sticky;
      top: 0;
      align-self: start;
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--sidebar);
      color: #f8fbf7;
      border-right: 1px solid rgba(255, 255, 255, 0.08);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 20px 18px 16px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .brand-mark {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: var(--radius);
      background: linear-gradient(145deg, rgba(66, 184, 169, 0.26), rgba(224, 165, 38, 0.2));
      color: #ffffff;
      flex: 0 0 auto;
    }

    .brand-logo {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: calc(var(--radius) - 1px);
      display: block;
    }

    .brand-name {
      font-size: 15px;
      font-weight: 740;
      letter-spacing: 0;
    }

    .brand-x-mark {
      margin: 0 1px;
      color: #f1b32b;
      font-family: "Brush Script MT", "Lucida Handwriting", cursive;
      font-size: 1.55em;
      font-weight: 400;
      line-height: 0.82;
      font-style: italic;
      display: inline-block;
      transform: translateY(1px);
    }

    [data-theme="dark"] .brand-x-mark {
      color: #59cbff;
      filter: drop-shadow(0 1px 3px rgba(89, 203, 255, 0.35));
    }

    .brand-sub {
      display: block;
      margin-top: 1px;
      color: rgba(248, 251, 247, 0.62);
      font-size: 11px;
    }

    .sidebar-scroll {
      min-height: 0;
      overflow-y: auto;
      padding: 12px 10px;
    }

    .sidebar-scroll::-webkit-scrollbar {
      width: 6px;
    }

    .sidebar-scroll::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.16);
      border-radius: 999px;
    }

    .side-label {
      margin: 12px 8px 7px;
      color: rgba(248, 251, 247, 0.45);
      font-size: 10px;
      font-weight: 760;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .nav-item,
    .workspace-row {
      width: 100%;
      min-height: 38px;
      display: flex;
      align-items: center;
      gap: 10px;
      border: 0;
      border-radius: var(--radius);
      background: transparent;
      color: rgba(248, 251, 247, 0.72);
      cursor: pointer;
      text-align: left;
      transition: background 150ms ease, color 150ms ease, transform 150ms ease;
    }

    .nav-item {
      padding: 8px 10px;
      font-size: 13px;
    }

    .workspace-row {
      padding: 8px 8px;
      font-size: 12px;
    }

    .nav-item:hover,
    .workspace-row:hover,
    .workspace-row.is-drop-target {
      background: var(--sidebar-soft);
      color: #ffffff;
    }

    .nav-item.active,
    .workspace-row.active {
      background: rgba(66, 184, 169, 0.2);
      color: #ffffff;
    }

    .workspace-row.dragging,
    .section.dragging,
    .category.dragging,
    .link-card.dragging {
      opacity: 0.45;
    }

    .count-pill {
      margin-left: auto;
      min-width: 24px;
      padding: 2px 7px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.12);
      color: rgba(248, 251, 247, 0.82);
      font-size: 10px;
      text-align: center;
    }

    .workspace-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex: 0 0 auto;
      box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
    }

    .workspace-name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .workspace-actions {
      display: flex;
      margin-left: auto;
      opacity: 0;
      pointer-events: none;
      transition: opacity 150ms ease;
    }

    .workspace-row:hover .workspace-actions,
    .workspace-row:focus-within .workspace-actions {
      opacity: 1;
      pointer-events: auto;
    }

    .side-footer {
      margin-top: auto;
      padding: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      min-height: 0;
      height: 100vh;
      overflow-y: auto;
      overflow-x: clip;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      display: grid;
      grid-template-columns: minmax(160px, 1fr) minmax(220px, 420px) auto;
      align-items: center;
      gap: 14px;
      min-height: 70px;
      padding: 12px 22px;
      background: color-mix(in srgb, var(--panel) 88%, transparent);
      border-bottom: 1px solid var(--line);
      backdrop-filter: blur(18px);
    }

    .crumb {
      color: var(--muted);
      font-size: 12px;
    }

    .page-title {
      margin: 2px 0 0;
      font-size: 20px;
      line-height: 1.1;
      font-weight: 790;
      letter-spacing: 0;
    }

    .search {
      position: relative;
    }

    .search .icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--soft);
      pointer-events: none;
    }

    .search input {
      width: 100%;
      height: 42px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--panel-soft);
      color: var(--ink);
      outline: none;
      padding: 0 14px 0 40px;
      transition: border 150ms ease, box-shadow 150ms ease, background 150ms ease;
    }

    .search input:focus {
      border-color: var(--accent);
      background: var(--panel);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
    }

    .top-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      color: var(--ink);
      padding: 8px 12px;
      font-weight: 680;
      cursor: pointer;
      text-decoration: none;
      transition: transform 150ms ease, background 150ms ease, border 150ms ease, box-shadow 150ms ease, color 150ms ease;
    }

    .btn:hover {
      border-color: var(--line-strong);
      transform: translateY(-1px);
      box-shadow: var(--shadow-soft);
    }

    .btn:focus-visible,
    .icon-btn:focus-visible,
    .link-card:focus-visible,
    .nav-item:focus-visible,
    .workspace-row:focus-visible {
      outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
      outline-offset: 2px;
    }

    .btn.primary {
      border-color: var(--accent);
      background: var(--accent);
      color: #ffffff;
    }

    .btn.primary:hover {
      background: color-mix(in srgb, var(--accent) 88%, #000000);
    }

    .btn.danger {
      border-color: var(--danger);
      background: var(--danger);
      color: #ffffff;
    }

    .btn-danger-compact {
      min-height: 34px;
      padding: 6px 11px;
      font-size: 12px;
    }

    .btn.ghost {
      background: transparent;
    }

    .btn.slim {
      min-height: 32px;
      padding: 6px 10px;
      font-size: 12px;
    }

    .icon-btn {
      width: 32px;
      height: 32px;
      display: inline-grid;
      place-items: center;
      border: 1px solid transparent;
      border-radius: var(--radius);
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      transition: color 150ms ease, background 150ms ease, border 150ms ease, transform 150ms ease;
    }

    .icon-btn:hover {
      border-color: var(--line);
      background: var(--panel-soft);
      color: var(--ink);
    }

    .icon-btn.danger:hover {
      background: var(--danger-soft);
      border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
      color: var(--danger);
    }

    .top-help-btn {
      width: 38px;
      height: 38px;
      border-color: var(--line);
      background: var(--panel);
      color: var(--ink);
    }

    .top-help-btn:hover {
      border-color: var(--line-strong);
      box-shadow: var(--shadow-soft);
      transform: translateY(-1px);
    }

    .icon {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .bookmark-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 50px;
      padding: 9px 22px;
      border-bottom: 1px solid var(--line);
      background: var(--bg-2);
      overflow-x: auto;
    }

    .bookmark-bar::-webkit-scrollbar {
      height: 0;
    }

    .rail-label {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .bookmark-pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      max-width: 170px;
      min-height: 30px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--panel);
      color: var(--ink);
      padding: 5px 10px;
      cursor: pointer;
      white-space: nowrap;
      transition: border 150ms ease, transform 150ms ease, box-shadow 150ms ease;
    }

    .bookmark-pill:hover {
      border-color: var(--accent);
      transform: translateY(-1px);
      box-shadow: var(--shadow-soft);
    }

    .bookmark-pill span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .content {
      flex: 1 0 auto;
      width: min(1460px, 100%);
      margin: 0 auto;
      padding: 22px;
      min-width: 0;
      overflow-x: clip;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 18px;
    }

    .stat {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 82px;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    }

    .stat-icon {
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border-radius: var(--radius);
      color: var(--accent);
      background: var(--accent-soft);
    }

    .stat-value {
      display: block;
      font-size: 23px;
      font-weight: 820;
      line-height: 1;
    }

    .stat-label {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
    }

    .view-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 8px 0 12px;
    }

    .view-head h2 {
      margin: 0;
      font-size: 16px;
      letter-spacing: 0;
    }

    .muted {
      color: var(--muted);
    }

    .section-stack {
      display: grid;
      gap: 16px;
    }

    .section {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: color-mix(in srgb, var(--panel) 92%, transparent);
      box-shadow: var(--shadow-soft);
      overflow: hidden;
    }

    .section.is-drop-target,
    .category.is-drop-target,
    .link-card.is-drop-target {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
    }

    .section-head,
    .category-head {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .section-head {
      padding: 13px 14px;
      border-bottom: 1px solid var(--line);
      background: var(--panel);
    }

    .section-title {
      min-width: 0;
      margin: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 15px;
      font-weight: 790;
    }

    .section-meta,
    .category-meta {
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
    }

    .head-spacer {
      flex: 1 1 auto;
      min-width: 8px;
    }

    .category-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
      gap: 14px;
      padding: 14px;
    }

    .category {
      min-height: 178px;
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      overflow: hidden;
    }

    .category-head {
      min-height: 46px;
      padding: 10px 10px 8px;
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--panel) 72%, var(--panel-soft));
    }

    .category-title {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 760;
    }

    .link-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
      gap: 8px;
      padding: 10px;
    }

    .link-card {
      min-width: 0;
      min-height: 126px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      padding: 10px;
      overflow: hidden;
      cursor: pointer;
      text-align: left;
      transition: border 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
    }

    .link-card:hover {
      border-color: var(--accent);
      box-shadow: var(--shadow-soft);
      transform: translateY(-2px);
    }

    .link-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
      margin-bottom: 12px;
    }

    .favicon {
      position: relative;
      display: grid;
      place-items: center;
      width: 36px;
      height: 36px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--accent-soft);
      color: var(--accent);
      overflow: hidden;
      flex: 0 0 auto;
    }

    .favicon-img {
      width: 20px;
      height: 20px;
      object-fit: contain;
    }

    .favicon-fallback {
      display: none;
      width: 100%;
      height: 100%;
      place-items: center;
      font-weight: 820;
      text-transform: uppercase;
    }

    .link-actions {
      display: grid;
      grid-template-columns: repeat(2, 32px);
      gap: 2px;
      flex: 0 0 auto;
      opacity: 0;
      pointer-events: none;
      transition: opacity 150ms ease;
    }

    .link-card:hover .link-actions,
    .link-card:focus-within .link-actions {
      opacity: 1;
      pointer-events: auto;
    }

    .link-title {
      min-width: 0;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      font-weight: 760;
      line-height: 1.25;
    }

    .link-url {
      min-width: 0;
      margin-top: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 11px;
    }

    .link-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
      margin-top: auto;
      padding-top: 10px;
    }

    .link-foot .icon-btn {
      flex: 0 0 auto;
    }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      flex: 1 1 auto;
      min-width: 0;
      max-width: 100%;
      min-height: 23px;
      padding: 3px 7px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--panel-soft);
      color: var(--muted);
      font-size: 11px;
      overflow: hidden;
      white-space: nowrap;
    }

    .tag .icon {
      flex: 0 0 auto;
    }

    .tag-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .empty {
      display: grid;
      place-items: center;
      min-height: 116px;
      margin: 10px;
      border: 1px dashed var(--line-strong);
      border-radius: var(--radius);
      color: var(--muted);
      text-align: center;
      padding: 18px;
    }

    .empty strong {
      display: block;
      margin-bottom: 2px;
      color: var(--ink);
    }

    .results-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 10px;
    }

    .settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
      overflow-x: clip;
    }

    .settings-columns {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
    }

    .settings-column {
      display: grid;
      align-content: start;
      gap: 14px;
      min-width: 0;
    }

    .settings-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      padding: 18px;
      box-shadow: var(--shadow-soft);
      min-width: 0;
      overflow-x: clip;
    }

    .settings-card h3 {
      margin: 0 0 10px;
      font-size: 18px;
      line-height: 1.2;
    }

    .settings-card p {
      margin: 0 0 16px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
    }

    .setting-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .drop-note {
      margin-top: 12px;
      border: 1px dashed var(--line-strong);
      border-radius: var(--radius);
      padding: 12px;
      color: var(--muted);
      font-size: 12px;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      z-index: 90;
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 42px;
      max-width: min(92vw, 520px);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 999px;
      background: var(--sidebar);
      color: #ffffff;
      padding: 10px 16px;
      box-shadow: var(--shadow);
      transform: translate(-50%, 22px);
      opacity: 0;
      pointer-events: none;
      transition: opacity 180ms ease, transform 180ms ease;
    }

    .toast.show {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    .modal-root {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: none;
    }

    .modal-root.open {
      display: block;
    }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(10, 14, 12, 0.52);
      backdrop-filter: blur(8px);
    }

    .modal {
      position: absolute;
      left: 50%;
      top: 50%;
      width: min(94vw, 560px);
      max-height: min(88vh, 760px);
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel);
      box-shadow: var(--shadow);
      overflow: hidden;
      transform: translate(-50%, -50%);
    }

    .modal.small {
      width: min(94vw, 430px);
    }

    .modal.manual {
      width: min(94vw, 860px);
    }

    .modal-head {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
    }

    .modal-head h2 {
      margin: 0;
      font-size: 17px;
      line-height: 1.2;
    }

    .modal-body {
      overflow-y: auto;
      padding: 18px;
    }

    .modal-foot {
      display: flex;
      justify-content: flex-end;
      gap: 9px;
      padding: 14px 18px;
      border-top: 1px solid var(--line);
      background: var(--panel-soft);
    }

    .manual-guide {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .manual-hero {
      grid-column: 1 / -1;
      border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
      border-radius: 12px;
      background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, var(--panel-soft)) 0%, var(--panel-soft) 100%);
      padding: 14px;
      box-shadow: var(--shadow-soft);
    }

    .manual-hero h3 {
      margin: 0 0 6px;
      font-size: 16px;
      color: var(--ink);
    }

    .manual-hero p {
      margin: 0;
      color: var(--muted);
      line-height: 1.5;
    }

    .manual-hero-chips {
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .manual-chip {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 2px 9px;
      border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
      border-radius: 999px;
      background: color-mix(in srgb, var(--panel) 78%, var(--accent-soft));
      color: color-mix(in srgb, var(--ink) 88%, var(--accent));
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.01em;
    }

    .manual-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      padding: 12px;
      transition: transform 150ms ease, box-shadow 150ms ease, border 150ms ease;
    }

    .manual-card:hover {
      transform: translateY(-1px);
      border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
      box-shadow: var(--shadow-soft);
    }

    .manual-guide h3 {
      margin: 0 0 6px;
      font-size: 14px;
    }

    .manual-guide ul {
      margin: 0;
      padding-left: 18px;
      color: var(--muted);
    }

    .manual-guide li + li {
      margin-top: 4px;
    }

    .license-text {
      margin: 0;
      white-space: pre-wrap;
      word-break: break-word;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 12px;
      line-height: 1.55;
    }

    .background-upload {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      padding: 9px 11px;
    }

    .background-upload .btn {
      min-height: 32px;
      padding: 6px 10px;
      font-size: 12px;
      flex: 0 0 auto;
    }

    .background-upload-name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--muted);
      font-size: 13px;
    }

    .background-actions {
      margin-top: 10px;
    }

    .palette-grid {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .palette-btn {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      color: var(--ink);
      padding: 8px 11px;
      text-align: left;
      font-size: 14px;
      cursor: pointer;
      transition: border 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    }

    .palette-btn:hover {
      border-color: var(--line-strong);
      transform: translateY(-1px);
      box-shadow: var(--shadow-soft);
    }

    .palette-btn.active {
      border-color: var(--accent);
      background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel-soft));
      box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
    }

    .palette-swatches {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex: 0 0 auto;
    }

    .palette-swatch-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .site-footer {
      --footer-bg: var(--panel);
      --footer-chip: var(--panel-soft);
      --footer-text: var(--ink);
      --footer-muted: color-mix(in srgb, var(--muted) 92%, transparent);
      --footer-line: color-mix(in srgb, var(--line) 90%, transparent);
      --footer-subtext: color-mix(in srgb, var(--muted) 84%, transparent);
      margin-top: 24px;
      width: min(1460px, 100%);
      margin-left: auto;
      margin-right: auto;
      background: var(--footer-bg);
      border: 1px solid var(--footer-line);
      border-radius: 14px;
      max-width: 100%;
      overflow: hidden;
    }

    .site-footer-global {
      grid-column: 1 / -1;
      width: 100%;
      margin-top: 22px;
      border-radius: 0;
      border-left: 0;
      border-right: 0;
    }

    .footer-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 32px;
      width: min(1100px, 100%);
      max-width: 100%;
      margin: 0 auto;
      padding: 30px 40px 22px;
    }

    .footer-section {
      min-width: 0;
    }

    .footer-about {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      gap: 10px;
      align-items: flex-start;
      max-width: 560px;
      text-align: left;
    }

    .footer-brand {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .footer-avatar {
      width: 48px;
      height: 48px;
      flex-shrink: 0;
      border-radius: 50%;
      object-fit: cover;
      background: var(--panel);
      box-shadow: 0 2px 10px rgba(30, 30, 27, 0.1);
    }

    .footer-name {
      margin: 0;
      color: var(--footer-text);
      line-height: 1;
    }

    .footer-name svg {
      display: block;
      width: 122px;
      height: 40px;
    }

    .footer-bio {
      margin: 0;
      max-width: 44ch;
      color: var(--footer-muted);
      font-size: 13px;
      line-height: 1.65;
    }

    .footer-bio-continued {
      white-space: nowrap;
    }

    .footer-aside {
      display: flex;
      flex: 0 0 auto;
      flex-direction: column;
      align-items: flex-end;
      gap: 16px;
      padding-top: 0;
      padding-right: 8px;
    }

    .footer-connect,
    .footer-tools {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 8px;
    }

    .footer-title {
      margin: 0;
      color: var(--footer-text);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .footer-social {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .social-icon {
      width: 36px;
      height: 36px;
      display: inline-grid;
      place-items: center;
      border: 1px solid var(--footer-line);
      border-radius: 999px;
      background: var(--footer-chip);
      color: var(--footer-text);
      text-decoration: none;
      box-shadow: 0 0 0 rgba(22, 116, 107, 0);
      transition: transform 180ms ease, border 180ms ease, background 180ms ease, box-shadow 180ms ease;
    }

    .social-icon svg {
      width: 17px;
      height: 17px;
    }

    .social-icon:hover {
      transform: translateY(-2px) scale(1.04);
      border-color: var(--line-strong);
      background: color-mix(in srgb, var(--accent-soft) 50%, var(--panel-soft));
      box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
    }

    .writtenx-link {
      display: inline-flex;
      align-items: center;
      min-height: auto;
      border: 0;
      border-radius: 0;
      padding: 0;
      background: transparent;
      color: #7a3b16;
      text-decoration: none;
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0.01em;
      position: relative;
      transition: transform 180ms ease, text-shadow 180ms ease;
    }

    .writtenx-link::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: -3px;
      width: 100%;
      height: 2px;
      background: linear-gradient(90deg, rgba(122, 59, 22, 0.8), rgba(241, 179, 43, 0.9));
      transform: scaleX(0.25);
      transform-origin: left;
      opacity: 0.35;
      transition: transform 180ms ease, opacity 180ms ease;
    }

    .writtenx-mark {
      margin: 0 1px;
      color: #f1b32b;
      font-family: "Brush Script MT", "Lucida Handwriting", cursive;
      font-size: 1.65em;
      font-weight: 400;
      line-height: 0.8;
      font-style: italic;
      display: inline-block;
      transition: transform 220ms ease, filter 220ms ease;
    }

    .writtenx-link:hover {
      transform: translateY(-1px);
      text-shadow: 0 3px 10px rgba(122, 59, 22, 0.15);
    }

    .writtenx-link:hover::after {
      transform: scaleX(1);
      opacity: 0.9;
    }

    .writtenx-link:hover .writtenx-mark {
      transform: rotate(-10deg) scale(1.08);
      filter: drop-shadow(0 2px 4px rgba(241, 179, 43, 0.4));
    }

    .footer-copyright {
      border-top: 1px solid var(--footer-line);
      padding: 14px 24px 16px;
      text-align: center;
      color: var(--footer-subtext);
      font-size: 12px;
      line-height: 1.5;
    }

    .footer-copyright p {
      margin: 0;
    }

    .footer-copyright p + p {
      margin-top: 8px;
    }

    .ad-placement {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 6px 10px;
    }

    .footer-note-label,
    .footer-note-muted {
      color: var(--footer-subtext);
    }

    .footer-contact-link {
      color: var(--accent);
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .footer-contact-link:hover,
    .footer-contact-link:focus-visible {
      color: color-mix(in srgb, var(--accent) 82%, var(--ink));
    }

    .footer-license-link {
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      line-height: inherit;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
      padding: 0;
    }

    .footer-license-link:hover,
    .footer-license-link:focus-visible {
      color: var(--footer-text);
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 13px;
    }

    .field {
      display: grid;
      gap: 6px;
    }

    .field.full {
      grid-column: 1 / -1;
    }

    .field label {
      color: var(--muted);
      font-size: 12px;
      font-weight: 760;
    }

    .field input,
    .field select,
    .field textarea {
      width: 100%;
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      color: var(--ink);
      outline: none;
      padding: 8px 10px;
      transition: border 150ms ease, box-shadow 150ms ease, background 150ms ease;
    }

    .field textarea {
      min-height: 80px;
      resize: vertical;
    }

    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      border-color: var(--accent);
      background: var(--panel);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
    }

    .check-row {
      display: flex;
      align-items: center;
      gap: 9px;
      min-height: 40px;
      color: var(--ink);
    }

    .check-row input {
      width: 17px;
      height: 17px;
      accent-color: var(--accent);
    }

    .color-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .color-swatch {
      width: 32px;
      height: 32px;
      border: 2px solid transparent;
      border-radius: 999px;
      cursor: pointer;
    }

    .color-swatch.active {
      border-color: var(--ink);
      box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--line-strong);
    }

    .kbd {
      display: inline-flex;
      min-width: 22px;
      justify-content: center;
      border: 1px solid var(--line);
      border-radius: 5px;
      background: var(--panel-soft);
      padding: 1px 5px;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 11px;
    }

    .topbar-title {
      min-width: 0;
    }

    .mobile-menu-btn,
    .mobile-nav-backdrop {
      display: none;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    @media (max-width: 1100px) {
      .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .topbar {
        grid-template-columns: 1fr;
      }

      .top-actions {
        justify-content: flex-start;
      }
    }

    @media (max-width: 820px) {
      body {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
      }

      .app {
        grid-template-columns: 1fr;
      }

      .mobile-menu-btn {
        display: inline-grid;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
      }

      .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        border: 0;
        margin: 0;
        padding: 0;
        background: rgba(10, 14, 12, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
      }

      body.mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
      }

      .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        width: min(88vw, 320px);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 220ms ease;
        box-shadow: var(--shadow);
      }

      body.mobile-nav-open .sidebar {
        transform: translateX(0);
      }

      .sidebar-scroll {
        display: flex;
        flex-direction: column;
        max-height: none;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
      }

      .side-footer {
        display: block;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
      }

      .main {
        height: 100dvh;
      }

      .topbar {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 10px;
        min-height: auto;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: 10px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
      }

      .mobile-menu-btn {
        grid-row: 1;
        grid-column: 1;
      }

      .topbar-title {
        grid-row: 1;
        grid-column: 2;
        min-width: 0;
      }

      .top-actions {
        grid-row: 1;
        grid-column: 3;
        justify-content: flex-end;
      }

      .search {
        grid-row: 2;
        grid-column: 1 / -1;
      }

      .search input {
        height: 44px;
        font-size: 16px;
      }

      .top-actions .icon-btn,
      .top-help-btn {
        width: 44px;
        height: 44px;
      }

      .content,
      .bookmark-bar {
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
      }

      .content {
        padding-top: 16px;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
      }

      .site-footer {
        margin-top: 16px;
        width: 100%;
        border-radius: 12px;
      }

      .footer-about {
        max-width: none;
        width: 100%;
      }

      .footer-bio {
        max-width: none;
        font-size: 14px;
        line-height: 1.65;
      }

      .footer-bio-continued {
        white-space: normal;
        display: block;
        margin-top: 4px;
      }

      .footer-aside {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 10px;
        padding-right: 0;
      }

      .footer-connect,
      .footer-tools {
        align-items: flex-start;
        text-align: left;
        padding: 14px 12px;
        min-height: 104px;
        border: 1px solid var(--footer-line);
        border-radius: var(--radius);
        background: var(--footer-chip);
      }

      .footer-title {
        font-size: 12px;
      }

      .footer-social {
        justify-content: flex-start;
        gap: 10px;
      }

      .social-icon {
        width: 44px;
        height: 44px;
      }

      .social-icon svg {
        width: 20px;
        height: 20px;
      }

      .writtenx-link {
        min-height: 44px;
        align-items: center;
        padding: 4px 0;
        font-size: 15px;
      }

      .footer-copyright {
        padding: 16px max(14px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
        text-align: left;
        font-size: 13px;
        line-height: 1.6;
      }

      .ad-placement {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }

      .footer-contact-link,
      .footer-license-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 6px 2px;
      }

      .footer-license-link {
        text-align: left;
      }

      .bookmark-bar {
        gap: 10px;
        min-height: 54px;
        padding-top: 10px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
      }

      .bookmark-pill {
        min-height: 40px;
        scroll-snap-align: start;
        flex: 0 0 auto;
      }

      .nav-item,
      .workspace-row {
        min-height: 44px;
      }

      .btn {
        min-height: 44px;
      }

      .btn.slim {
        min-height: 40px;
      }

      .icon-btn {
        width: 40px;
        height: 40px;
      }

      .link-actions {
        opacity: 1;
        pointer-events: auto;
        grid-template-columns: repeat(2, 40px);
        gap: 4px;
      }

      .link-card .icon-btn {
        width: 40px;
        height: 40px;
      }

      .view-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      .view-head .setting-actions,
      .view-head .btn {
        width: 100%;
      }

      .setting-actions .btn {
        flex: 1 1 auto;
      }

      .category-grid,
      .stats,
      .settings-grid,
      .settings-columns,
      .form-grid {
        grid-template-columns: 1fr;
      }

      .manual-guide {
        grid-template-columns: 1fr;
      }

      .palette-grid {
        grid-template-columns: 1fr;
      }

      .background-upload {
        flex-wrap: wrap;
      }

      .modal {
        width: min(100vw, 100%);
        max-height: 92dvh;
        margin: auto max(0px, env(safe-area-inset-right)) auto max(0px, env(safe-area-inset-left));
      }

      .toast {
        bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
        max-width: min(94vw, 520px);
      }

      .footer-main {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 16px;
        padding: 20px max(14px, env(safe-area-inset-left)) 16px max(14px, env(safe-area-inset-right));
      }
    }

    @media (max-width: 520px) {
      .brand {
        padding: 14px;
      }

      .page-title {
        font-size: 18px;
      }

      .crumb {
        font-size: 11px;
      }

      .top-actions .btn span.optional {
        display: none;
      }

      .stats {
        grid-template-columns: 1fr;
      }

      .link-grid,
      .results-grid {
        grid-template-columns: 1fr;
      }

      .modal,
      .modal.manual {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        margin: 0;
      }

      .modal-head,
      .modal-body,
      .modal-foot {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
      }

      .modal-foot {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
      }

      .footer-main {
        padding: 18px max(12px, env(safe-area-inset-left)) 14px max(12px, env(safe-area-inset-right));
        gap: 14px;
      }

      .footer-aside {
        grid-template-columns: 1fr;
      }

      .footer-connect,
      .footer-tools {
        min-height: auto;
        padding: 14px;
      }

      .footer-name svg {
        width: 108px;
        height: 36px;
      }

      .writtenx-link {
        font-size: 15px;
      }

      .footer-copyright {
        padding: 14px max(12px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
        font-size: 13px;
      }

      .field input,
      .field select,
      .field textarea {
        font-size: 16px;
      }
    }
