/* ============================================
   LOOM · Premium PWA
   Palette: plum / dusty-rose / copper / cream
   ============================================ */

:root {
  /* Surface */
  --bg-0: #1a0e1a;
  --bg-1: #241324;
  --bg-2: #2d1a2d;
  --bg-3: #3a233a;

  /* Plum family */
  --plum-50:  #f3e9ef;
  --plum-200: #c89aa3;
  --plum-300: #a76d80;
  --plum-500: #7c4a6e;
  --plum-700: #4f2a4a;
  --plum-900: #2d1729;

  /* Accent */
  --copper-300: #e5b18f;
  --copper-500: #c97f5a;
  --copper-700: #8d4a30;

  /* Neutrals */
  --cream-0: #f3ecdf;
  --cream-1: #ddd1bd;
  --cream-2: #a89a86;

  /* Semantic */
  --text-0: #f3ecdf;
  --text-1: #d6c5b8;
  --text-2: #9b8a7c;
  --text-3: #7a6a60;
  --line:   rgba(243, 236, 223, 0.08);
  --line-2: rgba(243, 236, 223, 0.16);

  /* Glass */
  --glass:   rgba(45, 23, 41, 0.55);
  --glass-2: rgba(60, 32, 55, 0.65);
  --glass-b: rgba(243, 236, 223, 0.07);

  /* Motion */
  --spring: cubic-bezier(.34,1.56,.64,1);
  --easeo:  cubic-bezier(.22,1,.36,1);

  /* Radii / shadows */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --shadow-card: 0 10px 40px rgba(0,0,0,.32), 0 1px 0 rgba(243,236,223,.05) inset;
  --shadow-fab:  0 18px 40px rgba(124,74,110,.45), 0 4px 12px rgba(0,0,0,.4);

  /* Fonts */
  --f-serif: "Frank Ruhl Libre", "Heebo", serif;
  --f-ital:  "Instrument Serif", "Frank Ruhl Libre", serif;
  --f-mono:  "IBM Plex Mono", ui-monospace, monospace;
  --f-sans:  "Heebo", ui-sans-serif, system-ui, sans-serif;
}

/* moods */
body[data-mood="dawn"] {
  --bg-0: #1a1417;
  --bg-1: #251a1f;
  --bg-2: #2e1f25;
  --copper-500: #d99576;
}
body[data-mood="night"] {
  --bg-0: #0d0c1a;
  --bg-1: #15132a;
  --bg-2: #1d1b3a;
  --plum-500: #8c6ba6;
  --copper-500: #b08fc7;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg-0);
  color-scheme: dark;
}

