:root {
  color-scheme: light;
  --ink: #182038;
  --ink-strong: #10162a;
  --muted: #667087;
  --soft: #8d96aa;
  --line: #e3e7f0;
  --line-strong: #d7ddea;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #fff;
  --canvas: #f4f6fb;
  --purple: #635bdf;
  --purple-dark: #4a43c7;
  --purple-soft: #efeeff;
  --mint: #139f87;
  --mint-soft: #e9faf6;
  --blue: #3178e6;
  --danger: #c9465b;
  --danger-soft: #fff0f3;
  --warning: #b67a17;
  --warning-soft: #fff8e8;
  --shadow: 0 24px 68px rgba(37, 45, 78, 0.1);
  --shadow-soft: 0 12px 36px rgba(37, 45, 78, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(86, 86, 190, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 86, 190, 0.025) 1px, transparent 1px),
    var(--canvas);
  background-size: 32px 32px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-login {
  background: #15162e;
}

button,
input,
select {
  font: inherit;
}

button,
label,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(99, 91, 223, 0.26);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.boot-view {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #4d4b7f;
  background: #f7f8fc;
}

.boot-view p {
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.boot-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #e3e2ff;
  border-radius: 18px;
  color: var(--purple);
  background: #fff;
  box-shadow: 0 16px 40px rgba(99, 91, 223, 0.18);
  animation: boot-pulse 1.6s ease-in-out infinite;
}

.boot-mark svg {
  width: 30px;
}

@keyframes boot-pulse {
  50% { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(99, 91, 223, 0.24); }
}

/* Login */

.login-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 36px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(108, 97, 233, 0.22), transparent 32%),
    radial-gradient(circle at 83% 78%, rgba(36, 175, 168, 0.14), transparent 30%),
    linear-gradient(145deg, #111326 0%, #181932 52%, #12152b 100%);
}

.login-view::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.login-aurora {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.login-aurora-one {
  top: -210px;
  left: 30%;
  width: 510px;
  height: 510px;
  background: radial-gradient(circle, rgba(117, 102, 244, 0.24), transparent 68%);
}

.login-aurora-two {
  right: -190px;
  bottom: -240px;
  width: 590px;
  height: 590px;
  background: radial-gradient(circle, rgba(38, 188, 171, 0.16), transparent 68%);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr);
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 72px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 42px 100px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 650px;
  flex-direction: column;
  overflow: hidden;
  padding: 44px 50px 38px;
  background:
    linear-gradient(145deg, rgba(97, 89, 219, 0.13), transparent 46%),
    rgba(18, 20, 45, 0.52);
}

.login-story::after {
  position: absolute;
  right: -90px;
  bottom: 80px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(166, 159, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.login-brand,
.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 11px;
  color: inherit;
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.login-brand strong,
.brand strong {
  color: #918aff;
  font-weight: 780;
}

.login-brand-mark,
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(163, 157, 255, 0.24);
  border-radius: 13px;
  color: #a7a2ff;
  background: rgba(126, 117, 241, 0.13);
  box-shadow: 0 10px 28px rgba(60, 52, 170, 0.22);
}

.login-brand-mark svg,
.brand-mark svg {
  width: 27px;
}

.login-brand-mark .spark,
.brand-mark .brand-spark {
  color: #49d2bd;
  fill: currentColor;
  stroke: none;
}

.story-copy {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin-top: 66px;
}

.story-eyebrow,
.hero-eyebrow,
.tasks-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #aaa5ff;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.story-eyebrow i,
.hero-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4bd1bc;
  box-shadow: 0 0 0 5px rgba(75, 209, 188, 0.12);
}

.story-copy h1 {
  margin: 22px 0 18px;
  color: #f8f8ff;
  font-size: clamp(38px, 4.1vw, 56px);
  font-weight: 740;
  line-height: 1.14;
  letter-spacing: -0.055em;
}

.story-copy h1 span {
  color: #aaa5ff;
}

.story-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(231, 232, 248, 0.68);
  font-size: 15px;
  line-height: 1.85;
}

.story-visual {
  position: relative;
  flex: 1;
  min-height: 235px;
  margin-top: 22px;
}

.visual-orbit {
  position: absolute;
  border: 1px solid rgba(166, 161, 255, 0.14);
  border-radius: 50%;
}

