:root {
  color-scheme: light;
  --ink: #182d2b;
  --muted: #5b6d69;
  --paper: #fffdf8;
  --canvas: #f1f4ef;
  --line: #cbd5ce;
  --accent: #17665d;
  --accent-dark: #0e4a43;
  --accent-soft: #e5f1ed;
  --warning: #8b4b17;
  --warning-soft: #fff1df;
  --danger: #9a382f;
  --shadow: 0 18px 50px rgba(27, 54, 49, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(210, 229, 218, 0.75), transparent 32rem),
    var(--canvas);
  font-size: 16px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
.file-label {
  min-height: 48px;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

:focus-visible {
  outline: 3px solid #d37d25;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: white;
  background: var(--accent-dark);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid rgba(203, 213, 206, 0.85);
  background: rgba(255, 253, 248, 0.9);
}

.header-inner,
.page-shell {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  min-height: 70px;
  padding-block: 1rem;
}

.brand,
.eyebrow,
.section-kicker,
.field-label,
.batch-id {
  margin: 0;
}

.brand {
  font-size: 1.05rem;
  font-weight: 720;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-shell {
  padding-block: clamp(1.5rem, 5vw, 4.5rem);
}

.card {
  border: 1px solid rgba(188, 202, 193, 0.9);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 480px);
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 2.5rem);
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin-top: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.85rem, 6vw, 3.2rem);
}

h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.section-kicker + h1,
.section-kicker + h2 {
  margin-top: 0.45rem;
}

.intro,
.quiet {
  color: var(--muted);
}

.intro {
  max-width: 46rem;
  margin: 0;
}

form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.7rem;
}

label,
.field-label {
  font-weight: 680;
}

input[type="password"] {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #8fa49d;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 1.25rem;
  letter-spacing: 0.25em;
}

.primary-button,
.secondary-button,
.text-button,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.72rem 1.05rem;
  font-weight: 720;
  text-align: center;
  text-decoration: none;
}

.primary-button,
.file-label {
  color: white;
  background: var(--accent);
}

.primary-button:hover,
.file-label:hover {
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid #8da099;
  color: var(--ink);
  background: white;
}

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

.message {
  min-height: 1.55em;
  margin-bottom: 0;
  color: var(--danger);
  font-weight: 650;
}

.welcome-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.compact-button {
  flex: 0 0 auto;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 1.25rem;
  align-items: start;
}

.upload-card,
.recent-card,
.note-card,
.session-card {
  padding: clamp(1rem, 3vw, 1.7rem);
}

.card-heading,
.status-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.limit-chip {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.drop-zone {
  margin-top: 1rem;
  padding: clamp(1rem, 4vw, 2.2rem);
  border: 2px dashed #8fa49d;
  border-radius: 14px;
  background: #f8fbf7;
  text-align: center;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 740;
}

.file-label {
  margin-top: 0.45rem;
}

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

.visually-hidden:focus-visible + .file-label {
  outline: 3px solid #d37d25;
  outline-offset: 3px;
}

.batch-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.batch-status {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  font-weight: 760;
}

.batch-id {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.file-list,
.recent-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid #e2e8e2;
}

.file-name {
  margin: 0;
  font-weight: 680;
}

.file-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.duplicate-badge {
  width: fit-content;
  margin: 0.25rem 0 0;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--accent);
}

.resume-tools {
  margin: 1rem 0;
  padding: 0.9rem;
  border-radius: 12px;
  background: var(--warning-soft);
}

.resume-tools .quiet {
  margin-top: 0;
  color: #704216;
}

.secondary-label {
  margin-top: 0;
  color: var(--accent-dark);
  background: white;
  border: 1px solid #8da099;
}

.side-column {
  display: grid;
  gap: 1rem;
}

.recent-item + .recent-item {
  margin-top: 0.65rem;
}

.recent-button {
  width: 100%;
  min-height: 54px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #f8faf7;
  text-align: left;
}

.recent-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.recent-button span {
  display: block;
}

.recent-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
}

.empty-state {
  margin-bottom: 0;
  color: var(--muted);
}

.note-card p:last-child,
.session-card button:last-child {
  margin-bottom: 0;
}

.session-card button {
  width: 100%;
  margin-top: 0.5rem;
}

@media (max-width: 760px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .welcome-row,
  .card-heading,
  .status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-button,
  .primary-button,
  .secondary-button,
  .text-button,
  .file-label {
    width: 100%;
  }

  .batch-id {
    word-break: break-all;
  }
}

@media (max-width: 380px) {
  .header-inner,
  .page-shell {
    width: min(100% - 1rem, 1120px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .card {
    border-radius: 14px;
  }

  .file-item {
    grid-template-columns: 1fr;
  }

  .file-state {
    text-align: left;
  }
}

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