body {
  font-family: var(--f-sans);
  color: var(--text-0);
  background:
    radial-gradient(1100px 700px at 90% -10%, rgba(201,127,90,0.16), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(124,74,110,0.22), transparent 65%),
    radial-gradient(800px 700px at 50% 110%, rgba(167,109,128,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 40%, var(--bg-0) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* Grain & ambient orbs */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: .35; mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.92 0 0 0 0 0.87 0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: orbFloat 18s ease-in-out infinite;
}
.orb-1 { width: 360px; height: 360px; top: -100px; right: -120px; background: radial-gradient(circle, rgba(201,127,90,.55), transparent 70%); }
.orb-2 { width: 480px; height: 480px; bottom: -180px; left: -160px; background: radial-gradient(circle, rgba(124,74,110,.55), transparent 70%); animation-delay: -6s; }
.orb-3 { width: 280px; height: 280px; top: 40%; left: 55%; background: radial-gradient(circle, rgba(167,109,128,.32), transparent 70%); animation-delay: -12s; }
@keyframes orbFloat {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(-30px,40px,0) scale(1.06); }
}

/* Layout */
.shell {
  position: relative; z-index: 2;
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 22px 96px;
}

/* App bar */
.appbar {
  position: relative; z-index: 5;
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 22px 4px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(140deg, rgba(243,236,223,.08), rgba(124,74,110,.4));
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.brand-text h1 {
  margin: 0; font-family: var(--f-serif); font-weight: 700;
  font-size: 26px; letter-spacing: .5px;
  background: linear-gradient(120deg, var(--cream-0), var(--copper-300) 60%, var(--plum-200));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-tag {
  margin: 2px 0 0; font-family: var(--f-ital); font-style: italic;
  font-size: 13px; color: var(--text-2); letter-spacing: .3px;
}
.appbar-actions { display: flex; gap: 8px; }

.iconbtn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--glass);
  border: 1px solid var(--line-2);
  color: var(--text-1);
  cursor: pointer;
  transition: transform .25s var(--spring), background .25s, color .25s, border-color .25s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.iconbtn:hover { transform: translateY(-2px); color: var(--copper-300); border-color: rgba(201,127,90,.45); }
.iconbtn:active { transform: scale(.96); }
.iconbtn.alt { width: 36px; height: 36px; border-radius: 10px; }
.iconbtn.ghost {
  background: transparent; border-color: transparent; font-size: 24px; line-height: 1;
  color: var(--text-2);
}
.iconbtn.ghost:hover { color: var(--copper-300); }

/* CARDS */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 22px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(243,236,223,.06), transparent 40%),
    radial-gradient(800px 300px at -10% -10%, rgba(201,127,90,.10), transparent 70%);
  pointer-events: none;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.card-head h3 {
  margin: 4px 0 0;
  font-size: 24px; line-height: 1.18; font-weight: 600;
  letter-spacing: .2px;
}
.kicker {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--copper-300);
}
.serif { font-family: var(--f-serif); }
.serif.italic { font-family: var(--f-ital); font-style: italic; font-weight: 400; }
.dim { color: var(--text-2); margin: 4px 0 0; font-size: 13.5px; }
.dim.small { font-size: 12px; }
.accent { color: var(--copper-300); }

/* HERO */
.hero {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--glass);
  margin-bottom: 22px;
  min-height: 340px;
}
.hero-photo {
  position: absolute; inset: 0;
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
}
.hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(95deg, rgba(26,14,26,.92) 0%, rgba(26,14,26,.78) 30%, rgba(26,14,26,.36) 60%, rgba(26,14,26,.12) 100%),
    radial-gradient(700px 400px at 90% 100%, rgba(201,127,90,.32), transparent 70%);
}
.hero-content {
  position: relative;
  padding: 40px 36px 36px;
  max-width: 720px;
}
.hero-eyebrow {
  margin: 0 0 18px;
  font-family: var(--f-mono);
  font-size: 11.5px; letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--copper-300);
}
.hero-title {
  margin: 0;
  font-family: var(--f-serif);
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: .96; font-weight: 800;
  letter-spacing: -.5px;
  color: var(--cream-0);
}
.hero-title .italic.accent {
  background: linear-gradient(110deg, var(--copper-300), var(--plum-200) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 400;
  font-family: var(--f-ital);
}
.hero-script { font-family: var(--f-ital); color: var(--copper-300); }
.hero-sub {
  margin: 18px 0 28px;
  font-size: 15.5px; line-height: 1.7;
  color: var(--text-1);
  max-width: 540px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.ks {
  background: rgba(26,14,26,.55);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ks-label {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ks-val {
  display: block;
  font-family: var(--f-mono);
  font-size: 24px; font-weight: 500;
  color: var(--cream-0);
  letter-spacing: -.5px;
}
.ks-val small { font-family: var(--f-sans); font-size: 12px; color: var(--text-2); margin-right: 2px; }

/* TODAY */
.today-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(201,127,90,.14);
  border: 1px solid rgba(201,127,90,.35);
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: .14em;
  color: var(--copper-300);
}
.today-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--copper-500); box-shadow: 0 0 10px var(--copper-500); }

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}
.thread-chip {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 14px 12px;
  border-radius: 16px;
  background: rgba(26,14,26,.55);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: transform .25s var(--spring), background .25s, border-color .25s;
  user-select: none;
}
.thread-chip:hover { transform: translateY(-2px); }
.thread-chip.on {
  background: linear-gradient(135deg, rgba(201,127,90,.16), rgba(124,74,110,.18));
  border-color: rgba(201,127,90,.6);
  box-shadow: 0 8px 20px rgba(201,127,90,.18);
}
.thread-chip .swatch {
  width: 14px; height: 28px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 0 2px rgba(255,255,255,.04) inset;
}
.thread-chip .meta { flex: 1; min-width: 0; }
.thread-chip .name { font-weight: 600; font-size: 14px; color: var(--text-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-chip .pace { font-family: var(--f-mono); font-size: 11px; color: var(--text-2); letter-spacing: .08em; }
.thread-chip .check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  color: transparent;
  transition: background .25s, border-color .25s, color .25s;
}
.thread-chip.on .check {
  background: var(--copper-500);
  border-color: var(--copper-500);
  color: #1a0e1a;
}

.today-foot { display: flex; gap: 12px; align-items: flex-end; }
.today-foot textarea {
  flex: 1;
  background: rgba(26,14,26,.55);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text-0);
  font-family: inherit;
  font-size: 14px; line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}