.orbit-one {
  top: 15px;
  left: 28%;
  width: 275px;
  height: 170px;
  transform: rotate(-12deg);
}

.orbit-two {
  top: 54px;
  left: 38%;
  width: 230px;
  height: 135px;
  transform: rotate(18deg);
}

.visual-page {
  position: absolute;
  top: 34px;
  left: 46%;
  width: 135px;
  height: 176px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.page-back {
  opacity: 0.5;
  background: rgba(103, 96, 211, 0.18);
  transform: rotate(-11deg) translate(-35px, 10px);
}

.page-front {
  padding: 25px 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow: 0 25px 48px rgba(0, 0, 0, 0.26);
  transform: rotate(6deg);
  backdrop-filter: blur(10px);
}

.visual-page span {
  color: #aaa5ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.visual-page i {
  display: block;
  height: 3px;
  margin-top: 13px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.visual-page i:nth-of-type(2) { width: 78%; }
.visual-page i:nth-of-type(3) { width: 89%; }
.visual-page i:nth-of-type(4) { width: 63%; }

.visual-page b {
  position: absolute;
  right: 15px;
  bottom: 14px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: #d8fff8;
  font-size: 13px;
  background: rgba(58, 197, 174, 0.22);
}

.visual-chip {
  position: absolute;
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(245, 245, 255, 0.82);
  font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(15, 17, 38, 0.72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.chip-deepseek {
  top: 48px;
  left: 28%;
}

.chip-layout {
  top: 150px;
  left: 69%;
}

.story-points {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.story-points span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(235, 235, 250, 0.65);
  font-size: 12px;
}

.story-points svg {
  width: 17px;
  color: #4bd1bc;
  stroke-width: 2;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 54px;
  color: var(--ink);
  background: #fcfcff;
}

.login-card-top {
  position: absolute;
  top: 35px;
  right: 43px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e6e4f8;
  border-radius: 999px;
  color: #6a668e;
  font-size: 10px;
  font-weight: 680;
  background: #f7f6ff;
}

.privacy-pill svg {
  width: 14px;
}

.server-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #798196;
  font-size: 10px;
}

.server-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ab798;
  box-shadow: 0 0 0 4px rgba(42, 183, 152, 0.1);
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading > span {
  color: var(--purple);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.login-heading h2 {
  margin: 9px 0 9px;
  color: var(--ink-strong);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-field {
  display: grid;
  gap: 9px;
  color: #535d73;
  font-size: 12px;
  font-weight: 650;
}

.login-input {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input > svg {
  position: absolute;
  left: 16px;
  width: 19px;
  color: #9ba2b6;
}

.login-input input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 47px;
  border: 1px solid #dfe3ed;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-input input::placeholder {
  color: #b0b6c6;
}

.login-input input:focus {
  border-color: rgba(99, 91, 223, 0.55);
  box-shadow: 0 0 0 4px rgba(99, 91, 223, 0.09);
}

.password-toggle {
  position: absolute;
  right: 9px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #9aa1b5;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle.is-visible {
  color: var(--purple);
  background: var(--purple-soft);
}

.password-toggle svg {
  width: 19px;
}

.login-message,
.form-message,
.dialog-message {
  padding: 11px 13px;
  border: 1px solid #f0c9d1;
  border-radius: 11px;
  color: #a72f45;
  font-size: 12px;
  line-height: 1.55;
  background: var(--danger-soft);
}

.login-message[data-type="success"],
.dialog-message[data-type="success"] {
  border-color: #bde9de;
  color: #147863;
  background: var(--mint-soft);
}

.login-submit,
.primary-button {
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px 0 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 720;
  background: linear-gradient(135deg, #6f66e9, #5751d1);
  box-shadow: 0 15px 30px rgba(91, 82, 213, 0.25);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.login-submit:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 19px 34px rgba(91, 82, 213, 0.31);
}

.login-submit:disabled,
.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.login-submit svg {
  width: 20px;
}

.button-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-submit.is-busy,
.primary-button.is-busy,
.dialog-primary.is-busy {
  justify-content: center;
  gap: 9px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  color: #8c94a8;
  font-size: 10px;
  line-height: 1.55;
}

.login-footnote svg {
  width: 17px;
  flex: 0 0 auto;
  color: #36a990;
}

/* Authenticated app */

.app-view {
  position: relative;
  min-height: 100vh;
  padding-bottom: 20px;
}

.app-ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.app-ambient-one {
  top: -220px;
  right: -160px;
  width: 610px;
  height: 610px;
  background: radial-gradient(circle, rgba(99, 91, 223, 0.15), transparent 68%);
}

.app-ambient-two {
  bottom: -280px;
  left: -220px;
  width: 670px;
  height: 670px;
  background: radial-gradient(circle, rgba(27, 172, 149, 0.1), transparent 68%);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 74px;
  align-items: center;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(218, 222, 235, 0.8);
  background: rgba(248, 249, 252, 0.82);
  backdrop-filter: blur(18px);
}

.app-header .brand {
  color: var(--ink);
}

.app-header .brand-mark {
  width: 38px;
  height: 38px;
  border-color: #dedcf9;
  color: var(--purple);
  background: linear-gradient(145deg, #fff, #f0efff);
  box-shadow: 0 8px 20px rgba(99, 91, 223, 0.13);
}

.app-header .brand strong {
  color: var(--purple);
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e1e4ee;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.nav-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #687187;
  font-size: 12px;
  font-weight: 660;
  background: transparent;
  cursor: pointer;
}

.nav-button svg {
  width: 17px;
}

.nav-button:hover {
  color: var(--ink);
  background: #f6f6fb;
}

.nav-button.is-active {
  color: var(--purple-dark);
  background: #fff;
  box-shadow: 0 4px 13px rgba(38, 45, 78, 0.1);
}

.nav-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  color: #fff;
  font-size: 9px;
  background: var(--purple);
}

.header-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
}

.account-button {
  display: flex;
  min-width: 178px;
  align-items: center;
  gap: 10px;
  padding: 6px 9px 6px 7px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.account-button:hover {
  border-color: #e1e4ee;
  background: rgba(255, 255, 255, 0.76);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  background: linear-gradient(145deg, #6e66e5, #4f49c7);
}

.account-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.account-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.account-copy small {
  overflow: hidden;
  color: #8c95aa;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button > svg {
  width: 15px;
  color: #8d96aa;
}

.logout-button,
.icon-button,
.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid #e1e5ef;
  border-radius: 11px;
  color: #798298;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.logout-button:hover,
.icon-button:hover {
  border-color: #f0cbd2;
  color: var(--danger);
  background: #fff7f8;
}

.logout-button svg,
.icon-button svg,
.dialog-close svg {
  width: 18px;
}

.app-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.dashboard-hero {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 35px 8px 28px;
}

.hero-eyebrow {
  color: var(--purple);
}

.hero-copy h1 {
  margin: 12px 0 9px;
  color: var(--ink-strong);
  font-size: clamp(29px, 3.2vw, 42px);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.stat-card {
  display: flex;
  min-width: 125px;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(219, 223, 235, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 7px 22px rgba(40, 48, 80, 0.05);
  backdrop-filter: blur(10px);
}

.stat-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 20px;
}

.stat-icon.running {
  color: var(--purple);
  background: var(--purple-soft);
}

.stat-icon.completed {
  color: var(--mint);
  background: var(--mint-soft);
}

.stat-icon.retention {
  color: #748096;
  background: #f0f2f6;
}

.stat-card > span:last-child {
  display: grid;
}

.stat-card strong {
  color: var(--ink-strong);
  font-size: 19px;
  line-height: 1;
}

.stat-card small {
  margin-top: 5px;
  color: #838ca0;
  font-size: 9px;
}

.view-section {
  display: none;
}

.view-section.is-active {
  display: block;
  animation: view-in 0.3s ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(490px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(218, 222, 234, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.upload-panel,
.settings-panel {
  min-height: 620px;
  padding: 30px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.step-number {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid #dedcf7;
  border-radius: 12px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 780;
  background: #f6f5ff;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 3px 0 0;
  color: #8c95a7;
  font-size: 10px;
}

.drop-zone {
  display: flex;
  min-height: 325px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  border: 1.5px dashed #cfd4e3;
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(99, 91, 223, 0.045), transparent 60%),
    rgba(249, 250, 253, 0.74);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--purple);
  background: #f7f6ff;
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid #e0defb;
  border-radius: 23px;
  color: var(--purple);
  background: linear-gradient(145deg, #fff, #efeeff);
  box-shadow: 0 16px 32px rgba(99, 91, 223, 0.13);
}

.upload-icon svg {
  width: 45px;
  stroke-width: 1.45;
}

.drop-zone strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.drop-zone > span:not(.upload-icon) {
  margin-top: 7px;
  color: #7b8499;
  font-size: 12px;
}

.drop-zone small {
  margin-top: 19px;
  color: #a0a8ba;
  font-size: 10px;
}

.file-card {
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px solid #dcdef0;
  border-radius: 18px;
  background: linear-gradient(145deg, #fafaff, #f5f5fd);
}

.file-icon {
  display: grid;
  width: 53px;
  height: 59px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--purple);
  background: #fff;
  box-shadow: 0 8px 22px rgba(54, 55, 94, 0.1);
}

.file-icon svg {
  width: 34px;
}

.file-icon text,
.task-file-mark text {
  fill: currentColor;
  stroke: none;
  font-size: 6px;
  font-weight: 800;
}

.file-info {
  display: grid;
  min-width: 0;
  flex: 1;
}

.file-info strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info small {
  margin-top: 6px;
  color: #8b94a7;
  font-size: 10px;
}

.upload-notes {
  display: grid;
  gap: 11px;
  margin-top: 22px;
}

.upload-notes > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #788297;
  font-size: 10px;
  line-height: 1.55;
}

.upload-notes svg {
  width: 17px;
  flex: 0 0 auto;
  color: #9299b0;
}

.upload-notes p {
  margin: 0;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-fieldset legend,
.field > span:first-child {
  margin-bottom: 9px;
  color: #525c72;
  font-size: 10px;
  font-weight: 690;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mode-card {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 9px;
  padding: 12px 11px;
  border: 1px solid #e0e3ec;
  border-radius: 14px;
  background: #fbfbfd;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.mode-card:hover {
  border-color: #c7c4f0;
  transform: translateY(-1px);
}

.mode-card:has(input:checked) {
  border-color: rgba(99, 91, 223, 0.55);
  background: #f7f6ff;
  box-shadow: 0 0 0 3px rgba(99, 91, 223, 0.06);
}

.mode-card input {
  position: absolute;
  opacity: 0;
}

.mode-preview {
  display: grid;
  width: 48px;
  height: 43px;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 7px 6px;
  border: 1px solid #e1e3eb;
  border-radius: 7px;
  background: #fff;
}

.mode-preview i {
  height: 2px;
  border-radius: 2px;
  background: #aeb4c3;
}

.preview-mono {
  grid-template-columns: 1fr;
}

.preview-mono i:nth-child(2) { width: 75%; }
.preview-mono i:nth-child(4) { width: 60%; }
.preview-dual i:nth-child(odd) { background: #928cec; }
.preview-compare i:nth-child(-n+2) { background: #928cec; }

.mode-copy {
  display: grid;
  min-width: 0;
}

.mode-copy strong {
  overflow: hidden;
  color: #343d53;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-copy small {
  margin-top: 3px;
  color: #979fb0;
  font-size: 8px;
}

.radio-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 1px solid #cdd1dd;
  border-radius: 50%;
  background: #fff;
}

.mode-card:has(input:checked) .radio-mark {
  border: 2px solid #fff;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: end;
  gap: 9px;
  margin-top: 20px;
}

.field {
  display: grid;
  min-width: 0;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field select,
.field > input {
  width: 100%;
  height: 45px;
  padding: 0 38px 0 13px;
  border: 1px solid #dfe3ec;
  border-radius: 11px;
  color: #343d53;
  font-size: 11px;
  font-weight: 620;
  background: #fcfcfd;
  outline: none;
  appearance: none;
}

.field > input {
  padding-right: 13px;
}

.field select:focus,
.field > input:focus {
  border-color: rgba(99, 91, 223, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 91, 223, 0.08);
}

.select-wrap svg {
  position: absolute;
  right: 12px;
  width: 15px;
  color: #9098aa;
  pointer-events: none;
}

.language-arrow {
  display: grid;
  width: 28px;
  height: 45px;
  place-items: center;
  color: #a0a7b7;
}

.language-arrow svg {
  width: 18px;
}

.api-status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
  padding: 11px 12px;
  border: 1px solid #eee0b8;
  border-radius: 13px;
  background: #fffaf0;
}

.api-status-card.is-configured {
  border-color: #cdebe4;
  background: #f2fbf8;
}

.api-status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #a27320;
  background: #fff3d7;
}

.is-configured .api-status-icon {
  color: var(--mint);
  background: #ddf6f0;
}

.api-status-icon svg {
  width: 19px;
}

.api-status-copy {
  display: grid;
  min-width: 0;
}

.api-status-copy small {
  color: #9299a7;
  font-size: 8px;
}

.api-status-copy strong {
  overflow: hidden;
  margin-top: 2px;
  color: #3d465b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-status-badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: #986719;
  font-size: 8px;
  font-weight: 720;
  background: #fff0cb;
}

.api-status-badge[data-state="ready"] {
  color: #147d68;
  background: #dff5ef;
}

.text-button,
.danger-text-button {
  padding: 5px 3px;
  border: 0;
  color: var(--purple);
  font-size: 9px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  color: var(--purple-dark);
  text-decoration: underline;
}

.advanced {
  margin-top: 15px;
  border-top: 1px solid #e8eaf0;
  border-bottom: 1px solid #e8eaf0;
}

.advanced summary {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  color: #626c81;
  font-size: 10px;
  font-weight: 670;
  cursor: pointer;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.advanced summary svg {
  width: 16px;
}

.advanced .chevron {
  transition: transform 0.18s;
}

.advanced[open] .chevron {
  transform: rotate(180deg);
}

.advanced-content {
  display: grid;
  grid-template-columns: 1.7fr 0.7fr;
  gap: 12px;
  padding: 2px 0 15px;
}

.switch-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 2px;
  border-top: 1px solid #eef0f4;
  cursor: pointer;
}

.switch-row:nth-of-type(3) {
  border-top: 0;
}

.switch-row span {
  display: grid;
}

.switch-row strong {
  color: #525c71;
  font-size: 10px;
}

.switch-row small {
  margin-top: 2px;
  color: #989faf;
  font-size: 8px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 35px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #d6dae4;
  transition: background 0.18s;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(30, 38, 64, 0.2);
  content: "";
  transition: transform 0.18s;
}

.switch-row input:checked + i {
  background: var(--purple);
}

.switch-row input:checked + i::after {
  transform: translateX(15px);
}

.form-message {
  margin-top: 13px;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
}

.button-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.button-label svg {
  width: 20px;
}

.button-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
}

.button-arrow svg {
  width: 17px;
}

.submit-hint {
  margin: 8px 0 0;
  color: #9aa1b0;
  font-size: 8px;
  text-align: center;
}

/* Tasks */

.tasks-view {
  padding-bottom: 20px;
}

.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 27px;
}

.tasks-eyebrow {
  color: var(--purple);
  font-size: 9px;
}

.tasks-toolbar h2 {
  margin: 5px 0 3px;
  color: var(--ink-strong);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.tasks-toolbar p {
  margin: 0;
  color: #858ea1;
  font-size: 11px;
}

.refresh-button,
.secondary-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #dfe3ed;
  border-radius: 11px;
  color: #5f687d;
  font-size: 10px;
  font-weight: 670;
  background: #fff;
  cursor: pointer;
}

.refresh-button:hover,
.secondary-button:hover {
  border-color: #c9c6ee;
  color: var(--purple);
  background: #faf9ff;
}

.refresh-button svg {
  width: 17px;
}

.refresh-button.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

.task-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 2px 14px;
  scrollbar-width: none;
}

.task-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  display: inline-flex;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #e0e3ec;
  border-radius: 11px;
  color: #6e778b;
  font-size: 10px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.filter-button span {
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border-radius: 9px;
  color: #9299aa;
  font-size: 8px;
  background: #eef0f4;
}

.filter-button.is-active {
  border-color: var(--purple);
  color: #fff;
  background: var(--purple);
  box-shadow: 0 8px 18px rgba(99, 91, 223, 0.2);
}

.filter-button.is-active span {
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
}

.task-list {
  display: grid;
  gap: 13px;
}

.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 17px;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s, border-color 0.18s;
}

.task-card:hover {
  border-color: #d1d4e4;
  transform: translateY(-1px);
}

.task-file-mark {
  display: grid;
  width: 52px;
  height: 58px;
  place-items: center;
  border: 1px solid #e2e1f7;
  border-radius: 14px;
  color: var(--purple);
  background: #f7f6ff;
}

.task-file-mark svg {
  width: 34px;
}

.task-card[data-status="succeeded"] .task-file-mark {
  border-color: #d4ece6;
  color: var(--mint);
  background: #f0faf7;
}

.task-card[data-status="failed"] .task-file-mark {
  border-color: #f0d8dd;
  color: var(--danger);
  background: #fff5f7;
}

.task-card[data-status="expired"] .task-file-mark {
  border-color: #e2e5eb;
  color: #949baa;
  background: #f5f6f8;
}

.task-main {
  min-width: 0;
}

.task-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.task-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.task-title h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink-strong);
  font-size: 14px;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-topline time {
  flex: 0 0 auto;
  color: #99a0af;
  font-size: 9px;
}

.task-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 750;
}

.task-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-queued {
  color: #8b6d31;
  background: var(--warning-soft);
}

.status-running {
  color: var(--purple);
  background: var(--purple-soft);
}

.status-running i {
  animation: status-pulse 1.25s ease-in-out infinite;
}

@keyframes status-pulse {
  50% { opacity: 0.3; transform: scale(0.75); }
}

.status-succeeded {
  color: #16826d;
  background: var(--mint-soft);
}

.status-failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-expired {
  color: #7f8797;
  background: #f0f2f5;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #7b8498;
  font-size: 9px;
}

.task-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c1c6d1;
}

.task-progress {
  margin-top: 15px;
}

.task-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.task-progress strong {
  color: #545e73;
  font-size: 10px;
}

.task-progress > div span {
  color: var(--purple);
  font-size: 9px;
  font-weight: 700;
}

.progress-track {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #e9ebf2;
  appearance: none;
}

.progress-track::-webkit-progress-bar {
  border-radius: 5px;
  background: #e9ebf2;
}

.progress-track::-webkit-progress-value {
  border-radius: 5px;
  background: linear-gradient(90deg, #6962e7, #8b62dd, #22ae95);
  transition: width 0.5s ease;
}

.progress-track::-moz-progress-bar {
  border-radius: 5px;
  background: linear-gradient(90deg, #6962e7, #8b62dd, #22ae95);
  transition: width 0.5s ease;
}

.task-progress small {
  display: block;
  margin-top: 6px;
  color: #9ca3b2;
  font-size: 8px;
}

.task-finished-note {
  margin-top: 13px;
  color: #70798d;
  font-size: 10px;
}

.task-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid #f2d5db;
  border-radius: 10px;
  color: #a23d50;
  font-size: 9px;
  line-height: 1.55;
  background: #fff7f8;
}

.task-error svg {
  width: 16px;
  flex: 0 0 auto;
}

.task-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #eceef3;
}

.retention-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #969dac;
  font-size: 8px;
}

.retention-note svg {
  width: 15px;
}

.task-downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.download-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #d9d8ef;
  border-radius: 11px;
  color: var(--purple);
  background: #f8f7ff;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.download-button:hover {
  border-color: var(--purple);
  background: #f1efff;
  transform: translateY(-1px);
}

.download-button > svg {
  width: 17px;
}

.download-button > span {
  display: grid;
}

.download-button strong {
  font-size: 9px;
}

.download-button small {
  margin-top: 1px;
  color: #9399ab;
  font-size: 7px;
}

.empty-tasks {
  display: grid;
  min-height: 330px;
  place-content: center;
  justify-items: center;
  padding: 40px;
  text-align: center;
}

.empty-tasks > span {
  display: grid;
  width: 73px;
  height: 73px;
  place-items: center;
  border-radius: 22px;
  color: #8b86d9;
  background: #f1f0fd;
}

.empty-tasks svg {
  width: 42px;
}

.empty-tasks h3 {
  margin: 17px 0 6px;
  color: var(--ink-strong);
  font-size: 16px;
}

.empty-tasks p {
  margin: 0 0 16px;
  color: #8c94a6;
  font-size: 10px;
}

.app-footer {
  display: flex;
  width: min(1240px, calc(100% - 48px));
  min-height: 60px;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  color: #9ba2b0;
  font-size: 8px;
}

.app-footer i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #bdc2cc;
}

.footer-spacer {
  flex: 1;
}

#footer-engine::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #aaa;
  content: "";
}

#footer-engine[data-state="ready"]::before {
  background: var(--mint);
}

