/* ============================================================
   DAILYMARK — app shell styles
   Inherits the tokens from style.css
   ============================================================ */

.app {
  min-height: calc(100vh - 62px);
  background: var(--bg-soft);
}

.pad {
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 22px 90px;
}

.pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.ph-date {
  color: var(--faint);
  margin-bottom: 6px;
}
.pagehead h1 {
  font-size: 30px;
  letter-spacing: -.025em;
  margin: 0;
}

/* ---------- panels ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 20px 22px;
  margin-bottom: 16px;
}
.panel-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}
.panel-h .hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--faint);
}
.pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .04em;
}

/* ---------- mood picker ---------- */

.moods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 560px) { .moods { gap: 5px; } }
.mood {
  background: var(--bg-soft);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 4px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  transition: border-color .12s ease, background .12s ease, color .12s ease;
  font-family: inherit;
}
.mood:hover { border-color: var(--mc); color: var(--ink-soft); }
.mood.on {
  border-color: var(--mc);
  background: color-mix(in srgb, var(--mc) 9%, #fff);
  color: var(--ink);
}
.mood .face { display: block; color: var(--mc); }
.mood .mlabel {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* ---------- tags ---------- */

.taggroup { margin-bottom: 16px; }
.taggroup:last-child { margin-bottom: 0; }
.taggroup-h {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  margin-bottom: 9px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip:hover { border-color: var(--faint); }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip .x {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: .7;
}
.minitag {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: var(--muted);
  margin-right: 5px;
}

/* ---------- note ---------- */

.note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg-soft);
  resize: vertical;
  min-height: 46px;
}
.note:focus {
  outline: none;
  border-color: var(--faint);
  background: var(--card);
}
.note::placeholder { color: var(--faint); }

/* ---------- footbar ---------- */

.footbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 4px 0;
}
.footbar .mono { color: var(--faint); }

/* ---------- wall ---------- */

.wall-wrap { display: flex; flex-direction: column; gap: 20px; }
.mgrid {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.mgrid-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14.5px;
  font-weight: 600;
}
.mgrid-h .mono { color: var(--faint); }
.mwall {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.mwall i {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--line-soft);
}
.mwall i.m1 { background: var(--mood-1); }
.mwall i.m2 { background: var(--mood-2); }
.mwall i.m3 { background: var(--mood-3); }
.mwall i.m4 { background: var(--mood-4); }
.mwall i.m5 { background: var(--mood-5); }
.mwall i.void { background: transparent; }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- paywall ---------- */

.paywall {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
}
.paywall b { font-size: 16px; letter-spacing: -.01em; }
.paywall span { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.paywall .btn { margin-top: 5px; }
.paywall.big { padding: 30px 26px; gap: 13px; }
.paywall.big b { font-size: 20px; }
.paywall.big span { font-size: 15.5px; max-width: 56ch; }
.paywall-prices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.paywall .tiny { font-size: 12.5px; color: var(--faint); }

/* ---------- insights ---------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 620px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
}
.stat-l {
  font-size: 11px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  margin-bottom: 7px;
}
.stat-v {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.stat-s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.insightlist { display: flex; flex-direction: column; gap: 12px; }
.insight {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px 20px;
}
.insight .tag {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  margin-bottom: 9px;
}
.insight p { font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.insight p b { font-weight: 650; }

.fineprint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 20px;
}

/* ---------- history ---------- */

.hlist {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hrow {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.hrow:last-child { border-bottom: none; }
.hd {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  margin-bottom: 5px;
}
.hdot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
}
.hd b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hm {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.ht { display: flex; flex-wrap: wrap; gap: 4px; }
.hn {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 7px;
  font-style: italic;
}
.empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.empty a { color: var(--accent); }

/* ---------- settings ---------- */

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; }
.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.btn.danger { color: #A32D2D; border-color: #F0C8C8; }
.btn.danger:hover { border-color: #A32D2D; }

.addbar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.addbar input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--ink);
}
.addbar input:focus { outline: none; border-color: var(--faint); background: var(--card); }
.addbar button {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- tab bar (bottom nav on mobile, top strip on desktop) ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line-soft);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1;
  max-width: 120px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 9px;
  transition: color .12s ease, background .12s ease;
}
.tabbar button span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.tabbar button:hover { color: var(--ink-soft); }
.tabbar button.on {
  color: var(--accent);
  background: rgba(226, 69, 42, .07);
}
@media (min-width: 900px) {
  .tabbar {
    position: static;
    border-top: none;
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg);
    backdrop-filter: none;
    max-width: 720px;
    margin: 0 auto;
    padding: 7px 0;
  }
  .tabbar button {
    flex-direction: row;
    gap: 7px;
    max-width: none;
    padding: 7px 15px;
  }
  .tabbar button span { font-size: 13px; }
  .app { min-height: calc(100vh - 62px - 47px); }
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
  max-width: calc(100vw - 40px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