.today-foot textarea:focus { border-color: rgba(201,127,90,.5); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--copper-500), var(--plum-500));
  color: #fff;
  border: 0;
  font-weight: 600; font-size: 14px; letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(201,127,90,.32), 0 0 0 1px rgba(255,255,255,.08) inset;
  transition: transform .25s var(--spring), box-shadow .25s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(201,127,90,.45); }
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-1);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s var(--spring);
}
.btn-ghost:hover { color: var(--copper-300); border-color: rgba(201,127,90,.45); transform: translateY(-1px); }
.btn-ghost.as-label { cursor: pointer; }
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(220,90,90,.5);
  color: #f07a7a;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .2s, transform .2s var(--spring);
}
.btn-danger:hover { background: rgba(220,90,90,.16); transform: translateY(-1px); }

/* WEAVE */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line-2);
  gap: 2px;
}
.seg-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--f-mono);
  font-size: 11.5px; letter-spacing: .12em;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.seg-btn:hover { color: var(--text-0); }
.seg-btn.active { background: rgba(201,127,90,.22); color: var(--copper-300); }

.weave-wrap {
  position: relative;
}
.weave-svg {
  width: 100%;
  height: clamp(260px, 38vw, 380px);
  display: block;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(26,14,26,.6), rgba(45,23,41,.4));
  border: 1px solid var(--line);
}
.weave-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 14px;
}
.weave-legend .lg {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-1);
}
.weave-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* TWO COL */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.two-col > .card { margin-bottom: 0; }