#footer-engine[data-state="error"]::before {
  background: var(--danger);
}

/* API key dialog */

.api-dialog {
  width: min(530px, calc(100% - 30px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 23px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 35px 90px rgba(18, 22, 45, 0.28);
}

.api-dialog::backdrop {
  background: rgba(18, 20, 39, 0.55);
  backdrop-filter: blur(7px);
}

.api-dialog-card {
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 23px;
  background: #fff;
}

.dialog-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
}

.dialog-icon {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 14px;
  color: var(--purple);
  background: var(--purple-soft);
}

.dialog-icon svg {
  width: 24px;
}

.dialog-heading > div > span {
  color: var(--purple);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.dialog-heading h2 {
  margin: 3px 0 4px;
  color: var(--ink-strong);
  font-size: 19px;
}

.dialog-heading p {
  margin: 0;
  color: #838b9d;
  font-size: 9px;
  line-height: 1.55;
}

.dialog-close {
  width: 34px;
  height: 34px;
}

.dialog-close:hover {
  color: var(--ink);
  background: #f4f5f8;
}

.saved-key-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 17px;
  padding: 11px 13px;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  background: #f8f9fb;
}

.saved-key-state span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.saved-key-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(19, 159, 135, 0.1);
}

.saved-key-state strong {
  color: #50596e;
  font-size: 10px;
}

