:root {
  color-scheme: light;
  --ink: #152536;
  --ink-soft: #35495e;
  --muted: #718096;
  --muted-light: #94a3b8;
  --navy: #17324d;
  --navy-dark: #10273d;
  --navy-soft: #eaf0f5;
  --teal: #18877c;
  --teal-dark: #116c64;
  --teal-soft: #e5f5f2;
  --blue: #2d6da3;
  --blue-soft: #e8f1f8;
  --green: #187357;
  --green-soft: #e6f4ee;
  --amber: #a76516;
  --amber-soft: #fff3dc;
  --red: #b84645;
  --red-dark: #963837;
  --red-soft: #fceceb;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --line: #dfe5ea;
  --line-strong: #ccd5dc;
  --shadow-xs: 0 1px 2px rgb(16 39 61 / 5%);
  --shadow-sm: 0 6px 20px rgb(16 39 61 / 8%);
  --shadow-lg: 0 24px 72px rgb(16 39 61 / 22%);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --sidebar-width: 252px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
label {
  touch-action: manipulation;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.015em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  line-height: 1.25;
}

h3 {
  margin-bottom: 5px;
  font-size: 1.05rem;
  line-height: 1.35;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #68b8d1;
  outline-offset: 3px;
}

.boot-screen {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--navy);
  background: var(--canvas);
}

.boot-screen p {
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), #20a497);
  border-radius: 11px 11px 11px 4px;
  box-shadow: 0 7px 18px rgb(24 135 124 / 26%);
  font-size: 1.02rem;
  font-weight: 850;
}

.brand-mark-large {
  width: 56px;
  height: 56px;
  border-radius: 16px 16px 16px 6px;
  font-size: 1.4rem;
  animation: breathe 1.4s ease-in-out infinite alternate;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.brand-lockup-light {
  color: #fff;
}

.section-kicker,
.eyebrow {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  padding: 10px 17px;
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal);
  box-shadow: 0 4px 12px rgb(24 135 124 / 18%);
}

.primary-button:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.secondary-button {
  padding: 9px 15px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.secondary-button:hover:not(:disabled) {
  color: var(--navy);
  background: var(--surface-alt);
  border-color: #aebbc5;
}

.danger-button {
  padding: 9px 15px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
}

.danger-button:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.text-button {
  min-height: 38px;
  padding: 6px 3px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
}

.text-button:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: #a7b7c7;
  background: transparent;
  border: 0;
}

.icon-button:hover {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

/* Login */
.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1.15fr) minmax(420px, 0.85fr);
  background: #fff;
}

.login-story {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 86% 20%, rgb(41 174 161 / 25%), transparent 30%),
    radial-gradient(circle at 16% 88%, rgb(64 121 164 / 24%), transparent 32%),
    linear-gradient(145deg, #102a42 0%, #173b58 58%, #15364e 100%);
}

.login-story::before,
.login-story::after {
  position: absolute;
  width: 330px;
  height: 330px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  content: "";
}

.login-story::before {
  top: -145px;
  right: -90px;
  box-shadow: 0 0 0 54px rgb(255 255 255 / 2.5%), 0 0 0 108px rgb(255 255 255 / 1.5%);
}

.login-story::after {
  bottom: -210px;
  left: -130px;
  box-shadow: 0 0 0 70px rgb(255 255 255 / 2%);
}

.login-story-inner {
  position: relative;
  z-index: 1;
  width: min(590px, calc(100% - 92px));
}

.login-story .eyebrow {
  margin-top: clamp(64px, 11vh, 110px);
  color: #82d7cd;
}