/* THREADS LIST */
.thread-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.thread-item {
  position: relative;
  display: grid; grid-template-columns: 4px 1fr auto; gap: 14px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: transform .25s var(--spring), border-color .25s;
}
.thread-item:hover { transform: translateY(-1px); border-color: rgba(201,127,90,.35); }
.thread-item .rail {
  width: 4px; border-radius: 2px;
  background: var(--c);
}
.thread-item .body { min-width: 0; }
.thread-item .name {
  font-weight: 600; font-size: 15px; color: var(--text-0);
  display: flex; align-items: center; gap: 8px;
}
.thread-item .why {
  margin: 2px 0 0;
  font-family: var(--f-ital); font-style: italic;
  font-size: 13px; color: var(--text-2);
}
.thread-item .stats {
  margin-top: 8px;
  display: flex; gap: 10px; align-items: center;
  font-family: var(--f-mono);
  font-size: 11.5px; color: var(--text-2);
  letter-spacing: .08em;
}
.thread-item .stats strong { color: var(--text-0); font-weight: 500; }
.thread-item .stats .sep { color: var(--text-3); }
.thread-item .week-strip {
  display: flex; gap: 3px; align-items: center;
  margin-top: 8px;
}
.thread-item .week-strip span {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--line);
  border: 1px solid var(--line);
  transition: transform .2s var(--spring);
}
.thread-item .week-strip span.on { background: var(--c); border-color: var(--c); box-shadow: 0 0 8px var(--c); }
.thread-item .pace-ring {
  position: relative; width: 56px; height: 56px;
}
.thread-item .pace-ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.thread-item .pace-ring .pace-val {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 13px; font-weight: 500; color: var(--cream-0);
}
.empty-state {
  padding: 28px 18px;
  text-align: center;
  border-radius: 18px;
  background: rgba(26,14,26,.5);
  border: 1px dashed var(--line-2);
}
.empty-state img {
  max-width: 220px; margin: 0 auto 14px; opacity: .85;
  border-radius: 14px;
}
.empty-state p { color: var(--text-1); margin: 6px 0; }
.empty-state .em-tip { font-family: var(--f-ital); font-style: italic; color: var(--text-2); font-size: 14px; }

/* INSIGHTS */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.insight {
  padding: 16px;
  border-radius: 16px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line-2);
}
.i-label {
  margin: 0 0 6px;
  font-family: var(--f-mono);
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--copper-300);
}
.i-val {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 22px; line-height: 1.1; font-weight: 600;
  color: var(--cream-0);
}
.i-spark {
  margin-top: 10px;
  display: flex; gap: 4px; align-items: flex-end;
  height: 32px;
}
.i-spark .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--copper-500), var(--plum-500));
  border-radius: 3px 3px 1px 1px;
  min-height: 4px;
  transition: height .6s var(--spring);
  opacity: .85;
}
.i-spark .bar.peak { background: linear-gradient(180deg, var(--cream-0), var(--copper-500)); opacity: 1; }
.i-spark .bar-label {
  margin-top: 4px;
  font-size: 9px;
  color: var(--text-3);
}

/* FAB */
.fab {
  position: fixed; bottom: 24px; left: 24px;
  z-index: 50;
  width: 60px; height: 60px; border-radius: 50%;
  border: 0;
  background: linear-gradient(140deg, var(--copper-500), var(--plum-500));
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  transition: transform .35s var(--spring);
}
.fab::after {
  content: "";
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid rgba(201,127,90,.35);
  animation: pulseRing 2.6s ease-out infinite;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }
