:root {
  color-scheme: light;
  --ink: #15253d;
  --muted: #617085;
  --subtle: #8b97a8;
  --line: #dfe6ed;
  --line-strong: #cbd5df;
  --surface: #ffffff;
  --surface-soft: #f4f7f9;
  --canvas: #eef3f5;
  --navy: #102945;
  --navy-2: #183d62;
  --teal: #0c8f8b;
  --teal-dark: #08726f;
  --teal-soft: #e1f5f2;
  --blue-soft: #e8f1fc;
  --blue: #2e70b8;
  --amber: #a76408;
  --amber-soft: #fff2d9;
  --red: #b93a42;
  --red-soft: #fce9eb;
  --green: #237c59;
  --green-soft: #e5f5ed;
  --shadow: 0 12px 32px rgba(21, 37, 61, .08);
  --shadow-lg: 0 28px 70px rgba(8, 25, 43, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(12, 143, 139, .2);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% -5%, rgba(12, 143, 139, .08), transparent 25rem),
    var(--canvas);
  font-size: 15px;
  line-height: 1.55;
}

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .55rem; font-size: clamp(1.9rem, 3vw, 2.55rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { margin-bottom: .35rem; font-size: 1.18rem; line-height: 1.3; letter-spacing: -.015em; }
p { color: var(--muted); }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 8px 12px;
  color: #fff;
  background: var(--navy);
  border-radius: 6px;
}
.skip-link:focus { transform: none; }

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

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(203, 213, 223, .85);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--teal), #0f6f81);
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(12, 143, 139, .25);
  font-size: 20px;
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .7rem; }
.brand-light { color: #fff; }
.brand-light small { color: rgba(255,255,255,.65); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { padding: 8px 12px; color: var(--muted); font-weight: 650; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--surface-soft); text-decoration: none; }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 40px 0 64px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading p:last-child { max-width: 720px; margin-bottom: 0; }
.eyebrow { margin-bottom: 7px; color: var(--teal-dark); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  transition: transform .15s, background-color .15s, border-color .15s, box-shadow .15s;
}
.button:hover { border-color: #9daaba; text-decoration: none; transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, .link-button:focus-visible, input:focus-visible, select:focus-visible, .drop-zone:focus-visible, [role="tab"]:focus-visible { outline: none; box-shadow: var(--focus); }
.button:disabled { opacity: .52; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 8px 20px rgba(12, 143, 139, .18); }
.button-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button-secondary { background: #fff; }
.button-ghost { color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
.button-ghost:hover { background: var(--surface-soft); border-color: transparent; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f0c5c9; }
.button-small { min-height: 36px; padding: 7px 11px; font-size: .84rem; }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-spinner { display: inline-block; }

input, select {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}
input::placeholder { color: #9aa6b5; }
input:focus, select:focus { border-color: var(--teal); }
input:disabled, select:disabled { color: var(--muted); background: var(--surface-soft); }

.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 6px; font-weight: 750; }
.field small { display: block; margin-top: 5px; color: var(--subtle); }
.field-inline { display: grid; grid-template-columns: 120px 1fr; align-items: center; margin: 18px 0; }
.field-inline label { margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.panel-heading-wrap { flex-wrap: wrap; }

.badge, .status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge-neutral { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); }
.status-pill::before { width: 7px; height: 7px; margin-right: 6px; background: currentColor; border-radius: 50%; content: ""; }
.status-queued, .status-uploading { color: var(--blue); background: var(--blue-soft); }
.status-probe_queued, .status-probing, .status-asr_running, .status-asr_queued, .status-asr_completed, .status-transcribing, .status-translating, .status-polishing, .status-processing { color: var(--amber); background: var(--amber-soft); }
.status-completed, .status-complete, .status-succeeded { color: var(--green); background: var(--green-soft); }
.status-failed, .status-error, .status-cancelled { color: var(--red); background: var(--red-soft); }

.form-message { margin: 10px 0; padding: 10px 12px; border-radius: 8px; font-size: .88rem; }
.form-message-error { color: #8e2830; background: var(--red-soft); border: 1px solid #f0c5c9; }
.form-message-success { color: #176744; background: #e8f5ee; border: 1px solid #b9dfca; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0 0 24px; padding: 16px 18px; border-radius: var(--radius-sm); }
.alert::before { grid-row: 1 / 3; font-weight: 900; content: "!"; }
.alert strong, .alert p { margin: 0; }
.alert-error { color: #8e2830; background: var(--red-soft); border: 1px solid #f1c7cb; }
.alert-error p { color: #9b444b; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(390px, calc(100% - 44px)); }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 15px; color: #fff; background: var(--navy); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; }
.toast p { margin: 0; color: #fff; }
.toast button { padding: 0; color: rgba(255,255,255,.75); background: transparent; border: 0; cursor: pointer; font-size: 1.2rem; }
.toast-error { background: #8e2830; }
.toast-success { background: #176744; }

/* Public landing page */
.landing-page { background: #f8fbfa; }
.landing-shell { min-height: 100vh; overflow: hidden; background: radial-gradient(circle at 84% 7%, rgba(12,143,139,.12), transparent 26rem), linear-gradient(180deg, #fbfdfc 0, #f5f9f8 58%, #fff 100%); }
.landing-header { display: flex; width: min(1180px, calc(100% - 40px)); min-height: 80px; align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto; }
.landing-nav { display: flex; align-items: center; gap: 8px; }
.landing-nav > a:not(.button) { padding: 8px 11px; color: var(--muted); font-weight: 700; }
.landing-nav > a:not(.button):hover { color: var(--ink); text-decoration: none; }
.landing-hero { display: grid; width: min(1180px, calc(100% - 40px)); min-height: 610px; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr); align-items: center; gap: clamp(48px, 8vw, 100px); margin: 0 auto; padding: 76px 0 96px; }
.landing-hero-copy h1 { max-width: 690px; margin-bottom: 24px; font-size: clamp(2.7rem, 5.3vw, 5rem); line-height: 1.03; letter-spacing: -.055em; }
.landing-lead { max-width: 650px; margin-bottom: 29px; font-size: 1.08rem; line-height: 1.8; }
.landing-actions { margin-bottom: 28px; }
.landing-points { display: flex; flex-wrap: wrap; gap: 11px 24px; padding: 0; margin: 0; list-style: none; }
.landing-points li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.landing-points li::before { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; content: ""; }
.landing-preview { position: relative; padding: 24px; background: rgba(255,255,255,.94); border: 1px solid rgba(203,213,223,.9); border-radius: 22px; box-shadow: 0 28px 70px rgba(16,41,69,.15); }
.landing-preview::before { position: absolute; z-index: -1; right: -42px; bottom: -42px; width: 170px; height: 170px; background: var(--teal); border-radius: 38px; content: ""; opacity: .12; transform: rotate(14deg); }
.landing-preview-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; color: var(--subtle); border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.landing-preview-head > div { display: flex; gap: 6px; }
.preview-dot { width: 7px; height: 7px; background: var(--line-strong); border-radius: 50%; }
.preview-dot:first-child { background: #ef8787; }
.preview-dot:nth-child(2) { background: #e6bf65; }
.preview-dot:nth-child(3) { background: #65bd99; }
.preview-file { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.preview-file-icon { display: grid; width: 45px; height: 45px; place-items: center; color: #fff; background: var(--navy-2); border-radius: 10px; font-size: .66rem; font-weight: 900; }
.preview-file strong, .preview-file small { display: block; }
.preview-file small { margin-top: 2px; color: var(--subtle); }
.preview-steps { display: grid; gap: 0; padding: 17px 0 13px; margin: 0; list-style: none; }
.preview-steps li { position: relative; display: grid; grid-template-columns: 31px 1fr; gap: 12px; padding: 8px 0; }
.preview-steps li::after { position: absolute; top: 39px; bottom: -8px; left: 15px; width: 1px; background: var(--line); content: ""; }
.preview-steps li:last-child::after { display: none; }
.preview-steps li > span { display: grid; width: 31px; height: 31px; place-items: center; color: var(--subtle); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 50%; font-size: .7rem; font-weight: 850; }
.preview-steps li.is-done > span { color: #fff; background: var(--green); border-color: var(--green); }
.preview-steps li.is-active > span { color: #fff; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.preview-steps strong, .preview-steps small { display: block; }
.preview-steps small { color: var(--subtle); }
.preview-progress { height: 7px; overflow: hidden; background: var(--surface-soft); border-radius: 99px; }
.preview-progress span { display: block; width: 64%; height: 100%; background: linear-gradient(90deg, var(--teal), #38b9ad); border-radius: inherit; }
.landing-preview > p { margin: 11px 0 0; color: var(--subtle); font-size: .78rem; text-align: center; }
.landing-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 94px 0; }
.landing-section-heading { max-width: 690px; margin-bottom: 40px; }
.landing-section-heading h2, .landing-cta h2 { font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -.04em; }
.landing-section-heading > p:last-child { margin: 14px 0 0; font-size: 1rem; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.landing-feature-card { padding: 27px; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 12px 30px rgba(21,37,61,.05); }
.landing-feature-card > span { display: grid; width: 42px; height: 42px; margin-bottom: 23px; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 12px; font-size: 1rem; font-weight: 900; }
.landing-feature-card h3 { margin-bottom: 9px; font-size: 1.05rem; }
.landing-feature-card p { margin-bottom: 0; font-size: .88rem; }
.landing-workflow { border-top: 1px solid var(--line); }
.landing-workflow-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; counter-reset: none; }
.landing-workflow-list li { display: flex; min-height: 150px; gap: 18px; padding: 27px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.landing-workflow-list li > span { color: var(--teal); font-size: .75rem; font-weight: 900; letter-spacing: .08em; }
.landing-workflow-list h3 { margin-bottom: 8px; }
.landing-workflow-list p { margin: 0; }
.account-request-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, .7fr); align-items: center; gap: clamp(42px, 8vw, 100px); border-top: 1px solid var(--line); }
.account-request-copy h2 { max-width: 680px; margin-bottom: 18px; font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -.04em; }
.account-request-copy > p:not(.eyebrow) { max-width: 650px; font-size: 1rem; }
.account-request-copy ul { display: grid; gap: 10px; padding: 0; margin: 26px 0 0; list-style: none; }
.account-request-copy li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.account-request-copy li::before { display: grid; flex: 0 0 22px; width: 22px; height: 22px; place-items: center; color: var(--green); background: #e8f5ee; border-radius: 50%; content: "✓"; font-size: .72rem; font-weight: 900; }
.account-request-form { padding: clamp(25px, 4vw, 38px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.account-request-login { margin: 18px 0 0; text-align: center; font-size: .86rem; }
.account-request-login a { font-weight: 750; }
.landing-cta { display: flex; width: min(1180px, calc(100% - 40px)); align-items: center; justify-content: space-between; gap: 32px; margin: 30px auto 90px; padding: clamp(30px, 5vw, 55px); color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2)); border-radius: 24px; box-shadow: var(--shadow-lg); }
.landing-cta .eyebrow { color: #64d4cb; }
.landing-cta h2 { max-width: 690px; margin: 0; }
.landing-cta .button-primary { flex: 0 0 auto; background: #35b7aa; border-color: #35b7aa; }
.landing-footer { display: flex; width: min(1180px, calc(100% - 40px)); align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 28px 0 38px; color: var(--subtle); border-top: 1px solid var(--line); font-size: .82rem; }

/* Authentication */
.auth-page { background: var(--navy); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.05fr) minmax(440px, .95fr); }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 6vw, 82px); color: #fff; background: radial-gradient(circle at 20% 20%, rgba(20,188,174,.16), transparent 24rem), linear-gradient(145deg, #0d243c, #173d5f); }
.auth-intro h1 { max-width: 680px; margin: 0 0 24px; font-size: clamp(2.2rem, 4vw, 4.2rem); line-height: 1.08; letter-spacing: -.045em; }
.auth-intro p:not(.eyebrow) { max-width: 630px; color: rgba(255,255,255,.7); font-size: 1.06rem; }
.auth-intro .eyebrow { color: #68d7ce; }
.feature-list { display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 0; margin: 30px 0 0; list-style: none; }
.feature-list li { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.82); font-size: .85rem; font-weight: 650; }
.feature-list span { color: #5dd0c7; font-size: .7rem; letter-spacing: .08em; }
.auth-panel { display: grid; min-height: 100vh; padding: 38px; place-items: center; background: #f6f8fa; }
.auth-card { width: min(440px, 100%); padding: clamp(28px, 5vw, 48px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.auth-card-heading { margin-bottom: 28px; }
.auth-card-heading h2 { margin-bottom: 8px; font-size: 1.75rem; }
.auth-card-heading p:last-child { margin-bottom: 0; }
.auth-switch { margin: 22px 0 0; text-align: center; font-size: .9rem; }
.auth-switch a { font-weight: 750; }

/* Dashboard */
.dashboard-heading { align-items: center; }
.usage-summary { display: flex; min-width: 260px; align-items: center; gap: 14px; padding: 12px 16px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 12px; }
.usage-summary strong, .usage-summary span { display: block; }
.usage-summary > div:last-child > span { margin-top: 2px; color: var(--muted); font-size: .84rem; }
.usage-ring { --usage: 0; display: grid; flex: 0 0 52px; width: 52px; height: 52px; place-items: center; background: conic-gradient(var(--teal) calc(var(--usage) * 1%), #e2e9ee 0); border-radius: 50%; }
.usage-ring::before { grid-area: 1/1; width: 39px; height: 39px; background: #fff; border-radius: 50%; content: ""; }
.usage-ring span { z-index: 1; grid-area: 1/1; font-size: .68rem; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 22px; margin-bottom: 24px; }
.upload-panel { padding: 26px; }
.drop-zone { display: grid; min-height: 215px; padding: 26px; place-items: center; align-content: center; gap: 6px; text-align: center; background: #f8fbfb; border: 1.5px dashed #a9c8c7; border-radius: 13px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.drop-zone:hover, .drop-zone.is-dragging { background: var(--teal-soft); border-color: var(--teal); transform: translateY(-1px); }
.drop-zone > span:not(.upload-icon) { color: var(--teal-dark); font-weight: 700; }
.drop-zone small { max-width: 460px; margin-top: 6px; color: var(--subtle); }
.upload-icon { display: grid; width: 46px; height: 46px; margin-bottom: 5px; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 50%; font-size: 1.55rem; font-weight: 500; }
.selected-file { display: flex; align-items: center; gap: 13px; margin-top: 13px; padding: 11px 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.selected-file > div { min-width: 0; flex: 1; }
.selected-file strong, .selected-file span { display: block; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file span { color: var(--muted); font-size: .8rem; }
.file-icon { display: grid !important; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; color: #fff !important; background: var(--navy-2); border-radius: 8px; font-size: .62rem !important; font-weight: 850; }
.icon-button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: 1.4rem; }
.icon-button:hover { color: var(--red); background: var(--red-soft); }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; cursor: pointer; }
.check-row input { width: 17px; min-height: 17px; margin-top: 3px; accent-color: var(--teal); }
.check-row strong, .check-row small { display: block; }
.check-row small { color: var(--muted); }
.upload-progress { margin: 18px 0; }
.progress-label, .overall-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: .85rem; }
.progress-track { height: 8px; overflow: hidden; background: #e5ebef; border-radius: 99px; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--teal), #35b7aa); border-radius: inherit; transition: width .35s ease; }
.upload-progress small { display: block; margin-top: 7px; color: var(--muted); }
.upload-progress-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.upload-progress-footer small { min-width: 0; flex: 1; }
.upload-progress-footer .button { flex: 0 0 auto; margin-top: 7px; }
.dashboard-side { display: grid; align-content: start; gap: 16px; }
.compact-panel { padding: 24px; }
.metric-list, .breakdown-list { margin: 0; }
.metric-list > div, .breakdown-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.metric-list > div:last-child, .breakdown-list > div:last-child { border-bottom: 0; }
.metric-list dt, .breakdown-list dt { color: var(--muted); }
.metric-list dd, .breakdown-list dd { margin: 0; font-weight: 800; }
.info-card { display: flex; gap: 13px; padding: 17px; background: #e9f2f8; border: 1px solid #cadde9; border-radius: 12px; }
.info-card > span { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-weight: 800; }
.info-card strong { display: block; margin-bottom: 3px; }
.info-card p { margin: 0; color: #567084; font-size: .83rem; }
.jobs-panel { padding: 26px; }
.toolbar { display: flex; align-items: center; gap: 8px; }
.toolbar select { width: auto; min-width: 135px; }
.search-field { display: block; }
.search-field input { min-width: 220px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: 11px 12px; color: var(--muted); background: var(--surface-soft); font-size: .72rem; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
.table-primary { display: block; max-width: 360px; overflow: hidden; color: var(--ink); font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.table-secondary { display: block; max-width: 360px; margin-top: 2px; overflow: hidden; color: var(--subtle); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.table-action { color: var(--teal-dark); font-weight: 750; white-space: nowrap; }
.link-button { padding: 0; color: var(--teal-dark); background: transparent; border: 0; border-radius: 4px; cursor: pointer; font: inherit; font-weight: 750; white-space: nowrap; }
.link-button:hover { text-decoration: underline; }
.link-button:disabled { opacity: .5; cursor: wait; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.pagination > span { min-width: 210px; color: var(--muted); font-size: .82rem; text-align: center; }
.empty-state, .loading-state { display: grid; min-height: 190px; padding: 28px; place-items: center; align-content: center; gap: 5px; text-align: center; color: var(--muted); }
.empty-state > span { display: grid; width: 42px; height: 42px; margin-bottom: 5px; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 50%; font-size: 1.2rem; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 0; }
.loading-state { min-height: 160px; grid-template-columns: auto auto; justify-content: center; }
.loader { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }

/* Job detail */
.breadcrumb { display: flex; gap: 8px; margin-bottom: 22px; color: var(--subtle); font-size: .83rem; }
.breadcrumb a { color: var(--muted); }
.job-heading { align-items: center; }
.heading-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.muted-mono { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .74rem; }
.process-panel { padding: 25px; margin-bottom: 20px; }
.subtle-text { color: var(--subtle); font-size: .78rem; }
.overall-progress { margin-bottom: 27px; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); padding: 0; margin: 0; list-style: none; }
.stepper li { position: relative; display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 9px; padding-right: 15px; }
.stepper li::after { position: absolute; z-index: 0; top: 16px; right: 0; left: 34px; height: 2px; background: var(--line); content: ""; }
.stepper li:last-child::after { display: none; }
.stepper li > span { z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; color: var(--subtle); background: #fff; border: 2px solid var(--line-strong); border-radius: 50%; font-size: .75rem; font-weight: 800; }
.stepper li > div { z-index: 1; background: #fff; }
.stepper strong, .stepper small { display: block; }
.stepper small { margin-top: 2px; color: var(--subtle); font-size: .7rem; }
.stepper li.is-done > span { color: #fff; background: var(--green); border-color: var(--green); }
.stepper li.is-done::after { background: var(--green); }
.stepper li.is-active > span { color: #fff; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.stepper li.is-active strong { color: var(--amber); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.metric-card > span, .metric-card > strong, .metric-card > small { display: block; }
.metric-card > span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-card > strong { margin: 5px 0 2px; font-size: 1.45rem; letter-spacing: -.02em; }
.metric-card > small { color: var(--subtle); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.subtitle-panel { min-width: 0; padding: 25px; }
.cost-panel { position: sticky; top: 94px; padding: 23px; }
.breakdown-total { margin-top: 5px; border-top: 2px solid var(--line-strong); border-bottom: 0 !important; }
.breakdown-total dt, .breakdown-total dd { color: var(--ink); font-size: 1.02rem; font-weight: 850; }
.timing-list { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.token-box { margin-top: 20px; padding: 14px; background: var(--surface-soft); border-radius: 9px; }
.token-box > strong { display: block; margin-bottom: 8px; font-size: .82rem; }
.token-box > div { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.token-box b { margin-left: 3px; color: var(--ink); }
.subtitle-list { display: grid; gap: 2px; }
.subtitle-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 15px; padding: 13px 10px; border-bottom: 1px solid var(--line); border-radius: 7px; }
.subtitle-row:hover { background: #f8fafb; }
.subtitle-time { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .7rem; }
.subtitle-japanese, .subtitle-chinese { margin: 0; overflow-wrap: anywhere; }
.subtitle-japanese, .subtitle-chinese { white-space: pre-line; }
.subtitle-japanese { color: var(--muted); font-size: .87rem; }
.subtitle-chinese { margin-top: 4px; color: var(--ink); font-size: 1rem; font-weight: 650; }

/* Admin */
.admin-heading { align-items: center; }
.admin-metrics .metric-card { border-top: 3px solid var(--teal); }
.admin-tabs { display: flex; gap: 4px; margin: 28px 0 12px; padding: 4px; overflow-x: auto; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 11px; }
.admin-tabs button { min-height: 39px; padding: 8px 16px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-weight: 750; white-space: nowrap; }
.admin-tabs button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(21,37,61,.09); }
.tab-count { display: inline-grid; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; place-items: center; color: #fff; background: var(--red); border-radius: 99px; font-size: .68rem; }
.admin-tab-panel { padding: 25px; }
.review-guidance { max-width: 620px; margin: 0; color: var(--muted); font-size: .84rem; }
.request-password-control { min-width: 170px; }
.admin-create-user { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 1fr) minmax(170px, 1fr) 120px auto; align-items: end; gap: 10px; margin: -4px 0 24px; padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.admin-create-user .field { margin: 0; }
.admin-create-user .form-message { grid-column: 1 / -1; margin: 0; }
.user-cell { display: flex; min-width: 220px; align-items: center; gap: 10px; }
.avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; font-weight: 850; }
.cell-control { min-width: 100px; min-height: 34px; padding: 5px 8px; font-size: .8rem; }
.quota-control { width: 88px; }
.admin-actions { display: flex; gap: 5px; }
.admin-actions .button { white-space: nowrap; }
.cost-overview { display: grid; grid-template-columns: minmax(260px, .6fr) minmax(340px, 1fr); gap: 50px; align-items: center; max-width: 900px; padding: 20px 0; }
.cost-bars { display: grid; gap: 18px; }
.cost-bars > div { display: grid; grid-template-columns: 65px minmax(120px, 1fr) 48px; align-items: center; gap: 12px; }
.cost-bars span, .cost-bars b { font-size: .8rem; }
.cost-bars b { text-align: right; }
.cost-bars > div > div { height: 12px; overflow: hidden; background: var(--surface-soft); border-radius: 99px; }
.cost-bars i { display: block; width: 0; height: 100%; background: var(--teal); border-radius: inherit; transition: width .4s; }
.cost-bars > div:nth-child(2) i { background: var(--blue); }
.cost-bars > div:nth-child(3) i { background: #7a61ae; }

/* Error */
.error-page .page-shell { display: grid; min-height: calc(100vh - 72px); place-items: center; }
.error-card { position: relative; width: min(620px, 100%); padding: clamp(30px, 6vw, 60px); overflow: hidden; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.error-card h1 { position: relative; }
.error-card p:not(.eyebrow) { position: relative; margin: 0 auto 25px; }
.error-card .button-row { justify-content: center; }
.error-code { position: absolute; top: -35px; right: 10px; color: rgba(16,41,69,.045); font-size: 10rem; font-weight: 900; line-height: 1; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 980px) {
  .landing-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 60px; }
  .landing-hero-copy { max-width: 760px; }
  .landing-preview { width: min(620px, 100%); }
  .landing-feature-grid { grid-template-columns: repeat(2, 1fr); }
  .account-request-section { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 380px; padding: 42px; }
  .auth-panel { min-height: auto; padding: 42px 22px; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr 1fr; }
  .cost-panel { position: static; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stepper { grid-template-columns: 1fr; gap: 9px; }
  .stepper li { grid-template-columns: 34px 1fr; padding: 0; }
  .stepper li::after { top: 34px; bottom: -10px; left: 16px; width: 2px; height: auto; }
  .stepper li > div { padding: 6px 0 10px; }
  .admin-create-user { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-create-user > .button { align-self: end; }
}

@media (max-width: 700px) {
  .landing-header { min-height: 70px; }
  .landing-header .brand small, .landing-nav > a:not(.button) { display: none; }
  .landing-hero { width: min(100% - 28px, 1180px); gap: 48px; padding: 49px 0 72px; }
  .landing-hero-copy h1 { font-size: clamp(2.45rem, 12vw, 3.7rem); }
  .landing-feature-grid, .landing-workflow-list { grid-template-columns: 1fr; }
  .landing-section { width: min(100% - 28px, 1180px); padding: 70px 0; }
  .landing-cta { width: min(100% - 28px, 1180px); align-items: flex-start; flex-direction: column; margin-bottom: 55px; }
  .landing-footer { width: min(100% - 28px, 1180px); align-items: flex-start; flex-direction: column; gap: 4px; }
  .site-header { min-height: 64px; padding: 9px 16px; }
  .brand small { display: none; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 7px; font-size: .8rem; }
  .page-shell { width: min(100% - 24px, 1240px); padding: 27px 0 48px; }
  .page-heading { display: block; }
  .page-heading > :last-child { margin-top: 18px; }
  .usage-summary { width: 100%; }
  .dashboard-side, .metric-grid { grid-template-columns: 1fr; }
  .upload-panel, .jobs-panel, .process-panel, .subtitle-panel, .cost-panel, .admin-tab-panel { padding: 18px; }
  .field-inline { display: block; }
  .field-inline label { margin-bottom: 6px; }
  .panel-heading-wrap { display: block; }
  .toolbar { width: 100%; margin-top: 12px; flex-wrap: wrap; }
  .toolbar > * { flex: 1 1 140px; }
  .search-field input { min-width: 0; }
  .job-heading .button-row { display: grid; grid-template-columns: 1fr 1fr; }
  .job-heading .button-row .button:last-child { grid-column: 1 / -1; }
  .subtitle-row { grid-template-columns: 1fr; gap: 5px; }
  .cost-overview { grid-template-columns: 1fr; gap: 28px; }
  .admin-create-user { grid-template-columns: 1fr; }
  .pagination { justify-content: center; flex-wrap: wrap; }
  .pagination > span { order: -1; width: 100%; min-width: 0; }
  .auth-intro { min-height: 330px; padding: 28px 22px; }
  .auth-intro h1 { font-size: 2.25rem; }
  .feature-list { display: none; }
  .auth-panel { padding: 22px 12px; }
  .auth-card { padding: 28px 22px; }
  .toast-region { right: 12px; bottom: 12px; width: calc(100% - 24px); }
}

@media (max-width: 420px) {
  .landing-header { width: calc(100% - 24px); }
  .landing-header .brand > span:last-child { display: none; }
  .landing-preview { padding: 18px; }
  .preview-file { grid-template-columns: 42px minmax(0, 1fr); }
  .preview-file .status-pill { display: none; }
  .landing-actions { display: grid; }
  .site-header { padding-inline: 12px; }
  .site-header .brand > span:last-child { display: none; }
  .site-header .brand-mark { flex-basis: 38px; width: 38px; height: 38px; }
  .site-nav a { padding-inline: 5px; font-size: .74rem; }
  .site-nav .button { min-height: 34px; padding-inline: 8px; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