.saved-key-state small {
  color: #989faf;
  font-size: 8px;
}

.dialog-field {
  display: grid;
  gap: 8px;
  color: #555f73;
  font-size: 10px;
  font-weight: 660;
}

.dialog-secret {
  position: relative;
  display: flex;
  align-items: center;
}

.dialog-secret input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 13px;
  border: 1px solid #dfe2eb;
  border-radius: 12px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  background: #fcfcfd;
  outline: none;
}

.dialog-secret input:focus {
  border-color: rgba(99, 91, 223, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 91, 223, 0.08);
}

.dialog-secret button {
  position: absolute;
  right: 7px;
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #969eaf;
  background: transparent;
  cursor: pointer;
}

.dialog-secret button:hover,
.dialog-secret button.is-visible {
  color: var(--purple);
  background: var(--purple-soft);
}

.dialog-secret svg {
  width: 18px;
}

.dialog-message {
  margin-top: 12px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 21px;
}

.danger-text-button {
  color: var(--danger);
}

.danger-text-button:hover {
  text-decoration: underline;
}

.dialog-secondary,
.dialog-primary {
  min-height: 39px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.dialog-secondary {
  border: 1px solid #dfe2eb;
  color: #697286;
  background: #fff;
}

.dialog-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  color: #fff;
  background: var(--purple);
}

