    :root {
      --ink: #20343a;
      --muted: #66716e;
      --bg: #edf2ee;
      --paper: #fffdf8;
      --line: rgba(52,84,86,.16);
      --line-dark: rgba(52,84,86,.38);
      --lacquer: #4e8588;
      --lacquer-dark: #315a60;
      --cinnabar: #6ea7a0;
      --cinnabar-dark: #39676c;
      --cinnabar-light: #a8cfc3;
      --clay: #d5977f;
      --clay-dark: #9c6256;
      --clay-soft: #edf5ef;
      --moss: #6f8f80;
      --moss-dark: #436b62;
      --sea: #5f9694;
      --sea-dark: #315a60;
      --jade: #6ea7a0;
      --sand: #d4b178;
      --bg2: rgba(255,255,255,.52);
      --border: var(--line);
      --fg: var(--ink);
      --shadow: 0 18px 46px rgba(42, 55, 58, .12);
    }

    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      color: var(--ink);
      font-family: "Iowan Old Style", "Palatino Linotype", "Noto Serif CJK SC", "Source Han Serif SC", serif;
      background:
        linear-gradient(90deg, rgba(30,48,54,.026) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,255,255,.08)),
        linear-gradient(135deg, #f5f1e8 0%, #edf2ee 46%, #e7ecef 100%);
      min-height: 100vh;
    }

    button, input, select, textarea { font: inherit; }
    button, .button-link {
      border: 0;
      border-radius: 12px;
      background: linear-gradient(135deg, #39676c, #6ea7a0);
      color: #fffdf8;
      cursor: pointer;
      padding: 10px 14px;
      font-weight: 800;
      text-decoration: none;
      box-shadow: 0 10px 22px rgba(49,90,96,.18);
    }
    button:hover, .button-link:hover { filter: brightness(1.05); }
    button:focus-visible, .button-link:focus-visible {
      outline: 3px solid rgba(95,150,148,.26);
      outline-offset: 3px;
    }
    button.secondary {
      background: linear-gradient(135deg, #eef6f2, #dfeae7);
      color: #315a60;
      border: 1px solid rgba(52,84,86,.18);
      box-shadow: 0 10px 22px rgba(49,90,96,.1);
    }
    #importSubmitBtn {
      background: linear-gradient(135deg, #39676c, #6ea7a0);
      color: #fffdf8;
    }
    button.ghost, .button-link.ghost {
      background: rgba(255,255,255,.68);
      color: #315a60;
      border: 1px solid var(--line);
      box-shadow: none;
    }
    button:disabled { opacity: .48; cursor: not-allowed; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255,255,255,.86);
      color: var(--ink);
      padding: 10px 11px;
      outline-color: rgba(95,150,148,.38);
    }
    select {
      appearance: none;
      -webkit-appearance: none;
      overflow: hidden;
      padding-right: 38px;
      text-overflow: ellipsis;
      white-space: nowrap;
      background:
        linear-gradient(45deg, transparent 50%, #315a60 50%) calc(100% - 18px) calc(50% - 3px) / 6px 6px no-repeat,
        linear-gradient(135deg, #315a60 50%, transparent 50%) calc(100% - 13px) calc(50% - 3px) / 6px 6px no-repeat,
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,252,249,.88));
      border-color: rgba(52,84,86,.24);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 18px rgba(42,55,58,.04);
      cursor: pointer;
    }
    select:hover {
      border-color: rgba(95,150,148,.48);
      background:
        linear-gradient(45deg, transparent 50%, #20343a 50%) calc(100% - 18px) calc(50% - 3px) / 6px 6px no-repeat,
        linear-gradient(135deg, #20343a 50%, transparent 50%) calc(100% - 13px) calc(50% - 3px) / 6px 6px no-repeat,
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,252,249,.94));
    }
    select:focus {
      border-color: rgba(95,150,148,.72);
      box-shadow: 0 0 0 3px rgba(95,150,148,.14), inset 0 1px 0 rgba(255,255,255,.78);
    }
    select:disabled {
      color: rgba(107,113,108,.72);
      cursor: not-allowed;
      background:
        linear-gradient(45deg, transparent 50%, rgba(49,90,96,.42) 50%) calc(100% - 18px) calc(50% - 3px) / 6px 6px no-repeat,
        linear-gradient(135deg, rgba(49,90,96,.42) 50%, transparent 50%) calc(100% - 13px) calc(50% - 3px) / 6px 6px no-repeat,
        rgba(255,255,255,.56);
      box-shadow: none;
    }
    select::-ms-expand { display: none; }
    textarea { min-height: 88px; line-height: 1.65; resize: vertical; }
    label { display: block; margin: 8px 0 5px; color: var(--muted); font-size: 13px; }
    audio { width: 100%; }

    body.auth-locked {
      overflow-x: hidden;
      overflow-y: auto;
    }
    body.auth-locked .topnav,
    body.auth-locked main,
    body.auth-locked .task-drawer,
    body.auth-locked .task-drawer-backdrop,
    body.auth-locked .segment-nav,
    body.auth-locked .back-to-top {
      display: none !important;
    }
    .auth-shell {
      min-height: 100dvh;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
      gap: clamp(22px, 3.2vw, 46px);
      align-items: center;
      justify-content: center;
      padding: clamp(22px, 4vw, 54px) clamp(28px, 6vw, 92px);
      background:
        repeating-linear-gradient(118deg, transparent 0 42px, rgba(58,96,98,.04) 42px 43px, transparent 43px 86px),
        linear-gradient(90deg, rgba(30,48,54,.045) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(180deg, rgba(255,255,255,.48), rgba(255,255,255,.08)),
        linear-gradient(135deg, #f5f1e8 0%, #edf2ee 46%, #e7ecef 100%);
      position: relative;
      overflow: visible;
    }
    .auth-shell::before {
      content: "";
      position: absolute;
      inset: 28px auto 28px 28px;
      width: min(46vw, 640px);
      border-radius: 28px;
      background:
        linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0)),
        repeating-linear-gradient(90deg, rgba(30,48,54,.045) 0 1px, transparent 1px 28px);
      border: 1px solid rgba(47,78,82,.08);
      pointer-events: none;
    }
    .auth-visual {
      position: relative;
      z-index: 1;
      max-width: 760px;
      justify-self: end;
      padding: clamp(12px, 3vw, 34px);
    }
    .auth-brandline {
      display: grid;
      gap: 8px;
      margin-bottom: 22px;
    }
    .auth-kicker {
      color: #55716f;
      font: 800 12px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .auth-brandline strong {
      color: #20343a;
      font-size: 22px;
      letter-spacing: 0;
    }
    .auth-preview {
      width: min(100%, 620px);
      padding: 18px;
      border-radius: 18px;
      border: 1px solid rgba(52,84,86,.14);
      background: rgba(255,255,255,.54);
      box-shadow: 0 30px 90px rgba(38,54,58,.14);
      -webkit-backdrop-filter: blur(16px);
      backdrop-filter: blur(16px);
    }
    .auth-preview-head,
    .auth-preview-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .auth-preview-head {
      margin-bottom: 14px;
      color: #31464b;
      font-weight: 900;
    }
    .auth-preview-head b {
      color: #6b7471;
      font-size: 12px;
      font-weight: 800;
    }
    .auth-preview-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 156px;
      gap: 12px;
    }
    .auth-preview-card {
      min-height: 126px;
      padding: 16px;
      border-radius: 14px;
      border: 1px solid rgba(64,94,96,.12);
      background: rgba(250,252,250,.76);
      box-shadow: 0 16px 36px rgba(43,59,64,.08);
    }
    .auth-preview-card-main {
      grid-row: span 2;
      min-height: 324px;
      overflow: hidden;
      position: relative;
      background:
        linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.18)),
        repeating-linear-gradient(90deg, rgba(100,84,55,.055) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(49,90,96,.035) 0 1px, transparent 1px 30px),
        linear-gradient(180deg, rgba(255,255,255,.88), rgba(239,246,243,.8)),
        linear-gradient(135deg, rgba(76,124,126,.12), transparent);
    }
    .auth-preview-card-main::after {
      content: "";
      position: absolute;
      inset: auto 14px 92px 14px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(57,103,108,.24), transparent);
      pointer-events: none;
    }
    .auth-preview-label {
      display: inline-flex;
      color: #6f7673;
      font-size: 12px;
      font-weight: 800;
      margin-bottom: 12px;
    }
    .auth-preview-card strong {
      display: block;
      color: #20343a;
      font-size: 24px;
      letter-spacing: 0;
      line-height: 1.25;
    }
    .auth-preview-card-main strong {
      font-size: 28px;
    }
    .auth-preview-card p {
      margin: 8px 0 0;
      color: #66716e;
      line-height: 1.55;
      font-size: 13px;
    }
    .auth-wave {
      height: 76px;
      display: flex;
      align-items: center;
      gap: 5px;
      margin-top: 18px;
      padding: 0 4px;
    }
    .auth-wave i {
      display: block;
      flex: 0 0 9px;
      width: 9px;
      border-radius: 999px;
      background: linear-gradient(180deg, #39676c, #6ea7a0);
      opacity: .86;
      transform-origin: 50% 50%;
      animation: authWaveDrift 2.8s ease-in-out infinite;
    }
    .auth-wave i:nth-child(1) { height: 22px; animation-delay: -1.1s; opacity: .62; }
    .auth-wave i:nth-child(2) { height: 42px; animation-delay: -.7s; opacity: .74; }
    .auth-wave i:nth-child(3) { height: 30px; animation-delay: -1.9s; opacity: .7; }
    .auth-wave i:nth-child(4) { height: 58px; animation-delay: -.35s; }
    .auth-wave i:nth-child(5) { height: 46px; animation-delay: -1.45s; }
    .auth-wave i:nth-child(6) { height: 70px; animation-delay: -.95s; }
    .auth-wave i:nth-child(7) { height: 54px; animation-delay: -2.15s; }
    .auth-wave i:nth-child(8) { height: 66px; animation-delay: -.2s; }
    .auth-wave i:nth-child(9) { height: 40px; animation-delay: -1.7s; }
    .auth-wave i:nth-child(10) { height: 60px; animation-delay: -.55s; }
    .auth-wave i:nth-child(11) { height: 34px; animation-delay: -2.35s; opacity: .76; }
    .auth-wave i:nth-child(12) { height: 52px; animation-delay: -.85s; }
    .auth-wave i:nth-child(13) { height: 28px; animation-delay: -1.3s; opacity: .7; }
    .auth-wave i:nth-child(14) { height: 44px; animation-delay: -2s; opacity: .74; }
    @keyframes authWaveDrift {
      0%, 100% { transform: translateY(5px) scaleY(.9); }
      45% { transform: translateY(-6px) scaleY(1.08); }
      70% { transform: translateY(2px) scaleY(.98); }
    }
    .auth-field-stack {
      display: grid;
      gap: 8px;
      margin-top: 8px;
      max-width: 390px;
    }
    .auth-field-stack span {
      display: grid;
      grid-template-columns: 86px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 32px;
      padding: 7px 9px;
      border-radius: 10px;
      border: 1px solid rgba(56,91,93,.12);
      background: rgba(255,255,255,.58);
    }
    .auth-field-stack b {
      color: #3f5f62;
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }
    .auth-field-stack em {
      height: 8px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(57,103,108,.28), rgba(110,167,160,.08));
    }
    .auth-field-stack span:nth-child(2) em { width: 54%; }
    .auth-field-stack span:nth-child(3) em { width: 78%; }
    .auth-flow {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
      margin-top: 18px;
      padding-top: 4px;
    }
    .auth-flow span {
      position: relative;
      min-height: 38px;
      display: grid;
      place-items: center;
      padding: 0 6px;
      border-radius: 999px;
      border: 1px solid rgba(57,103,108,.14);
      background: rgba(241,247,244,.72);
      color: #35575b;
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }
    .auth-flow span:not(:last-child)::after {
      content: "";
      position: absolute;
      right: -8px;
      top: 50%;
      width: 8px;
      height: 1px;
      background: rgba(57,103,108,.28);
    }
    .auth-preview-footer {
      gap: 10px;
      margin-top: 14px;
    }
    .auth-preview-footer span {
      height: 8px;
      flex: 1;
      border-radius: 999px;
      background: rgba(76,103,103,.14);
    }
    .auth-card {
      position: relative;
      z-index: 1;
      width: min(100%, 440px);
      justify-self: start;
      padding: 30px;
      border-radius: 20px;
      border: 1px solid rgba(52,84,86,.16);
      background: rgba(255, 253, 248, .84);
      backdrop-filter: blur(18px);
      box-shadow: 0 30px 80px rgba(42,55,58,.16);
    }
    .auth-card-head h2 {
      margin: 0 0 8px;
      font-size: 26px;
      letter-spacing: 0;
      color: #20343a;
    }
    .auth-card-head p {
      margin: 0 0 22px;
      color: var(--muted);
      line-height: 1.6;
    }
    .auth-card label {
      color: #435d5f;
      font-weight: 800;
      margin-top: 14px;
    }
    .auth-card input {
      height: 46px;
      border-radius: 12px;
      background: rgba(255,255,255,.88);
    }
    .auth-password-field {
      position: relative;
      display: block;
    }
    .auth-password-field input {
      padding-right: 50px;
    }
    .auth-password-toggle {
      position: absolute;
      right: 6px;
      top: 50%;
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
      transform: translateY(-50%);
      padding: 0;
      border-radius: 10px;
      border: 1px solid transparent;
      background: transparent;
      color: #315a60;
      box-shadow: none;
    }
    .auth-password-toggle:hover {
      background: rgba(95,150,148,.1);
      filter: none;
    }
    .auth-password-toggle:focus-visible {
      outline: 2px solid rgba(95,150,148,.32);
      outline-offset: 1px;
      border-color: rgba(95,150,148,.32);
    }
    .auth-eye {
      position: relative;
      width: 19px;
      height: 12px;
      border: 2px solid currentColor;
      border-radius: 999px / 720px;
      opacity: .78;
    }
    .auth-eye::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 5px;
      height: 5px;
      border-radius: 999px;
      background: currentColor;
      transform: translate(-50%, -50%);
    }
    .auth-password-toggle[aria-pressed="true"] .auth-eye {
      opacity: 1;
    }
    .auth-password-toggle[aria-pressed="true"] .auth-eye::after {
      content: "";
      position: absolute;
      left: -3px;
      top: 5px;
      width: 25px;
      height: 2px;
      border-radius: 999px;
      background: currentColor;
      transform: rotate(-35deg);
      transform-origin: center;
    }
    .auth-card button[type="submit"] {
      width: 100%;
      margin-top: 20px;
      height: 48px;
      border-radius: 12px;
      font-size: 16px;
    }
    .auth-switch {
      width: 100%;
      margin-top: 12px;
      background: rgba(255,255,255,.66);
      color: #425f62;
      border: 1px solid rgba(66,95,98,.18);
      box-shadow: none;
    }
    .auth-switch:focus-visible {
      border-color: rgba(95,150,148,.58);
      outline-color: rgba(95,150,148,.26);
      box-shadow: 0 0 0 4px rgba(95,150,148,.1);
    }
    .auth-status {
      min-height: 22px;
      margin-top: 12px;
      color: #9f4b55;
      font-weight: 800;
      line-height: 1.45;
    }
    .auth-status.ok {
      color: #54744d;
    }
    .auth-note {
      margin: 14px 0 0;
      color: #7b7469;
      font-size: 13px;
      line-height: 1.55;
    }
    .nav-tools {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .nav-user {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px 6px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,.58);
      border: 1px solid rgba(216,204,186,.88);
      color: #5f5046;
      font-weight: 800;
      white-space: nowrap;
    }
    button.small {
      padding: 7px 10px;
      border-radius: 10px;
      font-size: 13px;
    }
    @media (max-width: 900px) {
      .auth-shell {
        grid-template-columns: 1fr;
        align-items: start;
        overflow: visible;
      }
      .auth-shell::before {
        inset: 18px;
        width: auto;
      }
      .auth-visual {
        justify-self: center;
        padding: 8px 4px 0;
      }
      .auth-preview {
        margin: 0 auto;
      }
      .auth-card {
        width: min(100%, 440px);
        justify-self: center;
      }
    }
    @media (max-width: 860px) {
      .auth-preview-grid {
        grid-template-columns: 1fr;
      }
      .auth-preview-card-main {
        min-height: 220px;
      }
      .auth-wave i {
        flex-basis: 7px;
        width: 7px;
      }
      .auth-card {
        width: 100%;
      }
    }
    @media (prefers-reduced-motion: reduce) {
      .auth-wave i {
        animation: none;
        transform: none;
      }
    }

    .topnav {
      position: sticky;
      top: 0;
      z-index: 20;
      display: grid;
      grid-template-columns: minmax(280px, 1fr) auto auto;
      gap: 14px;
      align-items: center;
      padding: 14px 28px;
      border-bottom: 1px solid rgba(52,84,86,.14);
      background: rgba(248,251,248,.86);
      -webkit-backdrop-filter: blur(16px);
      backdrop-filter: blur(16px);
    }
    .brand { display: flex; align-items: baseline; gap: 12px; }
    .brand strong { font-size: 22px; letter-spacing: -.04em; }
    .brand span { color: var(--muted); font-size: 13px; }
    .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
    .nav-tools { display: flex; align-items: center; justify-content: flex-end; }
    .tab {
      color: var(--ink);
      text-decoration: none;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 8px 14px;
      background: rgba(255,255,255,.62);
      font-weight: 800;
      font-size: 14px;
    }
    .tab.active {
      background: linear-gradient(135deg, #39676c, #6ea7a0);
      color: #fffdf8;
      border-color: rgba(49,90,96,.18);
      box-shadow: 0 8px 22px rgba(49,90,96,.18);
    }
    .task-drawer-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 38px;
      white-space: nowrap;
    }
    .task-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 22px;
      height: 22px;
      padding: 0 6px;
      border-radius: 999px;
      background: var(--lacquer);
      color: #fff;
      font-size: 12px;
      font-weight: 900;
    }
    .task-drawer-backdrop {
      position: fixed;
      inset: 0;
      z-index: 48;
      background: rgba(29,45,48,.24);
    }
    .task-drawer {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      z-index: 49;
      width: min(460px, calc(100vw - 24px));
      padding: 18px;
      border-left: 1px solid rgba(52,84,86,.16);
      background: rgba(255,253,248,.98);
      box-shadow: -18px 0 42px rgba(20,43,46,.18);
      overflow-y: auto;
    }
    .task-drawer-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }
    .task-drawer-head h2 { font-size: 24px; }
    .task-drawer-actions { display: inline-flex; align-items: center; gap: 8px; }
    .task-drawer-actions .icon-button {
      width: 34px;
      height: 34px;
      padding: 0;
      font-size: 20px;
    }
    .task-drawer-list {
      display: grid;
      gap: 8px;
    }

    main { max-width: 1480px; margin: 0 auto; padding: 24px 24px 70px; }
    .page { display: none; position: relative; }
    .page.active { display: block; animation: enter .18s ease-out; }
    @keyframes enter { from { opacity: .25; transform: translateY(8px); } to { opacity: 1; transform: none; } }

    .panel, .card, .record-row, .segment-row, .result-row {
      border: 1px solid var(--line);
      background: rgba(255,253,248,.86);
      box-shadow: var(--shadow);
      border-radius: 22px;
    }
    .panel { padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
    .panel::before {
      content: "";
      position: absolute;
      top: 0;
      right: 18px;
      bottom: 0;
      width: 92px;
      background:
        repeating-linear-gradient(90deg, rgba(49,90,96,.055) 0 1px, transparent 1px 18px),
        linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0));
      opacity: .75;
      pointer-events: none;
    }
    .panel > * { position: relative; z-index: 1; }
    .panel-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 12px;
    }
    h1, h2, h3 { margin: 0; letter-spacing: -.04em; }
    h1 { font-size: clamp(26px, 3vw, 38px); }
    h2 { font-size: clamp(20px, 2vw, 28px); }
    h3 { font-size: 19px; }
    .muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
    .small { font-size: 12px; }
    .status { min-height: 23px; margin-top: 9px; color: var(--sea-dark); font-size: 13px; line-height: 1.6; }
    .warn { color: var(--lacquer-dark); }
    input.field-invalid, select.field-invalid, textarea.field-invalid {
      border-color: rgba(159,75,85,.86);
      background: rgba(255, 242, 236, .95);
      box-shadow: 0 0 0 3px rgba(217,107,115,.13);
    }

    .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 12px; }

    .dropzone {
      display: grid;
      place-items: center;
      min-height: 180px;
      border: 1.5px dashed var(--line-dark);
      border-radius: 20px;
      background:
        linear-gradient(135deg, rgba(49,90,96,.08), rgba(110,167,160,.06)),
        rgba(255,255,255,.52);
      cursor: pointer;
      text-align: center;
      padding: 20px;
    }
    .dropzone.dragover { border-color: var(--lacquer); background: rgba(255,255,255,.8); }
    .dropzone.field-invalid {
      border-color: rgba(159,75,85,.86);
      background:
        linear-gradient(135deg, rgba(95,150,148,.12), rgba(110,167,160,.11)),
        rgba(255,255,255,.7);
      box-shadow: inset 0 0 0 1px rgba(95,150,148,.18);
    }
    .drop-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
    .file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }
    .local-path-import {
      margin: 12px 0 16px;
      padding: 12px 14px;
      border: 1px solid rgba(176, 141, 103, .35);
      border-radius: 16px;
      background: rgba(255, 250, 240, .58);
    }
    .local-path-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      margin: 6px 0;
    }
    .pill, .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      font-weight: 800;
      background: rgba(33,78,84,.1);
      color: var(--sea-dark);
      margin: 2px 4px 2px 0;
    }
    .badge.red { background: rgba(169,61,45,.11); color: var(--lacquer-dark); }
    .badge.gold { background: rgba(95,150,148,.16); color: #315a60; }
    .badge.green { background: rgba(39,139,87,.12); color: #1a6b3f; }

    .api-panel { display: none; border-left: 4px solid var(--sea); padding-left: 12px; margin-top: 8px; }
    .api-panel.active { display: block; }
    .taxonomy-panel {
      margin: 12px 0 6px;
      padding: 12px;
      border: 1px solid rgba(52,84,86,.18);
      border-radius: 16px;
      background: rgba(255,255,255,.48);
      display: grid;
      gap: 10px;
    }
    .taxonomy-row {
      display: grid;
      grid-template-columns: 52px 1fr;
      gap: 10px;
      align-items: start;
    }
    .taxonomy-row strong {
      padding-top: 4px;
      color: var(--cinnabar-dark);
      font-size: 13px;
    }
    .taxonomy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .taxonomy-chip {
      padding: 5px 9px;
      border-radius: 999px;
      background: rgba(95,150,148,.12);
      color: var(--sea-dark);
      border: 1px solid rgba(139,124,102,.25);
      box-shadow: none;
      font-size: 12px;
    }
    .taxonomy-chip:hover { background: rgba(95,150,148,.2); }

    .audio-stage {
      display: block;
    }
    .timeline {
      position: relative;
      min-height: 106px;
      margin-top: 10px;
      padding: 16px 18px;
      border: 1px dashed var(--line-dark);
      border-radius: 20px;
      background:
        repeating-linear-gradient(90deg, rgba(33,78,84,.09) 0 1px, transparent 1px 68px),
        linear-gradient(90deg, rgba(49,90,96,.08), rgba(110,167,160,.12));
      overflow: visible;
    }
    .timeline audio {
      display: none;
    }
    .timeline-transport {
      display: grid;
      grid-template-columns: auto auto minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
    }
    .timeline-track {
      position: relative;
      height: 76px;
      width: 100%;
      min-width: 0;
      cursor: crosshair;
    }
    .timeline-viewport {
      position: relative;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: thin;
      scrollbar-color: rgba(33,78,84,.42) transparent;
      cursor: grab;
      touch-action: pan-y;
    }
    .timeline-viewport.is-panning { cursor: grabbing; }
    .timeline-viewport::-webkit-scrollbar { height: 7px; }
    .timeline-viewport::-webkit-scrollbar-thumb { background: rgba(33,78,84,.42); border-radius: 999px; }
    .timeline-rail {
      position: absolute;
      left: 0;
      right: 0;
      top: 27px;
      height: 14px;
      border-radius: 999px;
      background:
        linear-gradient(180deg, rgba(255,253,248,.78), rgba(255,253,248,.28)),
        linear-gradient(90deg, rgba(49,90,96,.32), rgba(110,167,160,.4), rgba(42,73,78,.28));
      border: 1px solid rgba(49,90,96,.34);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.8),
        0 0 0 3px rgba(95,150,148,.08);
      overflow: hidden;
    }
    .timeline-progress {
      height: 100%;
      width: 0%;
      background:
        linear-gradient(90deg, var(--lacquer-dark), var(--lacquer) 45%, var(--sand));
      box-shadow: 0 0 18px rgba(169,61,45,.42);
      opacity: .96;
    }
    .timeline-clock {
      min-width: 88px;
      color: var(--sea-dark);
      font-size: 14px;
      font-weight: 800;
      white-space: nowrap;
    }
    .timeline.tool-delete { border-color: var(--lacquer); }
    .timeline.tool-move { border-color: var(--sand-dark); box-shadow: 0 0 0 3px rgba(190,151,91,.16); }
    .timeline.tool-split { border-color: var(--sea); box-shadow: 0 0 0 3px rgba(33,78,84,.1); }
    .timeline-hover {
      position: fixed;
      top: 0;
      z-index: 1000;
      transform: translateX(-50%);
      display: none;
      padding: 3px 7px;
      border-radius: 999px;
      background: var(--sea-dark);
      color: #fff;
      font-size: 11px;
      font-weight: 900;
      pointer-events: none;
      white-space: nowrap;
    }
    .tick {
      position: absolute;
      top: 10px;
      width: 18px;
      height: 64px;
      transform: translateX(-50%);
      border: 0;
      background: transparent;
      padding: 0;
      color: var(--lacquer-dark);
      cursor: pointer;
      touch-action: none;
    }
    .timeline.tool-move .tick { cursor: ew-resize; }
    .timeline.dragging .tick { pointer-events: none; }
    .tick::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 20px;
      left: 50%;
      border-left: 2px dotted var(--lacquer);
    }
    .tick-number {
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 999px;
      min-width: 20px;
      text-align: center;
      padding: 1px 5px;
      font-size: 10px;
      color: var(--lacquer-dark);
      font-weight: 900;
    }
    .tick-time {
      position: absolute;
      top: 64px;
      left: 50%;
      transform: translateX(-50%);
      display: none;
      white-space: nowrap;
      padding: 2px 6px;
      border-radius: 999px;
      background: rgba(255,250,240,.96);
      border: 1px solid var(--line);
      font-size: 11px;
      color: var(--sea-dark);
      z-index: 2;
    }
    .tick:hover, .tick:focus-visible, .tick:active {
      transform: translateX(-50%);
      filter: none;
      box-shadow: none;
      background: transparent;
    }
    .tick.collapsed { width: 10px; }
    .tick.collapsed::before { border-left-style: solid; border-left-width: 1px; opacity: .5; }
    .tick.collapsed .tick-number { font-size: 8px; min-width: 14px; padding: 0 2px; }
    .tick.collapsed .tick-time { display: none; }
    .tick.dot-only .tick-number { visibility: hidden; }
    .tick.dot-only:hover .tick-number, .tick.dot-only:focus-visible .tick-number { visibility: visible; }
    .tick.dot-only::before { border-left-width: 1px; opacity: .6; }

    .timeline-zoom {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      font-size: 12px;
      color: var(--muted);
    }
    .timeline-zoom input[type=range] { width: 130px; accent-color: var(--sea); }
    .timeline-zoom button { min-width: unset; padding: 4px 8px; font-size: 11px; }
    .timeline-pan-hint { margin-left: 4px; }
    .timeline-overview {
      position: relative;
      height: 30px;
      margin-top: 12px;
      border-radius: 7px;
      background: rgba(33,78,84,.1);
      touch-action: none;
      cursor: pointer;
    }
    .timeline-overview-marks { position: absolute; inset: 6px 0; overflow: hidden; border-radius: 7px; }
    .timeline-overview-marks i { position: absolute; height: 100%; border-left: 1px solid rgba(33,78,84,.35); }
    .timeline-overview-window {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      border: 2px solid var(--sea);
      border-radius: 7px;
      background: rgba(95,150,148,.16);
      cursor: grab;
      touch-action: none;
      box-sizing: border-box;
    }
    .timeline-overview-window:focus-visible { outline: 2px solid var(--lacquer); outline-offset: 3px; }
    .timeline-window-handle {
      position: absolute;
      top: -2px;
      bottom: -2px;
      width: 12px;
      min-width: 0;
      padding: 0;
      border: 0;
      border-radius: 5px;
      background: var(--sea);
      cursor: ew-resize;
      touch-action: none;
    }
    .timeline-window-handle::after { content: ""; position: absolute; inset: 8px 5px; border-left: 1px solid white; }
    .timeline-window-handle.start { left: -2px; }
    .timeline-window-handle.end { right: -2px; }
    .timeline-view-caption { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
    @media (max-width: 700px) {
      .timeline-pan-hint { display: none; }
      .timeline-zoom input[type=range] { width: 96px; }
      .timeline-zoom { flex-wrap: wrap; }
      .timeline-transport { grid-template-columns: auto 1fr auto; gap: 8px; }
      .timeline-clock { justify-self: center; }
      .timeline-viewport { grid-column: 1 / -1; grid-row: 2; }
    }

    .cutpoint-list {
      max-height: 120px;
      overflow-y: auto;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 3px;
      margin-top: 8px;
      font-size: 12px;
    }
    .cutpoint-list .cp-item {
      padding: 3px 7px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,.7);
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .cutpoint-list .cp-item:hover { background: rgba(95,150,148,.14); border-color: var(--sea); }
    .cutpoint-list .cp-item.active { border-color: var(--lacquer); background: rgba(169,61,45,.08); }

    .record-progress {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      font-size: 13px;
    }
    .record-progress .bar {
      flex: 1;
      height: 8px;
      border-radius: 4px;
      background: var(--line);
      overflow: hidden;
      display: flex;
    }
    .record-progress .bar .verified { background: var(--jade); }
    .record-progress .bar .corrected { background: var(--sea); }
    .record-progress .bar .draft { background: var(--line); }
    .record-quality-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: -2px 0 12px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255,255,255,.62);
      font-size: 13px;
    }
    .record-quality-summary strong { color: var(--ink); }
    .record-quality-summary .quality-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border: 1px solid rgba(105,76,55,.16);
      border-radius: 999px;
      padding: 4px 9px;
      background: rgba(255,255,255,.72);
      color: var(--muted);
    }
    .record-quality-summary .quality-chip.good { color: #1a6b3f; background: rgba(39,139,87,.1); }
    .record-quality-summary .quality-chip.warn { color: #7a5a39; background: rgba(213,151,127,.14); }
    .record-quality-summary .quality-chip.bad { color: var(--lacquer-dark); background: rgba(169,61,45,.09); }

    .segment-row.playing {
      border-color: var(--sea);
      box-shadow: 0 0 0 3px rgba(33,78,84,.12);
    }

    .timeline-tools {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: flex-end;
      margin-top: 0;
    }
    .timeline-tool.active { background: linear-gradient(135deg, var(--moss), var(--moss-dark)); color: #fff; }
    .icon-button {
      display: inline-grid;
      place-items: center;
      width: 42px;
      height: 42px;
      padding: 0;
    }
    .icon-button svg {
      width: 20px;
      height: 20px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.4;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .time-inputs {
      display: grid;
      grid-template-columns: 1fr auto 1fr auto 1.3fr;
      gap: 6px;
      align-items: center;
    }
    .time-inputs input { text-align: center; padding: 9px 6px; }
    .time-inputs span { color: var(--muted); font-weight: 900; }
    .manual-time-panel {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      margin: 10px 0 6px;
      padding: 10px 12px;
      border-top: 1px solid rgba(216,204,186,.72);
      color: var(--muted);
    }
    .manual-time-panel .time-inputs {
      width: min(360px, 100%);
      grid-template-columns: 54px auto 54px auto 78px;
    }
    .manual-time-panel .time-inputs input {
      padding: 7px 6px;
      background: rgba(255,255,255,.6);
    }

    .record-panel {
      display: none;
      margin-top: 12px;
      border-top: 1px solid var(--line);
      padding-top: 14px;
    }
    .record-panel.open { display: block; }
    .search-grid {
      display: grid;
      grid-template-columns: 1.2fr repeat(4, minmax(130px, .7fr)) auto;
      gap: 9px;
      align-items: end;
    }
    .record-list, .result-list {
      display: grid;
      gap: 9px;
      max-height: 560px;
      overflow: auto;
      padding-right: 3px;
    }
    .segment-list {
      display: grid;
      gap: 12px;
      padding-right: 0;
    }
    .record-row, .result-row {
      box-shadow: none;
      padding: 12px;
      cursor: pointer;
      background: rgba(255,255,255,.62);
    }
    .record-row.active { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(184,117,76,.14); }
    .workbench-stack { display: grid; gap: 16px; align-items: start; }
    #workbenchTools > summary { cursor: pointer; font-weight: 600; }
    #workbenchTools[open] > summary { margin-bottom: 12px; }
    .mobile-segment-play { display: none; }
    #workbenchStatus:empty { display: none; }
    #asrCompare { max-width: min(52rem, 92vw); max-height: 85vh; border: 1px solid #aaa; border-radius: 12px; }
    #asrCompare::backdrop { background: #18292790; }
    .asr-compare-text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .asr-compare-text pre { max-height: 45vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
    @media (max-width: 700px) {
      #page-workbench .workbench-stack > .panel:last-child { order: -1; }
      #page-workbench .mobile-segment-play { display: inline-flex; }
      #page-workbench > .panel, #page-workbench .workbench-stack > .panel { padding: 10px; }
      #page-workbench #activeTitle { font-size: 1.1rem; margin: 0; }
      #page-workbench #activeMeta, #page-workbench #bulkVerifyInfo { display: none; }
      #page-workbench .bulk-verify-row { flex-wrap: wrap; }
      #page-workbench .segment-head { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px; }
      #page-workbench .segment-head > span { grid-column: 1 / -1; }
      #page-workbench .mobile-segment-play, #page-workbench .bulk-verify-row button { width: auto; padding: 6px 10px; }
      #page-workbench .panel-title { margin-bottom: 6px; }
      #page-workbench .quality-issues, #page-workbench .quality-chip:last-child { overflow-wrap: anywhere; }
    }
    .total-text {
      min-height: 190px;
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,.58);
      line-height: 1.9;
      font-size: 16px;
    }
    .total-text span {
      cursor: pointer;
      border-bottom: 1px dotted rgba(33,78,84,.35);
      padding: 0 2px;
    }
    .total-text span:hover { background: rgba(95,150,148,.14); }
    .total-text-edit-dialog { width: min(620px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--paper); color: var(--ink); }
    .total-text-edit-dialog::backdrop { background: rgba(21,38,35,.42); }
    .segment-delete-dialog {
      width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 32px);
      box-sizing: border-box; overflow-y: auto; border: 1px solid var(--line);
      border-radius: 12px; padding: 20px; background: var(--paper); color: var(--ink);
    }
    .segment-delete-dialog::backdrop { background: rgba(21,38,35,.42); }
    .segment-delete-list { max-height: 46dvh; overflow-y: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
    .segment-delete-option, .segment-delete-select-all { display: flex; align-items: center; gap: 10px; }
    .segment-delete-option { padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
    .segment-delete-option:last-child { border-bottom: 0; }
    .segment-delete-option:has(input:checked) { background: rgba(183,117,75,.12); }
    .segment-delete-option input, .segment-delete-select-all input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
    .segment-delete-option > span { min-width: 0; }
    .segment-delete-option strong, .segment-delete-option small { display: block; overflow-wrap: anywhere; }
    .segment-delete-option small { color: var(--muted); font-weight: 400; }
    .total-text-edit-dialog textarea { width: 100%; min-height: 110px; box-sizing: border-box; resize: vertical; }
    .total-text-edit-dialog .actions { justify-content: flex-end; margin-top: 14px; }
    .segment-row {
      position: relative;
      border-radius: 8px;
      box-shadow: none;
      padding: 13px 13px 13px 18px;
      background: rgba(255,255,255,.68);
      overflow: hidden;
    }
    .segment-row.jump-highlight {
      border-color: var(--lacquer);
      box-shadow: 0 0 0 4px rgba(169,61,45,.12);
    }
    .segment-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 9px; }
    .segment-head > span { margin-left: auto; }
    button.segment-collapse-toggle {
      flex: 0 0 auto;
      padding: 3px 7px;
      min-width: 28px;
      font-size: 12px;
      line-height: 1.5;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    .segment-collapse-toggle:hover, .segment-collapse-toggle:active {
      border: 0;
      background: transparent;
      box-shadow: none;
      transform: none;
    }
    .segment-row.is-collapsed .segment-head { margin-bottom: 0; }
    .segment-row.is-collapsed .segment-content { display: none; }
    @media (max-width: 700px) {
      #page-workbench .segment-head { grid-template-columns: auto minmax(0, 1fr) auto; }
      #page-workbench .segment-head > span { margin-left: 0; }
    }
    .segment-title-input {
      width: min(320px, 100%);
      border: 0;
      border-bottom: 1px dotted rgba(33,78,84,.32);
      border-radius: 0;
      background: transparent;
      padding: 3px 0;
      color: var(--ink);
      font-weight: 900;
    }
    .segment-body { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .segment-body.tri-col { grid-template-columns: 1fr; }
    .segment-body textarea { min-height: 80px; }
    .seg-col { display: flex; flex-direction: column; gap: 4px; }
    .seg-col label { font-size: 11px; color: var(--muted); letter-spacing: 1px; font-weight: 600; }
    .seg-col textarea { flex: 1; min-height: 40px; resize: vertical; }
    .seg-edit-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: stretch; }
    .seg-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
    .seg-field-head label { margin: 0; }
    .seg-field-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
    #page-workbench .seg-field-actions button,
    #page-workbench .seg-field-actions button:hover,
    #page-workbench .seg-field-actions button.active {
      min-width: 0; min-height: 0; padding: 2px 0; border: 0; border-radius: 0;
      background: transparent; box-shadow: none; transform: none; font-size: 13px;
    }
    #page-workbench .seg-field-actions button:hover { text-decoration: underline; }
    #page-workbench .seg-field-actions button:focus-visible { outline: 2px solid var(--sea-dark); outline-offset: 3px; }
    .field-reference-toggle {
      align-self: stretch;
      min-width: 58px;
      padding: 8px 12px;
      border: 1px solid rgba(183, 117, 75, .26);
      border-radius: 12px;
      background: rgba(250, 238, 220, .82);
      color: var(--clay-dark);
      font-weight: 800;
      cursor: pointer;
    }
    .field-reference-toggle:hover,
    .field-reference-toggle.active {
      background: rgba(199, 132, 83, .18);
      border-color: rgba(183, 117, 75, .52);
    }
    .save-field {
      align-self: stretch;
      min-width: 72px;
      padding: 0 14px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 800;
      white-space: nowrap;
    }
    .save-field.unsaved {
      color: #9d3535;
      border-color: rgba(196,72,72,.46);
      background: rgba(210,92,86,.12);
    }
    .save-field.saved {
      color: #805d13;
      border-color: rgba(207,164,66,.6);
      background: rgba(230,190,85,.2);
    }
    .save-field.verified {
      color: #1a6b3f;
      border-color: rgba(42,157,92,.4);
      background: rgba(42,157,92,.12);
    }
    .save-field.dirty {
      background: rgba(210,92,86,.16);
      color: #9d3535;
      border-color: rgba(196,72,72,.55);
      animation: pulse-save .6s ease 1;
    }
    .seg-col.locked textarea {
      background: rgba(122, 117, 98, .06);
      color: rgba(36, 51, 48, .52);
    }
    .seg-col.locked .ipa-palette {
      opacity: .45;
      pointer-events: none;
    }
    .seg-col-ipa textarea { font-family: "Noto Sans", "Lucida Sans Unicode", "Segoe UI", sans-serif; font-size: 13px; color: var(--sea-dark); }
    .ipa-review-hint {
      padding: 7px 10px;
      border: 1px dashed rgba(201,111,91,.44);
      border-radius: 10px;
      background: rgba(248,221,206,.42);
      color: #85483e;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.45;
    }
    .segment-audio-row {
      margin-top: 10px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }
    .segment-audio-row audio {
      display: none;
    }
    .segment-seek-track { position: relative; height: 42px; min-width: 0; }
    .segment-seek-track .timeline-rail { top: 14px; }
    .segment-seek {
      position: absolute; inset: 0; width: 100%; height: 42px;
      margin: 0; padding: 0; border: 0; border-radius: 0;
      appearance: none; background: transparent; box-shadow: none; cursor: pointer;
    }
    .segment-seek::-webkit-slider-runnable-track { height: 14px; background: transparent; }
    .segment-seek::-moz-range-track { height: 14px; background: transparent; }
    .segment-seek::-webkit-slider-thumb { appearance: none; width: 12px; height: 14px; border: 0; border-radius: 6px; background: var(--sea); }
    .segment-seek::-moz-range-thumb { width: 12px; height: 14px; border: 0; border-radius: 6px; background: var(--sea); }
    .segment-seek:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 4px; }
    @media (max-width: 600px) {
      .segment-audio-row { gap: 7px; grid-template-columns: 32px auto minmax(0, 1fr) 32px; }
      .segment-audio-row .icon-button { width: 32px; height: 36px; }
      .segment-audio-row .timeline-clock { min-width: 0; font-size: 12px; }
    }
    .ipa-hint {
      display: block;
      margin-top: 6px;
      min-height: 0;
    }
    .ipa-hint:empty { display: none; }
    .ipa-hint-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin: 4px 0 5px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .04em;
    }
    .ipa-hint-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }
    .ipa-hint-char {
      display: inline-grid;
      grid-template-columns: auto auto;
      gap: 1px 5px;
      align-items: baseline;
      padding: 4px 7px;
      font-size: 11px;
      font-family: "Noto Sans", sans-serif;
      color: var(--sea-dark); background: rgba(74,124,130,.08);
      border-radius: 8px; border: 1px solid rgba(74,124,130,.15);
      cursor: pointer;
      box-shadow: none;
    }
    .ipa-hint-char.phrase {
      border-color: rgba(169,61,45,.22);
      background: rgba(242,221,196,.42);
      min-width: 86px;
    }
    .ipa-hint-char[title]:hover { background: rgba(74,124,130,.18); }
    .ipa-hint-char.tw-ref { opacity: .55; border-style: dashed; background: rgba(180,140,60,.06); }
    .ipa-hint-char.tw-ref::after { content: "\u53f0"; font-size: 8px; color: #b08030; margin-left: 2px; vertical-align: super; }
    .ipa-hint-text { color: var(--ink); font-weight: 800; }
    .ipa-hint-reading { font-weight: 800; color: var(--sea-dark); }
    .ipa-hint-change {
      grid-column: 1 / -1;
      color: var(--clay-dark);
      font-size: 10px;
      line-height: 1.2;
    }
    .ipa-hint-action {
      padding: 4px 8px;
      border: 1px solid rgba(139,124,102,.32);
      border-radius: 999px;
      background: rgba(255,255,255,.72);
      color: var(--clay-dark);
      box-shadow: none;
      cursor: pointer;
      font-size: 11px;
      font-weight: 800;
    }
    .ipa-hint-action:hover { background: rgba(242,221,196,.75); }
    .ipa-hint.ipa-filled .ipa-hint-char { background: rgba(46,125,50,.15); color: #2e7d32; }
    .ipa-hint.ipa-filled .ipa-hint-action { color: #2e7d32; }
    textarea.ipa-filled { background: rgba(46,125,50,.06) !important; border-color: #4caf50 !important; }
    .ipa-workflow-hint { font-size: 10px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
    .field-reference-panel {
      margin-top: 8px;
      padding: 10px;
      border: 1px dashed rgba(183,117,75,.34);
      border-radius: 14px;
      background: rgba(255,248,236,.92);
    }
    .field-reference-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .field-reference-toolbar select {
      min-height: 34px;
      padding: 6px 10px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(255,250,240,.95);
      color: var(--ink);
      font-weight: 700;
    }
    .reference-hint {
      margin-bottom: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .reference-source-help {
      display: grid;
      gap: 6px;
      margin: 0 0 9px;
      padding: 8px 10px;
      border-radius: 12px;
      background: rgba(250, 238, 220, .52);
      border: 1px solid rgba(183,117,75,.16);
    }
    .reference-help-row {
      display: grid;
      grid-template-columns: 110px 1fr;
      gap: 8px;
      align-items: baseline;
      font-size: 12px;
      line-height: 1.55;
    }
    .reference-help-row strong { color: var(--clay-dark); }
    .reference-help-row span { color: var(--muted); }
    .reference-content {
      border-radius: 12px;
      background: rgba(255,255,255,.46);
      border: 1px solid rgba(139,124,102,.18);
      padding: 10px;
      color: var(--ink);
      line-height: 1.7;
    }
    .reference-output {
      white-space: pre-wrap;
      word-break: break-word;
      font-weight: 700;
      color: var(--sea-dark);
    }
    .reference-strategy-card {
      display: grid;
      gap: 7px;
      margin-bottom: 10px;
      padding: 9px 10px;
      border: 1px solid rgba(183,117,75,.18);
      border-radius: 12px;
      background: rgba(255,248,236,.76);
      font-size: 12px;
    }
    .reference-strategy-card strong {
      color: var(--clay-dark);
      font-size: 13px;
    }
    .reference-strategy-card.not-adoptable {
      border-color: rgba(169,61,45,.24);
      background: rgba(255,244,236,.86);
    }
    .reference-strategy-status {
      color: var(--muted);
      line-height: 1.45;
    }
    .reference-strategy-card.not-adoptable .reference-strategy-status {
      color: var(--lacquer);
      font-weight: 800;
    }
    .reference-strategy-steps {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .reference-strategy-steps span,
    .reference-strategy-metrics span {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 3px 8px;
      border-radius: 999px;
      background: rgba(255,255,255,.7);
      border: 1px solid rgba(139,124,102,.14);
      color: var(--muted);
    }
    .reference-strategy-metrics {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .reference-strategy-metrics strong {
      margin-left: 4px;
      color: var(--ink);
      font-size: 12px;
    }
    .reference-alignment {
      margin-top: 10px;
      border: 1px solid rgba(139,124,102,.18);
      border-radius: 12px;
      overflow: hidden;
      background: rgba(255,252,245,.82);
    }
    .reference-alignment-title {
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 800;
      color: var(--clay-dark);
      background: rgba(242,221,196,.45);
      border-bottom: 1px solid rgba(139,124,102,.14);
    }
    .reference-alignment table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      line-height: 1.55;
    }
    .reference-alignment th,
    .reference-alignment td {
      padding: 6px 8px;
      border-bottom: 1px solid rgba(139,124,102,.12);
      text-align: left;
      vertical-align: top;
    }
    .reference-alignment th {
      color: var(--muted);
      font-weight: 700;
      background: rgba(255,255,255,.38);
    }
    .reference-alignment tr:last-child td { border-bottom: none; }
    .reference-alignment code {
      white-space: normal;
      word-break: break-word;
      color: var(--ink);
      background: transparent;
    }
    .reference-token-line {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 8px;
    }
    .reference-token {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border-radius: 999px;
      padding: 3px 8px;
      border: 1px solid rgba(139,124,102,.2);
      background: rgba(240,232,214,.72);
      color: var(--ink);
      cursor: default;
      font-size: 12px;
    }
    .reference-token-source {
      padding-left: 5px;
      border-left: 1px solid currentColor;
      opacity: .58;
      font-size: 10px;
      line-height: 1;
      white-space: nowrap;
    }
    .reference-token.dictionary_match,
    .reference-token.memory_match,
    .reference-token.ai_reference,
    .reference-token.exemplar_exact,
    .reference-token.exemplar_phrase,
    .reference-token.phrase_rule {
      background: rgba(95,150,148,.14);
      border-color: rgba(183,117,75,.28);
    }
    .reference-token.ai_guess,
    .reference-token.uncertain,
    .reference-token.missing {
      background: rgba(169,61,45,.08);
      border-color: rgba(169,61,45,.28);
      color: var(--lacquer);
    }
    .reference-warning {
      margin-top: 8px;
      color: var(--clay-dark);
      font-size: 12px;
    }
    .reference-ipa-block {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid rgba(139,124,102,.16);
    }
    .reference-content > .reference-ipa-block:first-child {
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
    }
    .reference-ipa-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
      color: var(--ink);
      font-size: 12px;
    }
    .reference-fill-ipa { padding: 5px 10px; font-size: 12px; }
    .reference-ipa-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .reference-ipa-layers {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }
    .reference-ipa-layers span {
      padding: 3px 8px;
      border: 1px solid rgba(74,124,130,.18);
      border-radius: 999px;
      background: rgba(74,124,130,.07);
      color: var(--sea-dark);
      font-size: 11px;
      font-weight: 800;
    }
    .reference-ipa-card {
      display: inline-grid;
      grid-template-columns: auto auto;
      gap: 1px 6px;
      align-items: baseline;
      padding: 5px 8px;
      border-radius: 10px;
      border: 1px solid rgba(74,124,130,.18);
      background: rgba(74,124,130,.08);
      color: var(--sea-dark);
      box-shadow: none;
      cursor: pointer;
      font-size: 12px;
    }
    .reference-ipa-card.phrase {
      min-width: 88px;
      border-color: rgba(169,61,45,.22);
      background: rgba(242,221,196,.42);
    }
    .reference-ipa-card:hover { background: rgba(95,150,148,.14); }
    .reference-ipa-card.tw-ref { opacity: .62; border-style: dashed; }
    .reference-ipa-card.human-override {
      border-color: rgba(169,61,45,.34);
      background: rgba(169,61,45,.08);
    }
    .reference-ipa-word { color: var(--ink); font-weight: 900; }
    .reference-ipa-reading { font-family: "Noto Sans", "Lucida Sans Unicode", sans-serif; font-weight: 900; }
    .reference-ipa-source {
      grid-column: 1 / -1;
      color: var(--sea-dark);
      font-size: 10px;
      font-weight: 800;
      opacity: .82;
    }
    .reference-ipa-note {
      grid-column: 1 / -1;
      color: var(--clay-dark);
      font-size: 10px;
      line-height: 1.2;
    }
    .reference-ipa-tip {
      margin-top: 6px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }
    .dict-match { display: block; margin-top: 6px; min-height: 0; font-size: 12px; line-height: 1.6; }
    .dict-match:empty { display: none; }
    .dict-match-head {
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 4px;
    }
    .dict-token-line { display: flex; flex-wrap: wrap; gap: 2px; }
    .dict-hit {
      display: inline; padding: 0 2px; border-radius: 3px;
      background: rgba(95,150,148,.16); color: #315a60;
      border-bottom: 2px solid rgba(95,150,148,.5);
      cursor: help; font-weight: 500;
    }
    .dict-hit:hover { background: rgba(95,150,148,.24); }
    .dict-plain { display: inline; color: var(--muted); opacity: .6; }
    .candidate-match {
      display: block;
      margin-top: 6px;
      min-height: 0;
      font-size: 12px;
      line-height: 1.8;
    }
    .candidate-match:empty { display: none; }
    .candidate-empty {
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
      border: 1px dashed rgba(139,124,102,.28);
      border-radius: 10px;
      padding: 7px 9px;
      background: rgba(255,255,255,.42);
    }
    .candidate-match-head {
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 4px;
    }
    .candidate-token-line {
      display: block;
      word-break: break-word;
      color: var(--muted);
    }
    .candidate-hit {
      position: relative;
      display: inline-block;
      margin: 0 1px;
      padding: 0 4px;
      border-radius: 5px;
      background: rgba(190, 104, 58, .16);
      color: #9b3f22;
      border-bottom: 2px solid rgba(190, 104, 58, .45);
      font-weight: 800;
      cursor: default;
    }
    .candidate-hit:hover,
    .candidate-hit:focus-within,
    .candidate-hit:focus {
      background: rgba(190, 104, 58, .24);
      outline: none;
    }
    .candidate-plain {
      display: inline;
      color: inherit;
      opacity: .86;
    }
    .candidate-popover {
      position: absolute;
      left: 0;
      bottom: calc(100% + 6px);
      z-index: 120;
      min-width: 160px;
      max-width: min(360px, 72vw);
      padding: 8px;
      border: 1px solid rgba(147, 86, 52, .24);
      border-radius: 12px;
      background: rgba(255, 250, 240, .98);
      box-shadow: 0 14px 34px rgba(70, 50, 28, .18);
      display: none;
      gap: 5px;
      flex-wrap: wrap;
      color: var(--ink);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    .candidate-hit:hover .candidate-popover,
    .candidate-hit:focus-within .candidate-popover,
    .candidate-hit:focus .candidate-popover {
      display: flex;
    }
    .candidate-popover strong {
      width: 100%;
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 2px;
      font-weight: 800;
    }
    .candidate-popover button {
      border: 1px solid rgba(190, 104, 58, .22);
      border-radius: 999px;
      background: rgba(190, 104, 58, .08);
      color: #8f3b23;
      padding: 3px 8px;
      font-size: 12px;
      line-height: 1.4;
      cursor: pointer;
      box-shadow: none;
    }
    .candidate-popover button:hover {
      background: rgba(190, 104, 58, .18);
      border-color: rgba(190, 104, 58, .42);
    }
    .candidate-more {
      align-self: center;
      color: var(--muted);
      font-size: 11px;
      padding: 0 4px;
    }
    .candidate-detail-panel {
      position: fixed;
      z-index: 300;
      width: min(360px, calc(100vw - 24px));
      max-height: min(420px, calc(100vh - 24px));
      overflow: auto;
      border: 1px solid rgba(147,86,52,.24);
      border-radius: 16px;
      background: rgba(255,250,240,.98);
      box-shadow: 0 18px 48px rgba(70,50,28,.22);
      padding: 16px;
      color: var(--ink);
      line-height: 1.65;
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
    }
    .candidate-detail-panel h4 { font-size: 20px; margin-bottom: 8px; color: var(--clay-dark); }
    .candidate-detail-panel p { margin: 6px 0; }
    .candidate-detail-panel code { color: var(--sea-dark); white-space: normal; word-break: break-all; }
    .candidate-definition {
      margin: 10px 0;
      padding: 10px;
      border-radius: 12px;
      background: rgba(242,221,196,.48);
      border: 1px solid rgba(147,86,52,.14);
      white-space: pre-wrap;
    }
    .candidate-detail-close {
      float: right;
      width: 28px;
      height: 28px;
      border-radius: 999px;
      padding: 0;
      background: rgba(255,255,255,.74);
      color: var(--clay-dark);
      border: 1px solid var(--line);
      box-shadow: none;
    }
    .export-menu {
      position: absolute; top: 100%; right: 0; z-index: 90;
      background: rgba(255, 250, 240, .98); border: 1px solid var(--line); border-radius: 12px;
      box-shadow: 0 18px 40px rgba(70, 50, 28, .18); min-width: 150px; padding: 6px;
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
    }
    .export-menu button {
      display: block; width: 100%; text-align: left; padding: 9px 14px;
      background: transparent; border: none; border-radius: 9px; font-size: 13px; color: var(--ink);
      cursor: pointer;
    }
    .export-menu button:hover { background: rgba(174, 96, 58, .12); }
    .lexicon-manager {
      margin-top: 18px;
      padding-top: 18px;
      border-top: 1px solid var(--line);
    }
    .lexicon-search-row {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) 220px auto;
      gap: 10px;
      align-items: end;
      margin: 12px 0;
    }
    .lexicon-manager-grid {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(280px, .9fr);
      gap: 14px;
      align-items: start;
    }
    .mapping-list {
      display: grid;
      gap: 8px;
      min-height: 260px;
    }
    .mapping-row {
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 10px 12px;
      background: rgba(255,255,255,.58);
      cursor: pointer;
    }
    .mapping-row:hover,
    .mapping-row.active {
      border-color: rgba(169,61,45,.34);
      background: rgba(242,221,196,.38);
    }
    .mapping-row strong {
      display: inline-block;
      margin-right: 8px;
      color: var(--clay-dark);
      font-size: 16px;
    }
    .mapping-row code {
      color: var(--sea-dark);
      white-space: normal;
      word-break: break-all;
    }
    .mapping-editor {
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 14px;
      background: rgba(255,255,255,.48);
    }
    .mapping-editor textarea {
      min-height: 76px;
    }
    .ipa-palette {
      display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 4px;
    }
    .ipa-palette span {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 22px; height: 22px; padding: 0 4px;
      border: 1px solid var(--line); border-radius: 4px;
      font-size: 13px; font-family: "Noto Sans", sans-serif;
      color: var(--sea-dark); background: rgba(255,255,255,.8);
      cursor: pointer; -webkit-user-select: none; user-select: none; transition: background .12s;
    }
    .ipa-palette span:hover { background: rgba(74,124,130,.12); border-color: var(--sea); }
    .pagination {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      gap: 7px;
      margin-top: 14px;
    }
    .pagination button {
      min-width: 38px;
      padding: 8px 10px;
      background: rgba(255,255,255,.72);
      color: var(--sea-dark);
      border: 1px solid var(--line);
    }
    .pagination button.active { background: var(--sea-dark); color: #fff; border-color: transparent; }
    .pagination button:disabled { opacity: .38; }
    .empty {
      padding: 18px;
      border: 1px dashed var(--line);
      border-radius: 16px;
      color: var(--muted);
      background: rgba(255,255,255,.5);
    }
    .fab-stack {
      position: fixed;
      right: 22px;
      bottom: 22px;
      z-index: 20;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }
    .back-to-top {
      width: 48px;
      height: 48px;
      border-radius: 999px;
      display: none;
      box-shadow: 0 12px 28px rgba(20,43,46,.16);
    }
    .back-to-top.show { display: inline-grid; }
    .seg-nav-btn {
      width: 48px;
      height: 48px;
      border-radius: 999px;
      display: none;
      box-shadow: 0 12px 28px rgba(20,43,46,.16);
      background: rgba(255,250,240,.92);
      border: 1.5px solid var(--sand);
      color: var(--sea-dark);
    }
    .seg-nav-btn.show { display: inline-grid; }
    .seg-nav-btn:hover { border-color: var(--lacquer); }
    .seg-nav-popup {
      position: absolute;
      bottom: 58px;
      right: 0;
      width: 240px;
      max-height: 360px;
      overflow-y: auto;
      padding: 10px;
      border-radius: 16px;
      background: rgba(255,250,240,.96);
      border: 1px solid var(--line);
      box-shadow: 0 16px 40px rgba(20,43,46,.18);
    }
    .fab-stack.has-back-to-top .seg-nav-popup { bottom: 116px; }
    .seg-nav-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
      font-size: 13px;
    }
    .seg-nav-header button { width: 28px; height: 28px; padding: 0; font-size: 16px; }
    .suggest-list {
      position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
      max-height: 180px; overflow-y: auto;
      background: #fff; border: 1px solid var(--line); border-radius: 8px;
      box-shadow: 0 6px 16px rgba(20,43,46,.12); margin-top: 2px;
    }
    .suggest-item {
      padding: 6px 10px; font-size: 13px; cursor: pointer;
      border-bottom: 1px solid rgba(216,204,186,.4);
    }
    .suggest-item:last-child { border-bottom: none; }
    .suggest-item:hover { background: rgba(74,124,130,.08); }
    .seg-nav-filters { display: flex; gap: 4px; margin-bottom: 6px; }
    .seg-nav-filter {
      flex: 1; padding: 3px 0; font-size: 11px; border-radius: 6px;
      border: 1px solid var(--line); background: transparent; color: var(--muted);
      cursor: pointer; transition: all .12s;
    }
    .seg-nav-filter.active { background: var(--moss); color: #fff; border-color: var(--moss); }
    .seg-nav-filter:hover:not(.active) { border-color: var(--sea); }
    .seg-nav-list {
      display: grid;
      gap: 3px;
      max-height: 320px;
      overflow-y: auto;
      align-content: start;
    }
    .seg-nav-item {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 8px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,.6);
      cursor: pointer;
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .seg-nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .seg-nav-status {
      width: 15px;
      height: 15px;
      flex: 0 0 15px;
      fill: rgba(255,255,255,.72);
      stroke: var(--line-dark);
      stroke-width: 1.4;
    }
    .seg-nav-status path {
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.8;
    }
    .seg-nav-status.corrected { stroke: #5f9694; fill: rgba(95,150,148,.18); }
    .seg-nav-status.verified { stroke: #2d7b50; fill: rgba(42,157,92,.12); }
    .seg-nav-status.draft { stroke: var(--clay-dark); fill: rgba(169,61,45,.06); }
    .seg-nav-item:hover { background: rgba(95,150,148,.13); border-color: var(--sea); }
    .seg-nav-item.active { border-color: var(--lacquer); background: rgba(169,61,45,.08); }
    .readonly-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 14px;
      background: rgba(255,255,255,.62);
      margin-top: 12px;
    }
    .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;
    }
    .knowledge-export-jump {
      display: inline-grid;
      grid-template-columns: minmax(150px, 220px) auto;
      gap: 8px;
      align-items: center;
    }
    .knowledge-export-jump select {
      min-height: 42px;
      padding-top: 8px;
      padding-bottom: 8px;
    }
    .viewer-segment {
      display: grid;
      grid-template-columns: 90px minmax(0, 1fr) minmax(150px, auto);
      gap: 10px;
      padding: 9px 0;
      border-bottom: 1px solid rgba(216,204,186,.75);
    }
    .viewer-ipa { font-size: 12px; color: var(--sea-dark); margin-top: 3px; font-family: "Noto Sans", sans-serif; word-break: break-all; }
    .viewer-mandarin { font-size: 13px; color: var(--muted); margin-top: 3px; }
    .result-row .small, .archive-result-list .small { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
    .delete-archive { font-size: 11px; padding: 1px 6px; color: var(--lacquer); opacity: .5; margin-left: auto; }
    .delete-archive:hover { opacity: 1; background: rgba(169,61,45,.08); }
    .archive-panel { display: none; }
    .archive-panel.open { display: block; }
    .preview-full { min-height: 0; }
    .preview-full #kbPreview > .empty { padding: 14px 0 2px; }
    .preview-total { min-height: 150px; margin-top: 12px; }

    .task-item {
      display: grid;
      gap: 9px;
      padding: 12px;
      border: 1px solid rgba(216,204,186,.72);
      border-radius: 12px;
      background: rgba(255,255,255,.56);
    }
    .task-item-openable { cursor: pointer; }
    .task-item-openable:hover {
      border-color: var(--sand);
      background: rgba(255,255,255,.82);
    }
    .task-card-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      gap: 10px;
    }
    .task-record-block { min-width: 0; display: grid; gap: 2px; }
    .task-record-label {
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
    }
    .task-status-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 64px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
      border: 1px solid rgba(216,204,186,.85);
      background: rgba(255,255,255,.72);
      color: var(--muted);
    }
    .task-status-chip.pending { color: #315a60; background: rgba(95,150,148,.16); border-color: rgba(95,150,148,.42); }
    .task-status-chip.running { color: #7c4b26; background: rgba(237,180,100,.22); border-color: rgba(220,151,78,.5); }
    .task-status-chip.done { color: #24633f; background: rgba(42,157,92,.14); border-color: rgba(42,157,92,.42); }
    .task-status-chip.failed { color: #8d3e47; background: rgba(217,107,115,.16); border-color: rgba(217,107,115,.48); }
    .task-type {
      color: var(--ink);
      font-weight: 900;
    }
    .task-record {
      color: var(--sea-dark);
      font-weight: 900;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
    }
    .task-card-meta {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 5px 9px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }
    .task-card-meta span {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .task-card-meta span + span::before {
      content: "";
      width: 4px;
      height: 4px;
      border-radius: 999px;
      background: rgba(122,117,98,.45);
    }
    .task-type {
      color: var(--ink);
      font-weight: 900;
    }
    .task-progress-track {
      height: 6px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(216,204,186,.56);
    }
    .task-progress-track div {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--moss), var(--sand));
    }
    .task-card-foot {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      padding-top: 2px;
    }
    .task-result {
      color: var(--sea-dark);
      font-size: 12px;
      font-weight: 700;
      line-height: 1.55;
    }
    .task-open-hint {
      color: var(--lacquer);
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }
    .bulk-verify-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
    }

    .cutpoint-list-panel {
      border-top: 1px solid rgba(216,204,186,.6);
      padding-top: 6px;
      margin-top: 6px;
    }
    .cutpoint-list-panel .panel-title { font-size: 12px; margin-bottom: 4px; }
    .cutpoint-list-panel.hidden { display: none; }

    .archive-result-list { max-height: none; }

    /* Stats overview */
    .stats-overview { padding: 16px 20px; }
    .stats-cards {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
    }
    .stat-card {
      flex: 1;
      min-width: 100px;
      text-align: center;
      padding: 12px 8px;
      border-radius: 8px;
      background: var(--bg2);
      border: 1px solid var(--border);
    }
    .stat-value {
      display: block;
      font-size: 28px;
      font-weight: 700;
      color: var(--fg);
      line-height: 1.2;
    }
    .stat-label {
      display: block;
      font-size: 12px;
      color: var(--muted);
      margin-top: 4px;
    }
    .stats-detail-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      margin-top: 14px;
    }
    .stat-section {
      border: 1px solid rgba(216,204,186,.82);
      border-radius: 16px;
      padding: 13px;
      background: rgba(255,255,255,.42);
    }
    .stat-section-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: baseline;
      margin-bottom: 10px;
    }
    .stat-section-head h3 { font-size: 16px; min-width: max-content; }
    .bar-list, .quality-list, .plan-list { display: grid; gap: 8px; }
    .bar-row-meta {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      font-size: 12px;
      color: var(--muted);
    }
    .bar-row-meta strong { color: var(--ink); font-size: 13px; }
    .bar-track, .quality-meter {
      height: 7px;
      border-radius: 999px;
      background: rgba(216,204,186,.55);
      overflow: hidden;
      margin-top: 4px;
    }
    .bar-track span, .quality-meter span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--moss), var(--cinnabar-light));
    }
    .quality-row {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) minmax(70px, 120px) 38px;
      gap: 8px;
      align-items: center;
      font-size: 12px;
    }
    .quality-row strong, .quality-row span { display: block; }
    .quality-row span { color: var(--muted); margin-top: 2px; }
    .quality-row b { color: var(--clay-dark); text-align: right; }
    .plan-item {
      border-left: 3px solid var(--sand);
      padding-left: 9px;
      font-size: 12px;
      line-height: 1.55;
    }
    .plan-item strong { display: block; color: var(--ink); margin-bottom: 2px; }
    .plan-item span { color: var(--muted); }

    /* Export page */
    .export-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }
    #page-export {
      margin-left: -14px;
      margin-right: -14px;
      overflow-x: clip;
    }
    #page-export > .panel {
      padding-left: 12px;
      padding-right: 12px;
    }
    .export-grid label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
    .export-grid select, .export-grid input { width: 100%; }
    .export-output-layout {
      display: grid;
      grid-template-columns: minmax(min(100%, 260px), .82fr) minmax(0, 1.18fr);
      gap: 16px;
      align-items: start;
      min-width: 0;
      max-width: 100%;
      margin-bottom: 18px;
    }
    .export-main-fields,
    .export-filename-column {
      display: grid;
      gap: 12px;
      min-width: 0;
    }
    .export-main-fields {
      grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
      align-items: start;
      column-gap: 14px;
      row-gap: 12px;
      padding: 12px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 16px;
      background: rgba(255,255,255,.46);
    }
    .export-main-fields > div {
      min-width: 0;
    }
    .export-output-layout > *,
    .export-filename-column > *,
    .export-main-fields > * {
      min-width: 0;
    }
    .export-output-layout label {
      display: block;
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .export-output-layout select,
    .export-output-layout input {
      width: 100%;
    }
    .export-filename-column {
      padding: 12px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 16px;
      background: rgba(255,250,240,.5);
    }
    .export-preview-limit-control {
      padding-top: 10px;
      border-top: 1px dashed rgba(184,117,76,.24);
    }
    .export-preview-limit-control input {
      max-width: 150px;
    }
    .export-mode-tabs {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 6px;
      margin: 10px 0 18px;
      border: 1px solid rgba(216, 139, 126, .24);
      border-radius: 18px;
      background: rgba(255,255,255,.48);
    }
    .export-mode-tabs button {
      box-shadow: none;
    }
    .export-mode-tabs button.active {
      background: linear-gradient(135deg, #39676c, #6ea7a0);
      color: #fffdf8;
    }
    .export-mode-pane {
      display: none;
    }
    .export-mode-pane.active {
      display: block;
    }
    .export-workspace {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 18px;
      align-items: start;
      min-width: 0;
    }
    .export-workspace > * {
      min-width: 0;
    }
    .export-sidebar {
      position: sticky;
      top: 86px;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      gap: 12px;
      max-height: calc(100vh - 106px);
      overflow: hidden;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: rgba(255, 250, 240, .74);
    }
    .export-sidebar-scroll {
      display: grid;
      gap: 10px;
      min-height: 0;
      overflow-y: auto;
      padding-right: 2px;
    }
    .export-sidebar label,
    .export-rule-panel label {
      font-size: 13px;
      color: var(--muted);
      font-weight: 700;
    }
    .export-sidebar input,
    .export-sidebar select,
    .export-rule-panel textarea,
    .export-rule-panel input {
      width: 100%;
    }
    .export-sidebar select.sr-only {
      width: 1px;
    }
    .theme-select {
      position: relative;
      min-width: 0;
    }
    .theme-select-button {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 18px;
      align-items: center;
      gap: 10px;
      width: 100%;
      min-height: 48px;
      padding: 10px 13px 10px 14px;
      border: 1px solid rgba(184,117,76,.38);
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,250,240,.88));
      color: var(--ink);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 18px rgba(72,48,28,.04);
      text-align: left;
    }
    .theme-select-button:hover {
      border-color: rgba(201,111,91,.56);
      background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,247,236,.94));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 10px 22px rgba(72,48,28,.06);
    }
    .theme-select-button:focus-visible,
    .theme-select.open .theme-select-button {
      border-color: rgba(201,111,91,.72);
      box-shadow: 0 0 0 3px rgba(217,107,115,.14), inset 0 1px 0 rgba(255,255,255,.78);
    }
    .theme-select-button span:first-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .theme-select-caret {
      width: 0;
      height: 0;
      justify-self: center;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 6px solid #7f4d58;
      transition: transform .16s ease;
    }
    .theme-select.open .theme-select-caret {
      transform: rotate(180deg);
    }
    .theme-select-menu {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 7px);
      z-index: 38;
      display: grid;
      gap: 4px;
      max-height: min(360px, calc(100vh - 190px));
      overflow-y: auto;
      padding: 7px;
      border: 1px solid rgba(184,117,76,.34);
      border-radius: 14px;
      background: rgba(255,250,240,.98);
      box-shadow: 0 18px 38px rgba(72,48,28,.18);
      scrollbar-gutter: stable;
    }
    .theme-select-menu[hidden] {
      display: none;
    }
    .theme-select-option {
      width: 100%;
      min-height: 40px;
      padding: 8px 11px;
      border: 1px solid transparent;
      border-radius: 10px;
      background: transparent;
      color: var(--ink);
      box-shadow: none;
      text-align: left;
    }
    .theme-select-option:hover,
    .theme-select-option:focus-visible {
      border-color: rgba(184,117,76,.24);
      background: rgba(255,255,255,.72);
      color: #6f3f4b;
      box-shadow: none;
    }
    .theme-select-option.active {
      border-color: rgba(201,111,91,.24);
      background: linear-gradient(90deg, rgba(217,107,115,.16), rgba(242,184,107,.18));
      color: #6f3f4b;
      font-weight: 900;
    }
    .export-mini-actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
    }
    .export-mini-actions button {
      padding-left: 8px;
      padding-right: 8px;
    }
    .export-sidebar-section {
      display: grid;
      gap: 8px;
      padding-top: 2px;
    }
    .export-side-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .export-side-label-row label {
      margin: 0;
    }
    .export-side-label-row button.small {
      padding: 5px 10px;
      border-radius: 999px;
      font-size: 12px;
    }
    .export-main {
      min-width: 0;
      width: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
    }
    .export-plan-panel,
    .export-ai-panel {
      min-width: 0;
      padding: 14px;
      margin-bottom: 16px;
      border: 1px solid rgba(184,117,76,.22);
      border-radius: 18px;
      background: rgba(255,255,255,.44);
    }
    .export-plan-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .export-plan-card {
      min-width: 0;
      padding: 11px 12px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 14px;
      background: rgba(255,250,240,.58);
    }
    .export-plan-card strong,
    .export-plan-card span {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .export-plan-card strong {
      color: var(--ink);
      font-size: 14px;
    }
    .export-plan-card span {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
    }
    .export-ai-panel {
      display: grid;
      gap: 12px;
      background: rgba(255,250,240,.5);
    }
    .export-ai-head,
    .export-ai-compose,
    .export-ai-actions {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      justify-content: space-between;
      min-width: 0;
    }
    .export-ai-head h3 {
      margin: 0 0 3px;
      color: var(--ink);
    }
    .export-ai-prompts,
    .export-ai-actions {
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .export-ai-prompts button.small {
      padding: 5px 10px;
      border-radius: 999px;
      font-size: 12px;
    }
    .export-ai-compose textarea {
      flex: 1 1 auto;
      width: 100%;
      min-height: 76px;
      resize: vertical;
    }
    .export-ai-actions {
      flex: 0 0 150px;
    }
    .export-ai-actions button {
      width: 100%;
    }
    .export-ai-result {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(39,139,87,.22);
      border-radius: 14px;
      background: rgba(255,255,255,.62);
    }
    .export-ai-result.warn {
      border-color: rgba(169,61,45,.28);
      background: rgba(255,245,240,.66);
    }
    .export-ai-result-head strong,
    .export-ai-result-head span {
      display: block;
    }
    .export-ai-result-head strong {
      color: var(--ink);
      margin-bottom: 2px;
    }
    .export-ai-result-head span,
    .export-ai-output-list span,
    .export-ai-notes span {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .export-ai-output-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
      gap: 8px;
    }
    .export-ai-output-list div,
    .export-ai-notes {
      padding: 9px 10px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 12px;
      background: rgba(255,250,240,.52);
    }
    .export-ai-output-list b,
    .export-ai-output-list span,
    .export-ai-notes b,
    .export-ai-notes span {
      display: block;
    }
    .export-ai-notes {
      display: grid;
      gap: 4px;
    }
    .export-rule-panel {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-bottom: 16px;
    }
    .export-rule-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }
    .export-rule-head label {
      margin-top: 0;
    }
    .export-rule-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      justify-content: flex-end;
      min-width: 170px;
    }
    .export-rule-actions button.small {
      padding: 6px 11px;
      border-radius: 999px;
      font-size: 12px;
    }
    .export-advanced-panel {
      margin: 0 0 16px;
      padding: 12px 14px;
      border: 1px dashed rgba(184,117,76,.34);
      border-radius: 16px;
      background: rgba(255,250,240,.46);
    }
    .export-advanced-panel > summary {
      cursor: pointer;
      color: var(--clay-dark);
      font-weight: 900;
    }
    .export-advanced-panel > .muted {
      margin-top: 8px;
      margin-bottom: 12px;
      font-size: 13px;
    }
    .export-advanced-panel .export-grid {
      margin-top: 12px;
    }
    .export-inline-hint {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      word-break: break-all;
    }
    .export-filename-control {
      display: grid;
      gap: 6px;
    }
    .filename-preset-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-width: 0;
      max-width: 100%;
    }
    .filename-preset-row button.small {
      padding: 5px 9px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
    }
    .export-rule-panel textarea {
      width: 100%;
      min-height: 190px;
      max-height: none;
      overflow: hidden;
      font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
      line-height: 1.55;
      transition: background .16s ease, border-color .16s ease;
    }
    .export-rule-panel textarea[readonly] {
      background: rgba(255,255,255,.58);
      color: var(--muted);
    }
    .export-rule-panel textarea.editing {
      background: rgba(255,255,255,.92);
      border-color: rgba(174,96,58,.62);
    }
    .export-help {
      margin: 0 0 16px;
      padding: 12px 14px;
      border: 1px dashed rgba(184,117,76,.38);
      border-radius: 16px;
      background: rgba(255,250,240,.54);
    }
    .export-help summary {
      cursor: pointer;
      font-weight: 900;
      color: var(--clay-dark);
    }
    .export-help-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 10px;
      padding: 10px 12px;
      border: 1px solid rgba(205,158,107,.34);
      border-radius: 14px;
      background: rgba(255,255,255,.56);
    }
    .export-help-grid {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
      gap: 14px;
      margin-top: 12px;
    }
    .export-help h3 {
      margin: 8px 0;
      font-size: 15px;
    }
    .export-help pre {
      margin: 0;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: auto;
      background: rgba(255,255,255,.7);
      color: var(--ink);
      font-size: 12px;
      line-height: 1.55;
    }
    .export-help table,
    .export-field-reference table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .export-help th,
    .export-help td,
    .export-field-reference th,
    .export-field-reference td {
      text-align: left;
      vertical-align: top;
      padding: 7px 8px;
      border-bottom: 1px solid var(--border);
    }
    .export-field-reference {
      max-height: 320px;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: rgba(255,255,255,.54);
    }
    .rule-doc-page {
      width: min(100%, 1220px);
      max-width: calc(100vw - 48px);
      margin-inline: auto;
    }
    .rule-doc-layout {
      display: grid;
      grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
      gap: 22px;
      align-items: start;
      width: 100%;
      max-width: 100%;
    }
    .rule-doc-toc {
      position: sticky;
      top: 88px;
      min-width: 0;
      display: grid;
      gap: 8px;
      padding: 16px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: rgba(255,250,241,.82);
      box-shadow: 0 14px 28px rgba(72,48,28,.06);
    }
    .rule-doc-toc button,
    .rule-doc-toc a {
      border: 0;
      appearance: none;
      color: var(--ink);
      background: transparent;
      text-decoration: none;
      padding: 8px 10px;
      border-radius: 12px;
      text-align: left;
      font: inherit;
      cursor: pointer;
    }
    .rule-doc-toc button:hover,
    .rule-doc-toc a:hover {
      background: rgba(236,177,106,.18);
    }
    .rule-doc-toc button.active,
    .rule-doc-toc a.active {
      background: linear-gradient(135deg, rgba(240,160,127,.2), rgba(237,196,119,.26));
      color: #6f3f35;
      box-shadow: inset 3px 0 0 rgba(201,111,91,.68);
    }
    .rule-doc {
      display: grid;
      gap: 18px;
      min-width: 0;
      max-width: 100%;
    }
    .rule-doc section {
      min-width: 0;
      max-width: 100%;
      padding: 20px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: rgba(255,252,246,.8);
      overflow: hidden;
      scroll-margin-top: 96px;
    }
    .rule-doc h2 {
      margin: 0 0 10px;
      font-size: clamp(24px, 3vw, 34px);
    }
    .rule-doc h3 {
      margin: 12px 0 8px;
      color: var(--clay-dark);
    }
    .rule-doc p {
      margin: 0 0 12px;
      line-height: 1.75;
      color: var(--muted);
    }
    .rule-doc pre {
      max-width: 100%;
      margin: 10px 0 14px;
      padding: 14px;
      border: 1px solid rgba(205,158,107,.42);
      border-radius: 14px;
      overflow: auto;
      background: rgba(255,255,255,.78);
      color: var(--ink);
      line-height: 1.6;
    }
    .rule-doc code {
      font-family: "Iowan Old Style", "Times New Roman", serif;
    }
    .rule-doc table {
      width: 100%;
      max-width: 100%;
      border-collapse: collapse;
      font-size: 14px;
      background: rgba(255,255,255,.54);
      border-radius: 14px;
      overflow: hidden;
      table-layout: fixed;
    }
    .rule-doc th,
    .rule-doc td {
      text-align: left;
      vertical-align: top;
      padding: 9px 10px;
      border-bottom: 1px solid var(--border);
      overflow-wrap: anywhere;
    }
    .rule-doc th {
      width: 190px;
      color: var(--clay-dark);
      background: rgba(241,213,181,.22);
    }
    .rule-doc-grid,
    .rule-field-columns {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }
    .rule-doc-grid > *,
    .rule-field-columns > * {
      min-width: 0;
    }
    .export-output-editor {
      min-width: 0;
      overflow: hidden;
      padding: 14px;
      margin-bottom: 16px;
      border: 1px solid rgba(184,117,76,.22);
      border-radius: 18px;
      background: rgba(255,255,255,.44);
    }
    .panel-title.compact {
      margin-bottom: 10px;
    }
    .panel-title.compact h2,
    .panel-title.compact h3 {
      margin: 0;
    }
    .export-output-tabs {
      display: grid;
      gap: 7px;
    }
    .export-output-tab {
      display: flex;
      align-items: stretch;
      justify-content: space-between;
      gap: 0;
      overflow: hidden;
      width: 100%;
      padding: 0;
      border-color: rgba(184,117,76,.24);
      border-radius: 12px;
      background: rgba(255,255,255,.72);
      color: var(--ink);
      box-shadow: none;
    }
    .export-output-tab > span:first-child {
      flex: 1;
      padding: 8px 10px;
      text-align: left;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .export-output-tab.active {
      background: rgba(174,96,58,.12);
      border-color: rgba(174,96,58,.52);
      color: var(--clay-dark);
      font-weight: 900;
    }
    .export-output-remove {
      display: grid;
      place-items: center;
      min-width: 34px;
      padding: 0 10px;
      border-left: 1px solid rgba(184,117,76,.22);
      color: var(--muted);
      font-weight: 900;
    }
    .export-output-tab.active .export-output-remove {
      background: rgba(174,96,58,.08);
      color: var(--clay-dark);
    }
    .export-output-remove:hover {
      background: rgba(180,35,24,.08);
      color: #b42318;
    }
    .export-fieldset {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 18px;
      align-items: center;
      min-width: 0;
      overflow-x: auto;
      padding: 12px 14px;
      margin: 0 0 16px;
      border: 1px solid rgba(184,117,76,.22);
      border-radius: 16px;
      background: rgba(255,250,240,.68);
    }
    .export-field-head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 8px 12px;
      margin: 8px 0 8px;
    }
    .export-field-head strong {
      color: var(--ink);
      font-size: 15px;
    }
    .export-fieldset > div { flex: 1 1 100%; }
    .export-field-list {
      display: grid;
      gap: 14px;
      min-width: 0;
      width: 100%;
    }
    .export-field-group {
      display: grid;
      gap: 8px;
      align-items: start;
      padding: 10px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 14px;
      background: rgba(255,255,255,.34);
    }
    .export-field-group h3 {
      margin: 0;
      color: var(--clay-dark);
      font-size: 13px;
      letter-spacing: .04em;
    }
    .export-field-group-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
      gap: 8px;
      align-items: start;
      justify-content: start;
    }
    .export-field-item {
      display: inline-grid;
      grid-template-columns: 22px minmax(0, 1fr);
      align-items: start;
      justify-content: flex-start;
      gap: 8px;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: rgba(255,255,255,.62);
      color: var(--ink);
      font-weight: 700;
      box-shadow: none;
      text-align: left;
      width: 100%;
      min-height: 0;
      align-self: start;
    }
    .export-field-item.selected {
      border-color: rgba(174,96,58,.58);
      background: rgba(174,96,58,.10);
    }
    .field-order {
      display: grid;
      place-items: center;
      flex: 0 0 22px;
      width: 22px;
      height: 22px;
      border: 1px solid rgba(184,117,76,.28);
      border-radius: 999px;
      background: rgba(255,255,255,.7);
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
    }
    .export-field-item.selected .field-order {
      background: var(--clay);
      color: #fffaf0;
      border-color: var(--clay);
    }
    .field-text {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .field-label {
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .export-field-item code {
      color: var(--muted);
      font-size: 11px;
      font-weight: 500;
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .export-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
    .export-sidebar-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin: 0;
      margin-bottom: 0;
      padding: 12px 0 0;
      border-top: 1px solid rgba(184,117,76,.22);
      background: rgba(255,250,240,.82);
    }
    .export-sidebar-actions button {
      width: 100%;
      min-height: 42px;
    }
    .export-stats { margin-bottom: 12px; }
    .export-preview {
      display: grid;
      gap: 12px;
      min-width: 0;
      max-width: 100%;
    }
    .export-preview-card {
      min-width: 0;
      max-width: 100%;
      max-height: 520px;
      overflow: auto;
      overscroll-behavior: contain;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: rgba(255,255,255,.58);
    }
    .export-preview table { width: max-content; min-width: min(720px, calc(100vw - 72px)); border-collapse: collapse; font-size: 13px; }
    .export-preview th, .export-preview td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: clamp(160px, 24vw, 320px); overflow: hidden; text-overflow: ellipsis; }
    .export-preview th { background: var(--bg2); font-weight: 700; position: sticky; top: 0; }
    .export-preview pre {
      margin: 0;
      padding: 12px;
      border-radius: 12px;
      overflow: auto;
      background: #1f2421;
      color: #f5ead5;
      font-size: 12px;
      line-height: 1.55;
    }
    .export-file-browser {
      display: grid;
      gap: 12px;
      min-width: 0;
    }
    .export-file-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 14px;
      background: rgba(255,255,255,.54);
    }
    .export-file-breadcrumb {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }
    .export-file-breadcrumb span {
      color: var(--muted);
      font-weight: 700;
    }
    .export-file-breadcrumb button.small {
      padding: 5px 9px;
      border-radius: 999px;
      font-size: 12px;
    }
    .export-file-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      min-width: max-content;
    }
    .export-file-summary {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 8px 14px;
      padding: 0 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .export-file-list {
      display: grid;
      min-width: 0;
      max-width: 100%;
      max-height: 360px;
      overflow: auto;
      overscroll-behavior: contain;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(255,255,255,.66);
    }
    .export-file-row {
      display: grid;
      grid-template-columns: minmax(220px, 1.45fr) minmax(150px, .75fr) minmax(120px, .55fr) minmax(74px, .35fr);
      align-items: center;
      gap: 10px;
      min-width: min(760px, calc(100vw - 72px));
      width: 100%;
      padding: 8px 12px;
      border: 0;
      border-radius: 0;
      border-bottom: 1px solid rgba(216,204,186,.72);
      background: transparent;
      color: var(--ink);
      box-shadow: none;
      font-weight: 500;
      text-align: left;
    }
    .export-file-row.head {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #fff8eb;
      color: #5f5247;
      font-size: 13px;
      font-weight: 900;
      cursor: default;
    }
    button.export-file-row {
      cursor: default;
    }
    button.export-file-row:hover {
      background: rgba(240,160,127,.12);
      filter: none;
    }
    button.export-file-row.active {
      background: rgba(240,160,127,.22);
      outline: 1px solid rgba(201,111,91,.42);
      outline-offset: -1px;
    }
    .export-file-row span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .export-file-name {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-weight: 700;
    }
    .file-icon {
      position: relative;
      flex: 0 0 22px;
      width: 22px;
      height: 18px;
    }
    .file-icon.folder::before {
      content: "";
      position: absolute;
      left: 1px;
      top: 5px;
      width: 20px;
      height: 12px;
      border: 1px solid #d8a54f;
      border-radius: 3px;
      background: linear-gradient(180deg, #f5cf70, #e7ad45);
      box-shadow: inset 0 1px rgba(255,255,255,.45);
    }
    .file-icon.folder::after {
      content: "";
      position: absolute;
      left: 2px;
      top: 2px;
      width: 9px;
      height: 5px;
      border: 1px solid #d8a54f;
      border-bottom: 0;
      border-radius: 3px 3px 0 0;
      background: #f2c967;
    }
    .file-icon.file::before {
      content: "";
      position: absolute;
      left: 4px;
      top: 1px;
      width: 13px;
      height: 16px;
      border: 1px solid #b8b0a5;
      border-radius: 2px;
      background: linear-gradient(135deg, #fff 0 74%, #ece2d2 75%);
      box-shadow: 0 1px 2px rgba(80,58,41,.10);
    }
    .file-icon.file::after {
      content: "";
      position: absolute;
      left: 7px;
      top: 6px;
      width: 8px;
      height: 1px;
      background: #c9bda9;
      box-shadow: 0 4px 0 #c9bda9;
    }
    .export-file-detail {
      min-width: 0;
      max-width: 100%;
      min-height: 160px;
      max-height: 520px;
      overflow: auto;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: rgba(255,255,255,.58);
    }
    .export-file-detail .panel-title.compact {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px 12px;
      justify-content: space-between;
    }
    .export-file-detail .panel-title.compact h3 {
      flex: 1 1 auto;
      min-width: 170px;
      overflow-wrap: anywhere;
    }
    .export-file-path {
      margin: -2px 0 10px;
      padding: 6px 9px;
      border: 1px dashed rgba(184,117,76,.24);
      border-radius: 10px;
      color: var(--muted);
      background: rgba(255,250,240,.58);
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    .export-file-detail .panel-title.compact .muted {
      flex: 0 1 auto;
    }
    .export-material-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }
    .export-material-layout > * {
      min-width: 0;
    }
    .export-material-sidebar {
      position: sticky;
      top: 86px;
      display: grid;
      gap: 10px;
      max-height: calc(100vh - 106px);
      overflow-y: auto;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: rgba(255, 250, 240, .74);
      min-width: 0;
    }
    .export-material-sidebar h2 {
      margin: 0;
    }
    .export-material-sidebar input,
    .export-material-sidebar select {
      width: 100%;
    }
    .material-search-wrap {
      position: relative;
      min-width: 0;
      z-index: 6;
    }
    #materialExportRecordSelect {
      min-height: 0;
    }
    .material-record-select {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 8px);
      z-index: 12;
      display: grid;
      align-content: start;
      gap: 6px;
      max-height: min(300px, calc(100vh - 260px));
      overflow-y: scroll;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255,255,255,.96);
      box-shadow: 0 16px 34px rgba(72,48,28,.14);
      scrollbar-gutter: stable;
    }
    .material-record-option {
      display: grid;
      gap: 3px;
      width: 100%;
      padding: 8px 9px;
      border: 1px solid rgba(184,117,76,.18);
      border-radius: 10px;
      background: rgba(255,255,255,.74);
      box-shadow: none;
      color: var(--ink);
      text-align: left;
    }
    .material-record-option:hover {
      border-color: rgba(201,111,91,.34);
      background: rgba(255,250,240,.92);
    }
    .material-record-option.active {
      border-color: rgba(201,111,91,.62);
      background: rgba(240,160,127,.16);
      color: var(--clay-dark);
    }
    .material-record-option strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
      line-height: 1.25;
    }
    .material-record-option span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.25;
    }
    .export-actions.vertical {
      display: grid;
      gap: 8px;
      margin: 4px 0;
    }
    .export-material-main {
      min-width: 0;
      width: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
    }
    .material-export-content {
      display: grid;
      gap: 14px;
      margin-bottom: 16px;
    }
    .material-record-card {
      padding: 14px;
      border: 1px solid rgba(184,117,76,.22);
      border-radius: 18px;
      background: rgba(255,255,255,.46);
    }
    .material-field-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 8px;
    }
    .material-field {
      display: flex;
      align-items: center;
      gap: 9px;
      min-height: 62px;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(255,255,255,.68);
      color: var(--ink);
      text-align: left;
      box-shadow: none;
    }
    .material-field.selected {
      border-color: rgba(201,111,91,.58);
      background: rgba(240,160,127,.18);
    }
    .material-field-text {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .material-field-text small {
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .material-field code {
      margin-left: auto;
      color: var(--muted);
      font-size: 11px;
      font-weight: 500;
    }
    .material-segment-list {
      display: grid;
      gap: 8px;
      max-height: 520px;
      overflow: auto;
    }
    .material-segment {
      display: grid;
      gap: 5px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(255,255,255,.58);
    }
    .material-segment.selected {
      border-color: rgba(201,111,91,.58);
      background: rgba(240,160,127,.14);
    }
    .viewer-segment-actions {
      display: grid;
      gap: 6px;
      justify-items: end;
      align-content: start;
      text-align: right;
    }
    @media (max-width: 1080px) {
      .export-workspace,
      .export-output-layout,
      .export-material-layout,
      .export-rule-panel,
      .export-help-grid,
      .rule-doc-layout,
      .rule-doc-grid,
      .rule-field-columns {
        grid-template-columns: 1fr;
      }
      .export-sidebar,
      .export-material-sidebar,
      .rule-doc-toc {
        position: static;
      }
      .export-help-toolbar {
        align-items: stretch;
        flex-direction: column;
      }
      .export-plan-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .export-rule-head,
      .export-file-toolbar,
      .export-ai-head,
      .export-ai-compose {
        align-items: stretch;
        flex-direction: column;
      }
      .export-ai-actions {
        flex: 1 1 auto;
        width: 100%;
      }
      .export-rule-actions {
        justify-content: flex-start;
        min-width: 0;
      }
      .export-main-fields {
        grid-template-columns: 1fr;
      }
    }
    @media (max-width: 520px) {
      #page-export {
        margin-left: -8px;
        margin-right: -8px;
      }
      #page-export > .panel,
      .export-plan-panel,
      .export-ai-panel,
      .export-output-editor,
      .export-filename-column,
      .export-main-fields {
        padding-left: 10px;
        padding-right: 10px;
      }
      .export-plan-summary {
        grid-template-columns: 1fr;
      }
      .export-preview table {
        min-width: 620px;
      }
    }

    /* Export configuration pages */
    #page-export > .panel { overflow: visible; }
    #page-export .export-step-pane[hidden] { display: none; }
    #page-export .export-step-tabs {
      display: flex;
      gap: 4px;
      padding-bottom: 10px;
      margin-bottom: 18px;
      border-bottom: 1px solid var(--border);
    }
    #page-export .export-step-tabs button {
      flex: 1;
      padding: 10px 8px;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: var(--muted);
      box-shadow: none;
    }
    #page-export .export-step-tabs button.active {
      color: #315a60;
      background: rgba(95,150,148,.14);
    }
    #page-export .export-sidebar {
      grid-template-rows: auto;
      max-height: none;
      overflow: visible;
    }
    #page-export .export-sidebar-scroll { overflow: visible; }
    .export-template-options { margin: 6px 0; }
    .export-scope { display: grid; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
    .export-template-options summary,
    .export-file-options > summary,
    .export-ai-disclosure > summary { cursor: pointer; color: var(--ink); font-weight: 700; }
    .export-template-options .export-mini-actions { margin-top: 10px; }
    .export-template-options .muted { font-size: 12px; margin-top: 6px; }
    .export-ai-disclosure { margin-bottom: 18px; }
    .export-ai-disclosure > summary { padding: 10px 0; }
    .export-ai-disclosure > summary .muted { margin-left: 12px; font-size: 12px; font-weight: 400; }
    .export-file-options { margin: 0 0 20px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
    .export-file-options > summary { font-size: 13px; }
    .export-file-options > summary .muted { margin-left: 12px; font-weight: 400; }
    .export-file-options .filename-preset-row { margin: 14px 0; }
    #page-export .export-ai-panel { margin: 8px 0 0; box-shadow: none; }
    #page-export .export-output-editor,
    #page-export .export-advanced-panel {
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
    }
    #page-export .export-output-layout { grid-template-columns: 1fr; }
    #page-export .export-filename-column,
    #page-export .export-main-fields {
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    #page-export .export-main-fields { grid-template-columns: 1fr 1fr; }
    .export-field-tools { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
    .export-field-tools > input { flex: 1; width: 0; }
    #page-export .export-selected-toggle { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: 13px; }
    #page-export .export-selected-toggle input { width: 16px; height: 16px; margin: 0; }
    #page-export .export-fieldset {
      display: block;
      max-height: 410px;
      overflow: auto;
      padding: 0;
      border-radius: 8px;
      background: rgba(255,255,255,.38);
      scrollbar-gutter: stable;
    }
    #page-export .export-field-list { gap: 0; }
    #page-export .export-field-group { gap: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
    #page-export .export-field-group h3 { padding: 9px 12px; background: rgba(95,150,148,.08); color: var(--muted); font-weight: 600; }
    #page-export .export-field-group-grid { grid-template-columns: 1fr 1fr; gap: 0; }
    #page-export .export-field-item { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 9px 12px; background: transparent; }
    #page-export .export-field-item.selected { background: rgba(95,150,148,.09); }
    #page-export .export-field-item .field-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
    #page-export .export-field-item code { font-size: 11px; opacity: .7; overflow-wrap: anywhere; }
    .export-runbar {
      position: sticky;
      bottom: 12px;
      z-index: 12;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 20px;
      padding: 12px 16px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fffaf1;
      box-shadow: 0 4px 16px rgba(42,55,58,.08);
    }
    #page-export .export-runbar .export-stats { margin: 0; min-width: 0; overflow-wrap: anywhere; }
    .export-runbar .export-actions { display: flex; flex-shrink: 0; gap: 8px; margin: 0; }
    #page-export .export-plan-summary { grid-template-columns: 1fr 1fr; }
    #page-export .export-plan-panel { padding: 0 0 16px; border: 0; background: transparent; box-shadow: none; }
    #page-export .export-plan-card { background: rgba(95,150,148,.06); border: 0; border-radius: 8px; }
    @media (max-width: 1080px) {
      #page-export .export-sidebar-scroll { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 8px 14px; max-height: none; overflow: visible; }
      #page-export .export-sidebar-scroll > label { grid-column: 1 / -1; margin: 0; }
      #page-export .export-scope { grid-column: 1 / -1; }
      #page-export .export-sidebar-section { grid-column: 1 / -1; }
      #page-export .export-output-tabs { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
      #page-export .export-sidebar-scroll > select:not(.sr-only) { grid-column: 1 / -1; }
      #page-export .export-template-options { margin: 0; }
    }
    @media (max-width: 600px) {
      #page-export .export-output-layout,
      #page-export .export-main-fields,
      #page-export .export-field-group-grid { grid-template-columns: 1fr; }
      #page-export .export-fieldset { max-height: 360px; }
      .export-ai-disclosure > summary .muted { display: none; }
      .export-file-options > summary .muted { display: none; }
      .export-runbar { flex-wrap: wrap; bottom: 6px; padding: 10px; }
      .export-runbar .export-actions { width: 100%; }
      .export-runbar .export-actions button { flex: 1; }
      #page-export .export-plan-summary { grid-template-columns: 1fr; }
      #page-export .export-step-tabs button { font-size: 13px; }
    }

    /* Workbench toolbar */
    .workbench-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      padding: 10px 14px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255,255,255,.4);
    }
    .workbench-locked #totalText,
    .workbench-locked #segmentList {
      position: relative;
      pointer-events: none;
      user-select: none;
    }
    .workbench-locked #totalText::after,
    .workbench-locked #segmentList::after {
      position: absolute;
      inset: 0;
      z-index: 12;
      display: grid;
      place-items: center;
      border-radius: 18px;
      background: rgba(29,37,34,.28);
      color: #fffaf0;
      font-weight: 900;
      letter-spacing: .08em;
      text-shadow: 0 1px 2px rgba(0,0,0,.28);
    }
    .workbench-locked #totalText::after {
      content: "正在重新识别，总稿暂时锁定";
    }
    .workbench-locked #segmentList::after {
      content: "正在重新识别，句段暂时锁定";
    }
    .toolbar-group {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-right: 1px solid var(--line);
    }
    .toolbar-group:last-child { border-right: none; }
    .toolbar-label {
      font-size: 11px;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .toolbar-group .time-inputs { gap: 2px; }
    .toolbar-group .time-inputs input { width: 36px; padding: 4px 2px; font-size: 12px; text-align: center; }
    .toolbar-group .time-inputs span { font-size: 12px; }

    /* Progress bar */
    .progress-bar {
      position: relative;
      height: 34px;
      margin-top: 12px;
      border-radius: 999px;
      background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(235,244,239,.78));
      border: 1px solid rgba(52,84,86,.16);
      overflow: hidden;
      box-shadow: inset 0 1px 6px rgba(29,37,34,.08), 0 10px 24px rgba(49,90,96,.08);
    }
    .progress-fill {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, #39676c, #6ea7a0, #8fb9ad);
      background-size: 220% 100%;
      transition: width .4s ease;
      animation: progressFlow 2.4s linear infinite;
    }
    .progress-fill.indeterminate {
      width: 100%;
      background: linear-gradient(90deg, rgba(57,103,108,.24), rgba(110,167,160,.82), rgba(57,103,108,.24));
      background-size: 200% 100%;
      animation: shimmer 1.35s infinite;
    }
    .progress-fill.done {
      background: linear-gradient(90deg, #39676c, #6ea7a0);
      animation: none;
    }
    .progress-fill.failed {
      background: linear-gradient(90deg, #d96b73, #e8a0a1);
      animation: none;
    }
    @keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
    @keyframes progressFlow { 0%{background-position:0 0} 100%{background-position:220% 0} }
    .progress-text {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
      color: var(--ink);
      padding: 0 14px;
      text-align: center;
      text-shadow: 0 1px 0 rgba(255,255,255,.55);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .progress-steps {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin-top: 8px;
    }
    .progress-steps span {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 28px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: rgba(255,255,255,.58);
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
    }
    .progress-steps span.done {
      border-color: rgba(220,164,95,.55);
      background: rgba(237,196,119,.28);
      color: #6f4a1d;
    }
    .progress-steps span.active {
      border-color: rgba(201,111,91,.55);
      background: rgba(248,221,206,.7);
      color: #7c3f35;
    }
    .progress-steps span.failed {
      border-color: rgba(217,107,115,.55);
      background: rgba(232,160,161,.24);
      color: #9f4b55;
    }

    /* Segment status styles */
    .segment-field-rail {
      position: absolute;
      left: -1px;
      top: -1px;
      bottom: -1px;
      width: 6px;
      display: grid;
      grid-template-rows: repeat(3, 1fr);
      gap: 0;
      overflow: hidden;
      border-radius: 8px 0 0 8px;
    }
    .segment-field-rail .rail-part {
      display: block;
      border-radius: 0;
      background: #cc5b55;
      box-shadow: inset 0 -1px 0 rgba(255,255,255,.55);
    }
    .segment-field-rail .rail-part.saved { background: #d8aa4e; }
    .segment-field-rail .rail-part.verified { background: #2a9d5c; }
    .step-hint {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
    }
    .step-hint.good { color: #2a9d5c; }

    /* Dirty save button (text modified but not saved) */
    @keyframes pulse-save { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }

    /* Verified segment button */
    .verify-segment.verified-done {
      color: #1a6b3f;
      border-color: rgba(39,139,87,.3);
      background: rgba(39,139,87,.08);
      cursor: default;
    }


    /* Split mode in total text */
    .total-text.split-mode { cursor: crosshair; line-height: 2.4; }
    .total-text.split-mode .split-char {
      cursor: crosshair;
      display: inline-block;
      position: relative;
      padding: 2px 1px;
    }
    .total-text.split-mode .split-char::after {
      content: '';
      position: absolute;
      right: -1.5px;
      top: 2px;
      bottom: 2px;
      width: 0;
      border-right: 2px dashed transparent;
      transition: border-color .15s;
      pointer-events: none;
      z-index: 1;
    }
    .total-text.split-mode .split-char:hover::after {
      border-right-color: var(--lacquer);
    }
    .total-text.split-mode .split-char:hover {
      color: var(--lacquer);
    }
    .total-text.split-mode .split-char:last-child::after {
      display: none;  /* no split after last char of segment */
    }
    .split-divider {
      color: var(--sand);
      padding: 0 4px;
      font-weight: 400;
      opacity: .6;
    }
    .split-time-tip {
      position: fixed;
      pointer-events: none;
      background: var(--lacquer);
      color: #fff;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 12px;
      white-space: nowrap;
      z-index: 9999;
      transform: translateY(-110%);
      opacity: 0;
      transition: opacity .12s;
    }
    .split-time-tip.visible { opacity: 1; }
    #totalSplitMode.active {
      background: var(--lacquer);
      color: #fff;
      border-color: transparent;
    }

    /* ====== Ink loading overlay — Minnan scene ====== */
    .ink-loading-overlay {
      position: absolute;
      inset: 0;
      z-index: 12;
      background: rgba(255,252,247,.94);
      -webkit-backdrop-filter: blur(3px);
      backdrop-filter: blur(3px);
      border-radius: 22px;
      opacity: 0;
      pointer-events: none;
      transition: opacity .3s;
      overflow: hidden;
    }
    .ink-loading-overlay.active { opacity: 1; pointer-events: auto; }

    /* --- Top: 燕尾脊 roof silhouette --- */
    .ink-roof {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: min(60%, 280px);
      height: auto;
      animation: roofFloat 4s ease-in-out infinite;
    }
    @keyframes roofFloat {
      0%, 100% { transform: translateX(-50%) translateY(0); }
      50%      { transform: translateX(-50%) translateY(-3px); }
    }

    /* --- Left & right: ink drops --- */
    .ink-drop {
      position: absolute;
      border-radius: 50%;
      background: radial-gradient(circle, var(--lacquer) 0%, rgba(169,61,45,.2) 55%, transparent 75%);
      opacity: 0;
    }
    .ink-drop-a {
      width: 60px; height: 60px;
      top: 30%; left: 8%;
      animation: inkBloom 3s ease-out infinite;
    }
    .ink-drop-b {
      width: 48px; height: 48px;
      top: 25%; right: 10%;
      animation: inkBloom 3s ease-out 1.5s infinite;
    }
    @keyframes inkBloom {
      0%   { transform: scale(.1); opacity: .7; }
      40%  { transform: scale(1.1); opacity: .22; }
      100% { transform: scale(1.8); opacity: 0; }
    }

    /* --- Center: text --- */
    .ink-center {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      white-space: nowrap;
    }
    .ink-loading-overlay .ink-text {
      color: var(--lacquer);
      font-size: 16px;
      font-weight: 600;
      letter-spacing: 4px;
      animation: textBreath 2.2s ease-in-out infinite;
    }
    .ink-loading-overlay .ink-sub {
      margin-top: 6px;
      color: var(--sea-dark);
      font-size: 13px;
      opacity: .6;
      letter-spacing: 1.5px;
      transition: opacity .3s;
    }
    @keyframes textBreath {
      0%, 100% { opacity: 1; }
      50%      { opacity: .4; }
    }

    /* --- Lower sides: brush strokes --- */
    .ink-stroke {
      position: absolute;
      bottom: 28%;
      height: 2.5px;
      border-radius: 2px;
      background: linear-gradient(90deg, transparent, var(--lacquer), transparent);
      opacity: 0;
    }
    .ink-stroke-left {
      left: 5%;
      width: 22%;
      animation: strokeLeft 3s ease-in-out infinite;
    }
    .ink-stroke-right {
      right: 5%;
      width: 22%;
      animation: strokeRight 3s ease-in-out 1.5s infinite;
    }
    @keyframes strokeLeft {
      0%   { width: 0; left: 5%; opacity: 0; }
      30%  { width: 22%; opacity: .4; }
      70%  { opacity: .4; }
      100% { width: 22%; left: 5%; opacity: 0; }
    }
    @keyframes strokeRight {
      0%   { width: 0; right: 5%; opacity: 0; }
      30%  { width: 22%; opacity: .4; }
      70%  { opacity: .4; }
      100% { width: 22%; right: 5%; opacity: 0; }
    }

    /* --- Bottom: sea waves --- */
    .ink-waves {
      position: absolute;
      bottom: 0; left: 0;
      width: 100%; height: 36px;
    }
    .ink-waves .wave-a {
      fill: rgba(74,124,130,.10);
      transform-origin: center bottom;
      animation: waveSway1 3.2s ease-in-out infinite;
    }
    .ink-waves .wave-b {
      fill: rgba(74,124,130,.06);
      transform-origin: center bottom;
      animation: waveSway2 3.8s ease-in-out infinite;
    }
    @keyframes waveSway1 {
      0%, 100% { transform: translateX(0) scaleY(1); }
      50%      { transform: translateX(-6px) scaleY(1.12); }
    }
    @keyframes waveSway2 {
      0%, 100% { transform: translateX(0) scaleY(1); }
      50%      { transform: translateX(6px) scaleY(.88); }
    }

    /* --- Corner glyphs --- */
    .ink-loading-overlay::before {
      content: '泉';
      position: absolute;
      top: 10px; right: 16px;
      font-size: 56px;
      font-weight: 900;
      color: rgba(169,61,45,.04);
      pointer-events: none;
      animation: glyphFloat 7s ease-in-out infinite;
    }
    .ink-loading-overlay::after {
      content: '声';
      position: absolute;
      bottom: 36px; left: 16px;
      font-size: 48px;
      font-weight: 900;
      color: rgba(74,124,130,.04);
      pointer-events: none;
      animation: glyphFloat 7s ease-in-out 3.5s infinite;
    }
    @keyframes glyphFloat {
      0%, 100% { transform: translateY(0); }
      50%      { transform: translateY(-5px); }
    }

    /* Theme refresh: quiet bamboo-slip surface, teal controls, no yellow buttons. */
    .local-path-import,
    .timeline,
    .toolbar,
    .candidate-popover,
    .export-menu,
    .export-sidebar,
    .export-material-sidebar,
    .export-plan-panel,
    .export-ai-panel,
    .export-output-editor,
    .export-filename-column,
    .export-main-fields,
    .export-rule-panel,
    .export-help-card,
    .export-file-detail,
    .export-file-row,
    .rule-doc-toc,
    .rule-doc-section,
    .settings-help-list > div,
    .settings-config-row,
    .taxonomy-editor-section,
    .taxonomy-card,
    .taxonomy-batch-panel,
    .phrase-rule-row,
    .resource-audit-card,
    .resource-audit-stats span {
      border-color: rgba(52,84,86,.16) !important;
      background-color: rgba(255,253,248,.72);
    }
    .export-main-fields,
    .export-filename-column,
    .export-output-editor,
    .export-ai-panel,
    .export-plan-panel,
    .settings-section,
    .taxonomy-editor-section,
    .phrase-rule-row {
      background-image:
        repeating-linear-gradient(90deg, rgba(49,90,96,.022) 0 1px, transparent 1px 38px),
        linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
    }
    details,
    summary,
    .export-advanced,
    .export-advanced-panel,
    .export-advanced-panel > summary,
    .export-rule-advanced,
    .export-output-editor details,
    .export-output-editor summary {
      border-color: rgba(52,84,86,.18) !important;
    }
    .export-advanced-panel > summary,
    .export-advanced-panel > .muted {
      color: #315a60 !important;
    }
    .theme-select-button,
    .theme-select-menu {
      border-color: rgba(52,84,86,.18) !important;
      background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,252,249,.9)) !important;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 18px rgba(42,55,58,.04) !important;
    }
    .theme-select-button:hover,
    .theme-select-button:focus-visible,
    .theme-select.open .theme-select-button {
      border-color: rgba(95,150,148,.58) !important;
      box-shadow: 0 0 0 3px rgba(95,150,148,.14), inset 0 1px 0 rgba(255,255,255,.78) !important;
    }
    .theme-select-caret {
      border-top-color: #315a60 !important;
    }
    .export-menu button:hover,
    button.export-file-row:hover,
    button.export-file-row.active,
    .mapping-row:hover,
    .mapping-row.active,
    .candidate-popover button:hover,
    .settings-config-row.active,
    .taxonomy-editor-section.editing,
    .taxonomy-card:hover,
    .phrase-rule-row:hover {
      border-color: rgba(95,150,148,.28) !important;
      background-color: rgba(95,150,148,.1) !important;
    }
    .export-mode-tabs,
    .export-quick-actions,
    .export-rule-actions,
    .export-mini-actions,
    .export-preview-limit-control,
    .export-fieldset,
    .export-field-list,
    .export-field-group,
    .export-field-item,
    .rule-doc-toc button,
    .pagination button,
    .filename-preset-row button.small {
      border-color: rgba(52,84,86,.16) !important;
    }
    .export-preview-limit-control,
    .export-fieldset,
    .export-field-head {
      border-top-color: rgba(52,84,86,.16) !important;
    }
    .export-mode-tabs button.active,
    .pagination button.active,
    .rule-doc-toc button.active,
    .timeline-tool.active {
      background: linear-gradient(135deg, #39676c, #6ea7a0) !important;
      color: #fffdf8 !important;
      border-color: transparent !important;
      box-shadow: 0 10px 22px rgba(49,90,96,.16) !important;
    }
    .phrase-rule-meta span {
      border-color: rgba(52,84,86,.14);
      background: rgba(255,255,255,.58);
    }
    .phrase-rule-status.pending,
    .resource-audit-card.available .resource-audit-status {
      color: #315a60;
      background: rgba(95,150,148,.16);
    }
    .resource-audit-card.available {
      border-color: rgba(95,150,148,.28);
      background: rgba(245,251,247,.68);
    }
    .delete-archive:hover,
    .danger-lite,
    .phrase-rule-status.disabled,
    .resource-audit-card.missing .resource-audit-status {
      color: #8f4d43;
    }

    .record-quality-layout { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
    .record-quality-layout > .record-quality-summary { flex: 1 1 420px; min-width: 0; }
    .record-management-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
    #page-export .export-main, #page-export .export-material-main { padding: 0; min-width: 0; }
    .export-setup, .export-material-controls {
      display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center;
      gap: 12px 18px; padding: 18px; margin-bottom: 18px;
      border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
    }
    .export-setup > *, .export-material-controls > * { min-width: 0; }
    .export-setup > :is(.export-scope, details, .export-sidebar-section),
    .export-material-controls > :is(.muted, .export-actions) { grid-column: 1 / -1; }
    .export-material-controls .export-actions { display: flex; flex-direction: row; gap: 8px; margin: 4px 0; }
    .export-material-controls .material-export-actions button { min-width: 86px; }
    .export-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
    .export-heading h1 { margin: 0; }
    #page-export .export-heading .export-mode-tabs {
      flex-wrap: nowrap; gap: 2px; padding: 3px; margin: 0;
      border: 1px solid var(--line); border-radius: 999px;
    }
    #page-export .export-heading .export-mode-tabs button {
      min-height: 0; padding: 5px 12px; border: 0; border-radius: 999px;
      font-size: 13px; line-height: 20px; box-shadow: none !important;
    }
    button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
    button.is-loading::before {
      content: ""; width: 12px; height: 12px; flex: 0 0 12px;
      border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
      animation: export-loading-spin .8s linear infinite;
    }
    @keyframes export-loading-spin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) {
      button.is-loading::before { animation-duration: 2s; }
    }
    .export-preview-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
    .export-preview-actions .export-stats { flex: 1 1 260px; }
    .export-preview-actions .export-actions { display: flex; gap: 8px; }
    @media (max-width: 600px) {
      .export-setup, .export-material-controls { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 8px; }
      .record-management-actions { margin-left: 0; }
    }
    @media (max-width: 980px) {
      .topnav { grid-template-columns: 1fr; }
      .grid-2, .grid-3, .grid-4, .workbench-stack, .audio-stage, .search-grid, .segment-body, .segment-body.tri-col, .viewer-segment, .stats-detail-grid { grid-template-columns: 1fr; }
      .stat-section-head {
        flex-direction: column;
        align-items: flex-start;
      }
      .stat-section-head h3 {
        min-width: 0;
      }
      .ai-config-grid,
      .ai-control-row,
      .phrase-rule-toolbar,
      .phrase-rule-row {
        grid-template-columns: 1fr;
      }
      main { padding: 16px; }
    }