@keyframes pulseRing {
  0% { transform: scale(.85); opacity: .8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* SHEETS / MODALS */
.sheet {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,5,10,.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: end center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.sheet[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.sheet-card {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  padding: 22px;
  transform: translateY(40px);
  transition: transform .35s var(--spring);
  box-shadow: 0 -30px 80px rgba(0,0,0,.55);
}
.sheet-card.lg { max-width: 720px; }
.sheet[aria-hidden="false"] .sheet-card { transform: translateY(0); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.sheet-head h3 { margin: 0; font-size: 22px; }

/* Thread form */
.thread-form { display: grid; gap: 14px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-2);
}
.field input,
.field select {
  background: rgba(26,14,26,.6);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-0);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .2s;
}
.field input:focus,
.field select:focus { border-color: rgba(201,127,90,.5); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.color-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.color-row .sw {
  width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--spring), border-color .2s;
}
.color-row .sw:hover { transform: scale(1.1); }
.color-row .sw.sel { border-color: var(--cream-0); box-shadow: 0 0 0 2px rgba(243,236,223,.2); }

.form-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 4px; }

.manage-list {
  list-style: none; padding: 0; margin: 18px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.manage-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.manage-list li:hover { border-color: rgba(201,127,90,.35); background: rgba(45,23,41,.55); }
.manage-list .ms { width: 12px; height: 24px; border-radius: 3px; background: var(--c); }
.manage-list .mn { flex: 1; font-weight: 500; font-size: 14px; }
.manage-list .mt { font-family: var(--f-mono); font-size: 11px; color: var(--text-2); }

/* History */
.hist-head {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.hist-stat {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(26,14,26,.55);
  border: 1px solid var(--line-2);
}
.hist-stat span { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 4px; }
.hist-stat strong { display: block; font-family: var(--f-mono); font-size: 22px; font-weight: 500; color: var(--cream-0); }

.hist-heat {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}
.hist-heat .cell {
  aspect-ratio: 1/1;
  border-radius: 4px;
  background: var(--line);
  position: relative;
  cursor: pointer;
}
.hist-heat .cell.l1 { background: rgba(201,127,90,.18); }
.hist-heat .cell.l2 { background: rgba(201,127,90,.4); }
.hist-heat .cell.l3 { background: rgba(201,127,90,.7); }
.hist-heat .cell.l4 { background: var(--copper-500); }

.hist-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hist-list li {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line);
}
.hist-list .hd-date { font-family: var(--f-mono); font-size: 12px; color: var(--copper-300); letter-spacing: .12em; }
.hist-list .hd-threads { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.hist-list .hd-threads .pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(45,23,41,.6);
  border: 1px solid var(--line);
}
.hist-list .hd-note { margin-top: 6px; font-family: var(--f-ital); font-style: italic; color: var(--text-1); font-size: 13.5px; }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 4px; }
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row p { margin: 0; }
.set-row p:first-child { font-size: 14.5px; font-weight: 500; color: var(--text-0); }
.set-row input[type="time"],
.set-row select {
  background: rgba(26,14,26,.6);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-0);
  font: inherit;
  font-size: 13.5px;
}
.set-row.danger { margin-top: 10px; }
.setdiv { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

/* About */
.about-body { display: flex; flex-direction: column; gap: 14px; }
.about-lead {
  margin: 0;
  font-size: 22px;
  color: var(--copper-300);
  line-height: 1.4;
}
.about-features {
  list-style: none; padding: 14px 0 0; margin: 0;
  display: grid; gap: 10px;
}
.about-features li {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(26,14,26,.5);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-1);
}
.about-features strong { color: var(--copper-300); margin-left: 8px; font-weight: 600; }

/* Copy footer */
.copy {
  margin-top: 30px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .12em;
}

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translate(-50%, 30px);
  background: rgba(26,14,26,.92);
  color: var(--text-0);
  border: 1px solid rgba(201,127,90,.35);
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 14px;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--spring), opacity .25s;
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* RESPONSIVE */
@media (max-width: 720px) {
  .appbar { padding: 16px 16px 0; }
  .shell { padding: 18px 14px 96px; }
  .hero-content { padding: 30px 22px 26px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ks { padding: 10px 12px; }
  .ks-val { font-size: 20px; }
  .two-col { grid-template-columns: 1fr; gap: 18px; }
  .insight-grid { grid-template-columns: 1fr; }
  .today-foot { flex-direction: column; align-items: stretch; }
  .btn-primary { justify-content: center; }
  .card { padding: 18px 16px; border-radius: var(--r-lg); }
  .card-head { flex-direction: column; }
  .card-head h3 { font-size: 22px; }
  .row-2 { grid-template-columns: 1fr; }
  .fab { width: 54px; height: 54px; bottom: 18px; left: 18px; }
  .brand-text h1 { font-size: 22px; }
}
@media (max-width: 540px) {
  .hero { min-height: 380px; }
  .hero-title { font-size: 44px; }
  .today-grid { grid-template-columns: 1fr; }
  .hist-head { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 380px) {
  .hero-stats { grid-template-columns: 1fr; }
  .hero-title { font-size: 38px; }
  .hist-head { grid-template-columns: 1fr; }
}