.dialog-primary:hover {
  background: var(--purple-dark);
}

.dialog-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Toast */

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 260px;
  max-width: min(420px, calc(100% - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid #dce4e1;
  border-radius: 13px;
  color: #405247;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(24, 32, 56, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--mint);
  background: var(--mint-soft);
}

.toast-icon svg {
  width: 16px;
  stroke-width: 2.1;
}

.toast[data-type="error"] {
  border-color: #efd4da;
  color: #8f3b4b;
}

.toast[data-type="error"] .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Responsive */

@media (max-width: 1050px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr) 430px;
  }

  .login-story {
    padding-inline: 38px;
  }

  .login-card {
    padding-inline: 42px;
  }

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

  .upload-panel,
  .settings-panel {
    min-height: auto;
  }

  .drop-zone {
    min-height: 270px;
  }

  .app-header {
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding-inline: 24px;
  }

  .main-nav {
    justify-self: center;
  }

  .dashboard-hero {
    align-items: flex-end;
  }
}

@media (max-width: 820px) {
  .login-view {
    padding: 22px;
  }

  .login-shell {
    display: block;
    min-height: calc(100vh - 44px);
    max-width: 520px;
  }

  .login-story {
    min-height: 245px;
    padding: 30px;
  }

  .story-copy {
    margin-top: 35px;
  }

  .story-copy h1 {
    margin-block: 14px 10px;
    font-size: 35px;
  }

  .story-copy p {
    font-size: 12px;
  }

  .story-visual,
  .story-points {
    display: none;
  }

  .login-card {
    min-height: 455px;
    padding: 73px 36px 35px;
  }

  .login-card-top {
    top: 275px;
    right: 34px;
  }

  .app-header {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    padding-inline: 18px;
  }

  .main-nav {
    position: static;
    z-index: auto;
    grid-column: 2;
    grid-row: 1;
    width: min(100%, 300px);
    justify-self: center;
    justify-content: stretch;
    border-color: rgba(218, 221, 233, 0.9);
    box-shadow: 0 5px 18px rgba(31, 38, 66, 0.08);
  }

  .nav-button {
    flex: 1;
    justify-content: center;
    padding-inline: 8px;
  }

  .app-header .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .app-header .brand > span:last-child {
    display: none;
  }

  .account-copy,
  .account-button > svg,
  .logout-button {
    display: none;
  }

  .account-button {
    min-width: 0;
    padding: 0;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .account-avatar {
    width: 38px;
    height: 38px;
  }

  .app-shell {
    width: min(100% - 28px, 680px);
  }

  .dashboard-hero {
    display: block;
    padding-top: 27px;
  }

  .hero-stats {
    margin-top: 22px;
  }

  .stat-card {
    min-width: 0;
  }

  .app-footer {
    width: calc(100% - 30px);
  }

  .app-footer > span:nth-child(3),
  .app-footer > i {
    display: none;
  }
}

@media (max-width: 620px) {
  .login-view {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-story {
    min-height: 215px;
    padding: 25px 23px;
  }

  .story-copy {
    margin-top: 27px;
  }

  .story-copy h1 {
    font-size: 30px;
  }

  .story-copy p {
    display: none;
  }

  .login-card {
    min-height: calc(100vh - 215px);
    padding: 69px 23px 28px;
  }

  .login-card-top {
    top: 238px;
    right: 22px;
    left: 22px;
    justify-content: space-between;
  }

  .login-heading h2 {
    font-size: 26px;
  }

  .dashboard-hero {
    min-height: auto;
    padding-bottom: 22px;
  }

  .hero-copy h1 {
    font-size: 29px;
  }

  .hero-copy p {
    font-size: 11px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .stat-card {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 10px 4px;
    text-align: center;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
  }

  .stat-card strong {
    font-size: 16px;
  }

  .upload-panel,
  .settings-panel {
    padding: 21px;
    border-radius: 20px;
  }

  .drop-zone {
    min-height: 245px;
    padding: 24px 16px;
  }

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

  .mode-card {
    grid-template-columns: 48px 1fr;
  }

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

  .language-arrow {
    height: 18px;
    justify-self: center;
    transform: rotate(90deg);
  }

  .api-status-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .api-status-badge {
    display: none;
  }

  .advanced-content {
    grid-template-columns: 1fr;
  }

  .tasks-toolbar {
    padding: 20px;
  }

  .task-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .task-file-mark {
    display: none;
  }

  .task-topline {
    display: block;
  }

  .task-topline time {
    display: block;
    margin-top: 7px;
  }

  .task-title {
    align-items: flex-start;
  }

  .task-title h3 {
    padding-top: 3px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .task-bottom {
    display: grid;
    align-items: start;
  }

  .task-downloads {
    justify-content: stretch;
  }

  .download-button {
    flex: 1;
    justify-content: center;
  }

  .api-dialog-card {
    padding: 22px 18px;
  }

  .dialog-icon {
    width: 39px;
    height: 39px;
  }

  .saved-key-state {
    display: grid;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions > span {
    display: none;
  }

  .danger-text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .toast {
    right: 16px;
    bottom: 84px;
    left: 16px;
    min-width: 0;
  }
}

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