:root {
  --bg: #f7f4ee;
  --surface: rgba(255, 253, 249, 0.88);
  --surface-2: #f2eee7;
  --surface-3: #ebe5db;
  --border: #ded7cc;
  --border-strong: #cac0b3;
  --text: #111111;
  --text-muted: #666666;
  --text-soft: #8a8378;
  --accent: #20764f;
  --accent-2: #2f9466;
  --accent-soft: rgba(32, 118, 79, 0.12);
  --danger: #ef5b64;
  --danger-soft: rgba(239, 91, 100, 0.12);
  --shadow-sm: 0 1px 2px rgba(32, 24, 16, 0.05);
  --shadow-md: 0 16px 38px rgba(55, 45, 34, 0.08);
  --shadow-lg: 0 28px 70px rgba(55, 45, 34, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --control: #fffdf9;
  --control-hover: #ffffff;
  --focus: rgba(32, 118, 79, 0.18);
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: rgba(22, 24, 29, 0.9);
  --surface-2: #191c22;
  --surface-3: #20242b;
  --border: #2b3039;
  --border-strong: #3a414d;
  --text: #f4f6f8;
  --text-muted: #a4abb6;
  --text-soft: #737c8b;
  --accent: #4cce8d;
  --accent-2: #65dda2;
  --accent-soft: rgba(76, 206, 141, 0.13);
  --danger: #ff6b75;
  --danger-soft: rgba(255, 107, 117, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.36);
  --control: #11141a;
  --control-hover: #171b22;
  --focus: rgba(76, 206, 141, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 30% -15%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 88%, #fff 12%));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 28% -10%, rgba(76, 206, 141, 0.09), transparent 34%),
    linear-gradient(180deg, #101217, var(--bg));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

svg {
  display: block;
}

code {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-family: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell {
  width: min(1440px, calc(100% - 72px));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(22px);
}

.header-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 26px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 22px rgba(32, 118, 79, 0.24);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.app-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.42rem;
  font-weight: 760;
  line-height: 1.1;
}

.app-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  white-space: nowrap;
}

.current-user {
  padding-left: 18px;
  border-left: 1px solid var(--border);
  font-size: 0.95rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 640;
  padding: 7px 14px 7px 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--control-hover);
  transform: translateY(-1px);
}

.theme-icon svg {
  width: 17px;
  height: 17px;
}

.theme-toggle-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 19px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease;
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(-16px);
}

.app-main {
  padding: 28px 0 44px;
}

.fade-in {
  animation: fade-in 240ms ease both;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.74fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.upload-panel,
.recent-panel,
.history-panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 740;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-group {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.field-group > label,
.queue-header {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.input,
.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--text);
  outline: none;
  padding: 0 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.input:focus,
.auth-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--control-hover);
  box-shadow: 0 0 0 4px var(--focus);
}

.input-shell {
  position: relative;
}

.search-shell .input {
  padding-right: 44px;
}

.search-shell svg {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.compact-input {
  min-height: 46px;
}

.project-list {
  display: grid;
  max-height: 270px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 78%, var(--surface-2));
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.project-list::-webkit-scrollbar {
  width: 9px;
}

.project-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: content-box;
}

.check-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 43px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  transition: background 180ms ease, color 180ms ease;
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.check-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--control);
  transition: border-color 180ms ease, background 180ms ease;
}

.check-box::after {
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.check-row input:checked + .check-box {
  border-color: var(--accent);
  background: var(--accent);
}

.check-row input:checked + .check-box::after {
  opacity: 1;
}

.project-name {
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation,
.status-line {
  min-height: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.recommendation strong,
.status-line.success {
  color: var(--accent);
}

.status-line.error {
  color: var(--danger);
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 112px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 48%, var(--border));
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent),
    color-mix(in srgb, var(--surface) 90%, var(--accent-soft));
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  display: grid;
  justify-items: center;
  gap: 7px;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.drop-icon svg {
  width: 34px;
  height: 34px;
}

.drop-zone strong {
  color: var(--text);
  font-size: 0.96rem;
}

.drop-zone span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.file-queue {
  display: grid;
  gap: 10px;
}

.queue-row,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.queue-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.queue-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.queue-thumb img,
.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.queue-meta strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.rename-input {
  min-height: 36px;
}

.recent-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 26px;
}

.recent-list,
.history-list {
  display: grid;
  gap: 14px;
}

.file-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 116px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  padding: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.file-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.file-preview {
  display: grid;
  place-items: center;
  width: 112px;
  height: 78px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.file-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.file-body strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-body span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.button,
.icon-button,
.link-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 760;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-primary {
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(32, 118, 79, 0.22);
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(32, 118, 79, 0.27);
}

.button-secondary,
.button-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--border-strong);
  background: var(--control-hover);
  transform: translateY(-1px);
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  min-height: 40px;
  padding: 0 11px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.action-emoji {
  font-size: 1rem;
  line-height: 1;
}

.action-label {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--control-hover);
  transform: translateY(-1px);
}

