:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --text: #18201d;
  --muted: #66736c;
  --line: #dce3dd;
  --accent: #126c5a;
  --accent-2: #d84c31;
  --danger: #9d2832;
  --shadow: 0 18px 45px rgba(24, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.file-warning {
  background: #fff8e6;
  border-bottom: 1px solid #f0c36d;
  color: #715112;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 12px 16px;
}

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

code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #18201d;
  color: #f7fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0b84f;
  color: #18201d;
  font-weight: 800;
}

.brand small {
  display: block;
  color: #b8c7bf;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 11px 12px;
  border-radius: 7px;
  color: #cbd8d0;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0;
}

h2 {
  font-size: 1.1rem;
}

.button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.ghost:hover {
  border-color: var(--accent);
}

.button[aria-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

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

.toolbar {
  display: flex;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.search {
  flex: 1;
}

.deck-list {
  display: grid;
  gap: 12px;
}

.deck-card,
.panel,
.empty,
.dropzone {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.deck-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 18px;
}

.deck-card h2 {
  margin-bottom: 6px;
}

.meta,
.description,
.muted {
  color: var(--muted);
}

.description {
  margin-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.deck-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty {
  text-align: center;
  padding: 52px 24px;
}

.notice {
  border: 1px solid #f0c36d;
  background: #fff8e6;
  color: #715112;
  border-radius: 7px;
  padding: 12px 14px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.dropzone {
  min-height: 440px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  position: relative;
  border-style: dashed;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #f1faf7;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-row input {
  width: 18px;
  min-height: 18px;
}

progress {
  width: 100%;
  height: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .main {
    padding: 20px;
  }

  .upload-layout,
  .settings-grid,
  .deck-card {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .deck-actions {
    justify-content: stretch;
  }

  .deck-actions .button {
    flex: 1;
  }
}