.login-story h1 {
  max-width: 620px;
  margin-bottom: 24px;
  font-size: clamp(2.6rem, 5vw, 4.35rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.login-lead {
  max-width: 570px;
  margin-bottom: clamp(45px, 8vh, 76px);
  color: #ccdae5;
  font-size: 1.05rem;
  line-height: 1.8;
}

.login-features {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #e6edf2;
  font-weight: 650;
}

.login-features span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #8fd9d1;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 50%;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 56px;
  background: #fff;
}

.login-card {
  width: min(420px, 100%);
}

.mobile-brand {
  display: none;
  margin-bottom: 58px;
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.login-help {
  margin-bottom: 34px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 20px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.field-group input {
  width: 100%;
  height: 49px;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

.field-group input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(24 135 124 / 12%);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 67px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 39px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.password-toggle:hover {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.login-button {
  width: 100%;
  min-height: 51px;
  justify-content: space-between;
  padding-inline: 18px;
}

.form-error {
  padding: 11px 13px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f5ccca;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.login-security {
  margin: 28px 0 0;
  color: var(--muted-light);
  font-size: 0.75rem;
  text-align: center;
}

.login-security span {
  color: var(--green);
  font-size: 0.55rem;
}

/* App shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #fff;
  background: var(--navy-dark);
  box-shadow: 6px 0 24px rgb(16 39 61 / 8%);
}

.sidebar-brand {
  min-height: 84px;
  padding: 20px 22px;
  color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.sidebar-brand > div {
  display: grid;
  gap: 1px;
}

.sidebar-brand small {
  color: #8fa5b9;
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.08em;
}

.primary-nav {
  flex: 1;
  padding: 24px 12px;
}

.nav-label {
  padding: 0 13px;
  margin: 0 0 9px;
  color: #698199;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-label-secondary {
  margin-top: 29px;
}

.nav-button {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 3px 0;
  color: #adbdcb;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 650;
  text-align: left;
}

.nav-button:hover {
  color: #fff;
  background: rgb(255 255 255 / 5%);
}

.nav-button.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgb(34 158 146 / 21%), rgb(34 158 146 / 10%));
  box-shadow: inset 3px 0 #3bc0b2;
}

.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  font-size: 1.05rem;
}

.nav-count {
  min-width: 22px;
  padding: 2px 6px;
  color: #b8ede7;
  background: rgb(59 192 178 / 15%);
  border-radius: 999px;
  font-size: 0.68rem;
  text-align: center;
}

.sidebar-bottom {
  padding: 15px 12px 18px;
  border-top: 1px solid rgb(255 255 255 / 7%);
}

.service-state,
.sidebar-user {
  display: flex;
  align-items: center;
}

.service-state {
  gap: 10px;
  padding: 8px 11px 16px;
  color: #b8c7d4;
}

.service-state > span:last-child,
.sidebar-user .user-copy {
  display: grid;
  min-width: 0;
}

.service-state strong {
  font-size: 0.75rem;
}

.service-state small,
.sidebar-user small {
  overflow: hidden;
  color: #71889d;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: #8898a6;
  border: 2px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(255 255 255 / 5%);
}

.connection-dot.is-online {
  background: #4bc494;
}

.connection-dot.is-offline {
  background: #e27170;
}

.connection-dot.is-pending {
  background: #e5ad5c;
  animation: pulse 1.2s ease-in-out infinite;
}

.sidebar-user {
  gap: 9px;
  padding: 10px 8px 5px;
  border-top: 1px solid rgb(255 255 255 / 6%);
}

.user-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  color: #dff9f6;
  background: #24645f;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 800;
}

.sidebar-user .user-copy {
  flex: 1;
}

.sidebar-user strong {
  overflow: hidden;
  color: #e8eef3;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(24px, 4vw, 54px);
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 650;
}

.topbar-actions,
.topbar-user {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.topbar-user {
  gap: 9px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.topbar-user > span:last-child {
  display: grid;
  min-width: 82px;
}

.topbar-user strong {
  font-size: 0.78rem;
}

.topbar-user small {
  color: var(--muted);
  font-size: 0.65rem;
}

.topbar-user .user-avatar {
  width: 34px;
  height: 34px;
}

.compact-button {
  min-height: 39px;
  padding: 7px 12px;
  font-size: 0.77rem;
}

.mobile-nav {
  display: none;
}

.main-content {
  width: min(1360px, 100%);
  min-height: calc(100vh - 132px);
  padding: 38px clamp(24px, 4vw, 54px) 58px;
  margin: 0 auto;
}

.view-panel {
  animation: panel-in 180ms ease-out;
}

.welcome-row,
.view-heading,
.card-heading,
.jobs-toolbar,
.upload-options,
.dialog-status-row,
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.welcome-row {
  align-items: flex-end;
  margin-bottom: 27px;
}

.welcome-row h2,
.view-heading h2 {
  margin-bottom: 6px;
}

.welcome-row p:last-child,
.view-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.view-heading {
  align-items: flex-end;
  margin-bottom: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.summary-card {
  display: grid;
  min-width: 0;
  min-height: 134px;
  grid-template-columns: 43px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 21px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.summary-card:hover {
  border-color: #bdcad3;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.summary-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 800;
}

.summary-active .summary-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.summary-completed .summary-icon {
  color: var(--green);
  background: var(--green-soft);
}

.summary-failed .summary-icon {
  color: var(--red);
  background: var(--red-soft);
}

.summary-card > span:last-child {
  display: grid;
}

.summary-card small {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}

.summary-card strong {
  margin: -2px 0 -1px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.2;
}

.summary-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.google-login {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.google-login p {
  color: var(--muted);
  line-height: 1.65;
}

#google-signin-button {
  min-height: 44px;
}

.workspace-switcher {
  display: grid;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--muted);
}

.workspace-switcher select,
.invitation-form input,
.invitation-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.workspace-admin {
  margin-top: 20px;
}

.invitation-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px 0;
}

.invitation-form label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
  padding: 0 22px 22px;
}

.admin-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-list-row small,
.muted {
  color: var(--muted);
}

.admin-list-row > span,
.member-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-admin-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-admin-row h5 {
  margin: 0 0 3px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.member-row select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 760px) {
  .invitation-form,
  .admin-lists,
  .member-row { grid-template-columns: 1fr; }
  .workspace-switcher { max-width: 180px; }
}

.quota-summary { margin: 1.25rem 0; }
.quota-summary-content { display: grid; gap: .8rem; }
.quota-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.quota-provider { border: 1px solid var(--line); border-radius: .75rem; padding: .9rem; background: var(--surface-alt); }
.quota-provider strong { display: block; }
.quota-provider p { margin: .45rem 0; line-height: 1.5; }
.quota-provider small { display: block; color: var(--muted); margin-top: .35rem; }
.quota-provider a { display: inline-block; margin-top: .55rem; }
.quota-model strong { display: inline; }
@media (max-width: 720px) { .quota-provider-list { grid-template-columns: 1fr; } }

.content-card,
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.card-heading {
  min-height: 82px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

.card-heading h3,
.card-heading p {
  margin-bottom: 0;
}

.card-heading .section-kicker {
  margin-bottom: 3px;
}

.recent-jobs {
  padding: 4px 22px 12px;
}

.recent-job {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f4;
}

.recent-job:last-child {
  border-bottom: 0;
}

.file-type-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.recent-job-main {
  display: grid;
  min-width: 0;
}

.recent-job-main strong,
.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-job-main small {
  color: var(--muted);
  font-size: 0.68rem;
}

.detail-link {
  min-height: 38px;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 750;
}

.detail-link:hover {
  background: var(--teal-soft);
}

.workflow-card {
  background: linear-gradient(155deg, #17354f, #102c43);
  border-color: #17354f;
  color: #fff;
}

.workflow-card .card-heading {
  border-color: rgb(255 255 255 / 9%);
}

.workflow-card .section-kicker {
  color: #79d3c8;
}

.workflow-list {
  display: grid;
  gap: 0;
  padding: 14px 22px 20px;
  margin: 0;
  list-style: none;
}

.workflow-list li {
  position: relative;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0 15px;
}

.workflow-list li:not(:last-child)::after {
  position: absolute;
  top: 42px;
  bottom: -4px;
  left: 15px;
  width: 1px;
  background: rgb(255 255 255 / 13%);
  content: "";
}

.workflow-list li > span {
  display: grid;
  width: 31px;
  height: 31px;
  z-index: 1;
  place-items: center;
  color: #a6e8e0;
  background: #214b63;
  border: 1px solid rgb(125 217 206 / 25%);
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
}

.workflow-list div {
  display: grid;
}

.workflow-list strong {
  color: #f0f6f8;
  font-size: 0.79rem;
}

.workflow-list small {
  color: #8fa9bb;
  font-size: 0.67rem;
}

.mini-empty,
.empty-state {
  text-align: center;
}

.mini-empty {
  padding: 50px 20px;
}

.mini-empty > span,
.empty-icon {
  display: grid;
  width: 49px;
  height: 49px;
  margin: 0 auto 12px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
  font-size: 1.25rem;
}

.mini-empty p {
  margin-bottom: 1px;
  font-weight: 750;
}

.mini-empty small,
.empty-state p {
  color: var(--muted);
}

/* Alerts */
.page-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 20px;
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.page-alert-error {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #f2cfcd;
}

.page-alert-info {
  color: #2d5f82;
  background: var(--blue-soft);
  border-color: #cbdfea;
}

.page-alert > span:nth-child(2) {
  display: grid;
  flex: 1;
}

.page-alert strong {
  font-size: 0.82rem;
}

.page-alert small {
  color: currentColor;
  font-size: 0.72rem;
  opacity: 0.82;
}

.alert-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  background: rgb(255 255 255 / 55%);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 850;
}

.alert-close {
  width: 28px;
  height: 28px;
  padding: 0;
  color: currentColor;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2rem;
}

.alert-close:hover {
  background: rgb(255 255 255 / 45%);
}

/* Upload and inbox */
.upload-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(400px, 1.35fr);
  gap: 28px;
  padding: 25px;
  margin-bottom: 20px;
}

.upload-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 4px;
}

.upload-copy h3 {
  margin-bottom: 7px;
}

.upload-copy p {
  max-width: 330px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.upload-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 11px;
  font-size: 1.2rem;
}

.upload-form {
  display: grid;
  gap: 15px;
}

.context-field {
  display: grid;
  gap: 7px;
}

.context-field > span {
  display: grid;
  gap: 2px;
}

.context-field strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.context-field small,
.context-help {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.55;
}

.context-field textarea {
  width: 100%;
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
  color: var(--ink-soft);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.55;
}

.context-field textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(42 143 132 / 18%);
}

.context-field textarea:disabled {
  color: var(--muted);
  background: var(--surface-alt);
}

.context-count {
  justify-self: end;
}

.drop-zone {
  display: grid;
  min-height: 134px;
  align-content: center;
  justify-items: center;
  padding: 22px;
  text-align: center;
  background: #f8fbfb;
  border: 1.5px dashed #accdc8;
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.drop-zone:focus-within {
  outline: 3px solid #68b8d1;
  outline-offset: 3px;
}

.drop-zone.has-file {
  background: var(--blue-soft);
  border-color: #86aec9;
  border-style: solid;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 6px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 1.1rem;
}

.drop-zone strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
}

.upload-options {
  align-items: flex-end;
}

.switch-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.switch {
  position: relative;
  width: 37px;
  height: 21px;
  background: #b9c4cc;
  border-radius: 999px;
  transition: background 150ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  content: "";
  transition: transform 150ms ease;
}

.switch-row input:checked + .switch {
  background: var(--teal);
}

.switch-row input:checked + .switch::after {
  transform: translateX(16px);
}

.switch-row input:focus-visible + .switch {
  outline: 3px solid #68b8d1;
  outline-offset: 3px;
}

.switch-row > span:last-child {
  display: grid;
}

.switch-row strong {
  font-size: 0.74rem;
}

.switch-row small {
  color: var(--muted);
  font-size: 0.63rem;
}

.inline-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 650;
}

.spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.inbox-card {
  overflow: hidden;
}

.inbox-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.inbox-list {
  display: grid;
}

.inbox-item {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1.5fr) minmax(100px, 0.55fr) minmax(130px, 0.7fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 13px 22px;
  border-bottom: 1px solid #edf1f4;
}

.inbox-item:last-child {
  border-bottom: 0;
}

.inbox-file-main,
.inbox-meta {
  display: grid;
  min-width: 0;
}

.inbox-file-main strong {
  overflow: hidden;
  font-size: 0.81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-file-main small,
.inbox-meta small {
  color: var(--muted);
  font-size: 0.67rem;
}

.inbox-meta strong {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 650;
}

.inbox-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.drive-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 6px 9px;
  color: var(--blue);
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 750;
  text-decoration: none;
}

.drive-link:hover {
  background: var(--blue-soft);
}

.context-present {
  color: var(--teal-dark) !important;
  font-weight: 700;
}

.context-button {
  min-height: 36px;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
}

.context-button:hover:not(:disabled) {
  background: #d7efeb;
}

.context-count.is-limit {
  color: var(--danger);
  font-weight: 750;
}

.process-button {
  min-height: 36px;
  padding: 7px 12px;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.process-button:hover:not(:disabled) {
  background: var(--teal-dark);
}

.empty-state {
  padding: 64px 24px 70px;
}

.empty-state h3 {
  margin-bottom: 4px;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 0.8rem;
}

/* Jobs */
.jobs-card {
  overflow: hidden;
}

.jobs-toolbar {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-button {
  min-height: 36px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 700;
}

.filter-button:hover {
  color: var(--navy);
  background: var(--surface-alt);
}

.filter-button.is-active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: #c9e8e3;
}

.search-field {
  display: flex;
  width: min(230px, 100%);
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.73rem;
}

.table-region {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #fafbfc;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

th:first-child { width: 34%; }
th:nth-child(2) { width: 17%; }
th:nth-child(3) { width: 18%; }
th:nth-child(4) { width: 21%; }
th:last-child { width: 10%; }

tbody tr:hover {
  background: #fbfcfd;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.job-file-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.job-file-copy {
  display: grid;
  min-width: 0;
}

.job-file-copy small,
.job-time-cell small,
.job-output-cell small {
  color: var(--muted);
  font-size: 0.66rem;
}

.job-time-cell,
.job-output-cell {
  display: grid;
}

.job-time-cell time,
.job-output-cell strong {
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 650;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: #536577;
  background: #edf1f4;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.status-badge.is-active {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.is-completed {
  color: var(--green);
  background: var(--green-soft);
}

.status-badge.is-failed {
  color: var(--red);
  background: var(--red-soft);
}

.status-badge.is-archived {
  color: var(--blue);
  background: var(--blue-soft);
}

.output-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.output-links .drive-link {
  min-height: 31px;
  padding: 4px 6px;
}

.retry-note {
  display: block;
  max-width: 190px;
  margin-top: 4px;
  color: var(--red-dark);
  font-size: 0.62rem;
  line-height: 1.4;
}

/* Config */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.config-group {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.config-group-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 67px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.config-group-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 800;
}

.config-group-header h3 {
  margin: 0;
  font-size: 0.9rem;
}

.config-list {
  margin: 0;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 1.2fr);
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid #edf1f4;
}

.config-row:last-child {
  border-bottom: 0;
}

.config-row dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.config-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 700;
  text-align: right;
}

.config-good {
  color: var(--green) !important;
}

.config-warning {
  color: var(--amber) !important;
}

.compact-empty {
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Dialog */
.job-dialog {
  width: min(900px, calc(100% - 36px));
  max-height: min(900px, calc(100vh - 36px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.job-dialog::backdrop {
  background: rgb(9 24 37 / 61%);
  backdrop-filter: blur(4px);
}

.context-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.context-dialog::backdrop {
  background: rgb(9 24 37 / 61%);
  backdrop-filter: blur(4px);
}

.context-dialog-layout {
  display: flex;
  max-height: calc(100vh - 36px);
  flex-direction: column;
}

.context-dialog-body {
  display: grid;
  gap: 16px;
  padding: 22px 25px;
  overflow-y: auto;
}

.context-help {
  padding: 10px 12px;
  margin: 0;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 8px;
}

.job-context-preview {
  padding: 13px 15px;
  margin: 0 0 18px;
  background: #fffaf0;
  border: 1px solid #ead9b5;
  border-radius: 9px;
}

.job-context-preview h3 {
  margin: 0 0 7px;
  font-size: 0.75rem;
}

.job-context-preview pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.71rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dialog-layout {
  display: flex;
  max-height: min(900px, calc(100vh - 36px));
  flex-direction: column;
}

.dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 25px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  max-width: 720px;
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--navy-soft);
}

.dialog-loading {
  display: flex;
  min-height: 310px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

#dialog-content {
  padding: 21px 25px 24px;
  overflow-y: auto;
}

.dialog-status-row {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.attempt-label {
  color: var(--muted);
  font-size: 0.68rem;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px 16px;
  margin: 0 0 15px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.job-meta > div {
  min-width: 0;
  padding: 1px 13px;
  border-right: 1px solid var(--line);
}

.job-meta > div:first-child {
  padding-left: 0;
}

.job-meta > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.job-meta dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
}

.job-meta dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.dialog-links .drive-link {
  min-height: 38px;
  padding: 7px 11px;
  background: var(--blue-soft);
}

.preview-section {
  margin-top: 18px;
}

.preview-heading {
  align-items: flex-end;
  margin-bottom: 12px;
}

.preview-heading h3,
.preview-heading p {
  margin: 0;
}

.preview-heading p {
  color: var(--muted);
  font-size: 0.65rem;
}

.preview-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.preview-tab {
  min-height: 36px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.71rem;
  font-weight: 700;
}

.preview-tab:hover {
  color: var(--ink);
}

.preview-tab.is-active {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.preview-panel {
  min-height: 250px;
  max-height: 390px;
  overflow: auto;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
}

.preview-panel pre {
  padding: 20px;
  margin: 0;
  color: #2d4053;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono CJK TC", monospace;
  font-size: 0.76rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dialog-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 25px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}

.dialog-footer .danger-button {
  margin-right: auto;
}

/* Footer and toast */
.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(24px, 4vw, 54px) 23px;
  color: var(--muted-light);
  font-size: 0.65rem;
}

.workspace-footer p {
  margin: 0;
}

.toast-region {
  position: fixed;
  z-index: 600;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100% - 44px));
  gap: 9px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  box-shadow: 0 13px 34px rgb(9 24 37 / 24%);
  animation: toast-in 170ms ease-out;
}

.toast.is-error {
  background: #773736;
}

.toast.is-success {
  background: #175f4b;
}

.toast-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  background: rgb(255 255 255 / 13%);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 850;
}

.toast p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

@keyframes breathe {
  to { transform: scale(1.05); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  }

  .upload-card {
    grid-template-columns: 1fr;
  }

  .upload-copy p {
    max-width: none;
  }

  .inbox-item {
    grid-template-columns: 42px minmax(180px, 1fr) minmax(110px, 0.5fr) auto;
  }

  .inbox-item .inbox-meta:nth-of-type(2) {
    display: none;
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }

  th:first-child { width: 38%; }
  th:nth-child(2) { width: 20%; }
  th:nth-child(4) { width: 27%; }
  th:last-child { width: 15%; }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 218px;
  }

  .login-view {
    grid-template-columns: minmax(360px, 0.9fr) minmax(390px, 1.1fr);
  }

  .login-story-inner {
    width: min(590px, calc(100% - 54px));
  }

  .login-story h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
  }

  .login-panel {
    padding: 40px;
  }

  .sidebar-brand {
    padding-inline: 18px;
  }

  .topbar-user,
  .logout-button {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    order: -1;
  }

  .workflow-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .workflow-list li {
    grid-template-columns: 1fr;
  }

  .workflow-list li:not(:last-child)::after {
    display: none;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-view {
    display: block;
    min-height: 100vh;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 34px 25px;
  }

  .mobile-brand {
    display: flex;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    min-height: 72px;
    padding: 12px 18px;
  }

  .topbar h1 {
    font-size: 1.25rem;
  }

  .compact-button span:last-child {
    display: none;
  }

  .compact-button {
    width: 39px;
    padding: 0;
  }

  .mobile-nav {
    position: sticky;
    z-index: 70;
    top: 72px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgb(255 255 255 / 96%);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-button {
    display: grid;
    min-height: 55px;
    place-items: center;
    align-content: center;
    gap: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.64rem;
    font-weight: 700;
  }

  .mobile-nav-button span {
    font-size: 1rem;
    line-height: 1.2;
  }

  .mobile-nav-button.is-active {
    color: var(--teal-dark);
    background: var(--teal-soft);
    border-bottom-color: var(--teal);
  }

  .mobile-nav.is-three-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-content {
    padding: 27px 16px 43px;
  }

  .welcome-row,
  .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-row .primary-button,
  .view-heading .secondary-button {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-card {
    min-height: 122px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
    padding: 16px;
  }

  .summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .summary-card strong {
    font-size: 1.7rem;
  }

  .summary-card em {
    display: none;
  }

  .workflow-list {
    grid-template-columns: 1fr 1fr;
  }

  .upload-card {
    padding: 18px;
  }

  .upload-options {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-options .primary-button {
    width: 100%;
  }

  .inbox-item {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 16px;
  }

  .inbox-item .inbox-meta {
    display: none;
  }

  .inbox-actions {
    flex-direction: column;
  }

  .inbox-actions .drive-link {
    display: none;
  }

  .jobs-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .table-region {
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  tbody tr {
    padding: 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  tbody tr:hover {
    background: #fff;
  }

  td,
  td:nth-child(3) {
    display: block;
    padding: 7px 0;
    border: 0;
  }

  td:first-child {
    padding-top: 0;
  }

  td:last-child {
    padding-bottom: 0;
  }

  .job-time-cell {
    display: none !important;
  }

  .job-output-cell {
    padding-left: 49px;
  }

  .job-actions-cell .detail-link {
    width: 100%;
    color: var(--teal-dark);
    background: var(--teal-soft);
  }

  .job-dialog {
    width: 100%;
    max-width: none;
    max-height: 94vh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .dialog-layout {
    max-height: 94vh;
  }

  .dialog-header,
  #dialog-content,
  .dialog-footer {
    padding-inline: 17px;
  }

  .job-meta {
    grid-template-columns: 1fr 1fr;
    gap: 12px 0;
  }

  .job-meta > div:nth-child(2) {
    border-right: 0;
  }

  .job-meta > div:nth-child(3) {
    padding-left: 0;
  }

  .preview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .preview-tabs {
    overflow-x: auto;
  }

  .preview-tab {
    flex: 1 0 auto;
  }

  .workspace-footer {
    display: none;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }
}

@media (max-width: 420px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 103px;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .workflow-list {
    grid-template-columns: 1fr;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .filter-button {
    width: 100%;
  }

  .inbox-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .inbox-item .file-type-icon {
    width: 34px;
    height: 34px;
  }

  .inbox-actions {
    grid-column: 1 / -1;
  }

  .inbox-actions .process-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