.icon-button.is-copied {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-button.danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button[data-tooltip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 5;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  content: attr(data-tooltip);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.icon-button[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--accent);
}

.link-button:hover {
  color: var(--accent-2);
}

.link-button.is-copied {
  color: var(--accent);
  font-weight: 820;
}

.copy-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 0.92rem;
  font-weight: 780;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 14px 16px;
  color: var(--text-muted);
}

.history-panel {
  margin-top: 28px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 14px 170px minmax(190px, 0.9fr) minmax(0, 1.1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
  padding: 13px 16px;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-time,
.timeline-row span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-empty {
  min-height: 58px;
}

.timeline-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--accent);
  background: var(--control);
}

.timeline-icon svg {
  width: 19px;
  height: 19px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.flash-error {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  color: var(--danger);
}

body.auth-body {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.88), transparent 38%),
    var(--bg);
  color: var(--text);
}

[data-theme="dark"] body.auth-body {
  background:
    radial-gradient(circle at 50% 0%, rgba(76, 206, 141, 0.12), transparent 34%),
    var(--bg);
}

.auth-body .app-header {
  display: none;
}

.auth-body .shell {
  width: min(100%, 100vw);
}

.auth-body .app-main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px 34px;
}

.auth-page {
  position: relative;
  width: min(1240px, 100%);
}

.auth-theme-toggle {
  position: absolute;
  top: -58px;
  right: 0;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 746px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 74%, #fff);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-width: 0;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(132deg, color-mix(in srgb, var(--surface) 72%, #fff), color-mix(in srgb, var(--surface-2) 82%, transparent)),
    var(--surface);
}

.auth-copy {
  position: relative;
  z-index: 2;
  width: min(470px, calc(100% - 80px));
  margin: 0 auto;
  transform: translateY(-20px);
}

.auth-folder-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 38px;
  color: var(--text);
}

.auth-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(3rem, 4.8vw, 4.35rem);
  line-height: 1;
  font-weight: 860;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 440px;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: clamp(1.18rem, 1.7vw, 1.55rem);
  line-height: 1.55;
}

.auth-folds {
  position: absolute;
  left: -120px;
  bottom: -150px;
  width: 520px;
  height: 420px;
  pointer-events: none;
  transform: rotate(-7deg);
}

.fold {
  position: absolute;
  display: block;
  border-radius: 50% 50% 0 0;
  transform-origin: bottom left;
}

.fold-one {
  left: 0;
  bottom: 0;
  width: 440px;
  height: 250px;
  background: linear-gradient(122deg, rgba(255, 255, 255, 0.9), rgba(224, 216, 203, 0.4), rgba(176, 164, 145, 0.24));
  box-shadow: 18px -18px 34px rgba(138, 126, 108, 0.13), inset -12px 18px 22px rgba(255, 255, 255, 0.72);
  transform: skewX(28deg);
}

.fold-two {
  left: 54px;
  bottom: 18px;
  width: 410px;
  height: 225px;
  border-left: 7px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(118deg, rgba(249, 247, 243, 0.72), rgba(219, 213, 202, 0.28));
  box-shadow: -14px 0 26px rgba(114, 104, 88, 0.11);
  transform: skewX(30deg) rotate(9deg);
}

.fold-three {
  left: 154px;
  bottom: 46px;
  width: 320px;
  height: 170px;
  border-left: 5px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.5), rgba(210, 203, 190, 0.24));
  box-shadow: -10px 0 28px rgba(111, 101, 84, 0.1);
  transform: skewX(30deg) rotate(18deg);
}

