*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f5f8;
  --bg-soft: #ffffff;
  --ink: #0b1220;
  --muted: #6b7280;
  --accent: #4b6fff;
  --accent-soft: rgba(75, 111, 255, 0.08);
  --border: rgba(15, 23, 42, 0.12);
  --radius-lg: 18px;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.14);
  --card-w: 180px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: radial-gradient(circle at top, #eef1ff, #f4f5f8);
  color: var(--ink);
}

body.dark {
  --bg: #020617;
  --bg-soft: #020617;
  --ink: #f9fafb;
  --muted: #9ca3af;
  --border: rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top, #020617, #020617);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 10px 20px;
}

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

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

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-soft);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 600;
  font-size: 16px;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.icon-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.upload-panel {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 10px;
  margin-bottom: 12px;
}

.lanes-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 8px;
}

.lane-chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.lane-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.photos-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.photo-label {
  font-size: 11px;
  color: var(--muted);
}

.photo-thumb {
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #e5e7eb;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}

.photo-thumb.has-image {
  border-style: solid;
  background-size: cover;
  background-position: center;
}

.primary-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 4px;
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.upload-hint {
  font-size: 11px;
  color: var(--muted);
  min-height: 14px;
}

.deck-panel {
  margin-top: 4px;
}

.deck-heading {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
}

.week-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
}

.day-name {
  font-weight: 500;
  color: var(--ink);
}

.day-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-cards::-webkit-scrollbar {
  height: 4px;
}

.day-cards::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 253, 0.7);
  border-radius: 999px;
}

.card {
  min-width: var(--card-w);
  max-width: var(--card-w);
  background: var(--bg-soft);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.card-lane {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card-title {
  font-size: 12px;
  font-weight: 600;
}

.card-photos {
  display: flex;
  gap: 4px;
  margin: 4px 0;
}

.card-photo {
  flex: 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #e5e7eb;
  min-height: 60px;
}

.card-range-label {
  font-size: 9px;
  color: var(--muted);
}

.card-range {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.card-notes {
  font-size: 10px;
  color: var(--ink);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
}

.dot-private {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  margin-right: 4px;
}

.card-meta-left {
  display: flex;
  align-items: center;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.card-btn {
  border: none;
  background: transparent;
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
}

.card-btn.danger {
  color: #ef4444;
}

.toast-container {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
}

.toast {
  background: #111827;
  color: #f9fafb;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.toast.error {
  background: #b91c1c;
}

.sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}

.sheet.hidden {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.sheet-body {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-soft);
  border-radius: 18px 18px 0 0;
  padding: 10px 12px 14px;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.4);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sheet-header h3 {
  margin: 0;
  font-size: 14px;
}

.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.secondary-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 7px 10px;
  background: transparent;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 11px;
  color: var(--muted);
}

.field input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 12px;
  background: var(--bg);
  color: var(--ink);
}

.small-copy {
  font-size: 11px;
  color: var(--muted);
}