[data-theme="dark"] .fold-one,
[data-theme="dark"] .fold-two,
[data-theme="dark"] .fold-three {
  opacity: 0.25;
}

.auth-form {
  display: grid;
  place-items: center;
  min-width: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.auth-form-inner {
  width: min(418px, calc(100% - 64px));
}

.auth-form-header {
  margin-bottom: 50px;
}

.auth-form-header h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.1;
  font-weight: 820;
}

.auth-form-header p {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 1.22rem;
  line-height: 1.55;
}

.login-alert {
  margin: -24px 0 24px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border));
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.95rem;
}

.auth-field {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 1.03rem;
  font-weight: 760;
}

.auth-field input {
  min-height: 64px;
  padding: 0 20px;
  font-size: 1.03rem;
  font-weight: 720;
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap input {
  padding-right: 58px;
}

.auth-eye {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  color: var(--text);
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-submit {
  width: 100%;
  min-height: 64px;
  margin: 8px 0 26px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #191c20 0%, #111418 100%);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 13px 24px rgba(17, 20, 24, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.auth-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-forgot {
  display: block;
  color: var(--text-muted);
  font-size: 1.05rem;
  text-align: center;
}

.auth-divider {
  height: 1px;
  margin: 40px 0 26px;
  background: var(--border);
}

.auth-corporate {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 1100px) {
  .shell {
    width: min(100% - 36px, 1440px);
  }

  .workspace-grid {
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1fr);
  }

  .file-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .file-preview {
    width: 92px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .header-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .recent-toolbar {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    grid-template-columns: 14px 1fr;
  }

  .timeline-row .link-button {
    justify-self: start;
  }

  .auth-body .app-main {
    padding: 80px 18px 28px;
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 680px;
    margin: 0 auto;
  }

  .auth-visual {
    min-height: 330px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-copy {
    width: min(500px, calc(100% - 56px));
    transform: none;
  }

  .auth-folder-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 22px;
  }

  .auth-copy h1 {
    font-size: 3rem;
  }

  .auth-copy p {
    max-width: 34rem;
    margin-top: 16px;
    font-size: 1.14rem;
  }

  .auth-form {
    padding: 54px 0;
  }

  .auth-form-inner {
    width: min(460px, calc(100% - 56px));
  }

  .auth-form-header {
    margin-bottom: 34px;
  }

  .auth-folds {
    left: -150px;
    bottom: -195px;
    transform: rotate(-9deg) scale(0.78);
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1440px);
  }

  .app-main {
    padding-top: 20px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .app-header h1 {
    font-size: 1.22rem;
  }

  .app-header p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .current-user {
    width: 100%;
    padding-left: 0;
    border-left: 0;
    white-space: normal;
  }

  .upload-panel,
  .recent-panel,
  .history-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .project-list {
    max-height: 232px;
  }

  .file-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .file-preview {
    width: 72px;
    height: 64px;
  }

  .file-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .icon-button {
    min-width: 0;
  }

  .auth-body .app-main {
    padding: 76px 14px 14px;
  }

  .auth-theme-toggle {
    top: -62px;
    right: 0;
  }

  .auth-card {
    border-radius: 22px;
  }

  .auth-visual {
    min-height: 270px;
  }

  .auth-copy {
    width: min(100% - 42px, 420px);
  }

  .auth-folder-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
  }

  .auth-copy h1 {
    font-size: 2.35rem;
  }

  .auth-copy p,
  .auth-form-header p {
    font-size: 1rem;
  }

  .auth-form {
    padding: 34px 0 38px;
  }

  .auth-form-inner {
    width: min(100% - 38px, 420px);
  }

  .auth-form-header {
    margin-bottom: 28px;
  }

  .auth-form-header h2 {
    font-size: 2rem;
  }

  .auth-field {
    gap: 9px;
    margin-bottom: 19px;
  }

  .auth-field input,
  .auth-submit {
    min-height: 54px;
  }

  .auth-submit {
    margin-bottom: 20px;
    font-size: 1.05rem;
  }

  .auth-divider {
    margin: 28px 0 20px;
  }

  .auth-folds {
    left: -185px;
    bottom: -220px;
    opacity: 0.72;
    transform: rotate(-9deg) scale(0.58);
  }
}
