/* Obsidian Loom — shared styles, matching obsidianloom.com
   Monochrome paper aesthetic with a single brand-purple accent.
   Pixel typeface (Press Start 2P) powers the signature CTA, as on the bio pages. */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --brand: #8A2EFF;
  --brand-dark: #5E1BFF;
  /* pixel "Say Hello" button palette, lifted from obsidianloom.com bio pages */
  --p: #7a2dff;
  --p-dark: #4c13b2;
  --p-lite: #b88aff;
  --ink: #000;
  --paper: #fff;
  --muted: #555;
  --faint: #6b7280;
  --panel: #f5f5f5;
  --panel-hover: #eaeaea;
  --line: #000;
  --danger: #c81e3a;
}

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

html, body { min-height: 100%; }

body {
  font-family: 'Courier New', Courier, monospace;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* Cursor spark-trail canvas */
#sparks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -10;
}

/* Page shell: centered column capped like the marketing site */
.page {
  width: 100%;
  max-width: 64rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Top navigation */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.site-header .logo:hover { color: var(--ink); }
.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--brand-dark); }

@media (min-width: 768px) {
  .site-header { padding: 1.5rem 4rem; }
}

/* Footer */
.site-footer {
  text-align: center;
  font-size: 0.75rem;
  padding: 1.5rem;
  color: var(--faint);
}
.site-footer a:hover { color: var(--brand-dark); }

/* Bio-style hero content (landing + success): top-anchored, left-aligned —
   same information rhythm as obsidianloom.com/emilia-one.html. */
.content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 4rem 1rem;
}
.content .inner { max-width: 36rem; width: 100%; }
/* md+/lg+ left padding mirrors the bio pages' avatar column (px-16 + avatar
   w-72/w-80 + gap-10) so the copy + button line up with where the bio copy
   sits. Mobile stacks with no indent, matching the bio's flex-col layout. */
@media (min-width: 768px) {
  .content { padding: 4rem 4rem 4rem calc(4rem + 18rem + 2.5rem); }
}
@media (min-width: 1024px) {
  .content { padding-left: calc(4rem + 20rem + 2.5rem); }
}

h1.hero {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
@media (min-width: 768px) {
  h1.hero { font-size: 2.25rem; }
}
.subtitle {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* Primary call-to-action — the pixel "Say Hello" button from the bio pages:
   Press Start 2P face, purple gradient, black(4px)+white(8px) frame via
   box-shadow, dark-purple inner stroke, and a tactile press-down on :active.
   Action stays Google OAuth (the portal's job); only the look/feel is shared. */
.connect-btn {
  position: relative;
  top: 0;
  display: inline-block;
  max-width: 100%;
  margin-top: 2.25rem;
  padding: 0.95rem 1.6rem;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  /* "Connect with Google" is longer than the bio's "Say Hello", so scale the
     pixel face down on narrow screens to stay on one line within the viewport. */
  font-size: clamp(0.58rem, 2.7vw, 0.8rem);
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--p-lite) 0%, var(--p) 50%, var(--p) 100%);
  box-shadow: 0 0 0 4px #000, 0 0 0 8px #fff, inset 0 0 0 2px var(--p-dark);
  overflow: hidden;
  cursor: pointer;
  transition: top 50ms ease-out;
}
.connect-btn:hover { color: #fff; }
.connect-btn:active {
  top: 6px;
  box-shadow: 0 0 0 4px #000, 0 0 0 8px #fff, inset 0 0 0 2px var(--p-dark);
}

/* Info / note panel */
.info {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
}
.info strong { color: var(--ink); }

/* Success checkmark */
.checkmark {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: var(--brand);
}

/* ---------- Admin status dashboard ---------- */
.admin {
  width: 100%;
  max-width: 64rem;
  padding: 2rem 1rem;
}
@media (min-width: 768px) {
  .admin { padding: 2rem 4rem; }
}
.admin h1.section {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.admin .subtitle { margin-bottom: 1.5rem; }

.actions {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: var(--panel-hover); color: var(--ink); }
.btn-sync { background: var(--brand); border-color: var(--line); color: #fff; }
.btn-sync:hover { background: var(--brand-dark); color: #fff; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
th {
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}
td { font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }

.badge {
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.badge-active { background: var(--brand); color: #fff; }
.badge-revoked { background: var(--danger); color: #fff; }

.btn-disconnect {
  padding: 4px 10px;
  font-size: 0.8rem;
  background: var(--paper);
  border: 1px solid var(--danger);
  color: var(--danger);
  cursor: pointer;
  font-family: inherit;
}
.btn-disconnect:hover { background: var(--danger); color: #fff; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

/* ---------- Admin login ---------- */
.login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  width: 100%;
}
.login .box { width: 100%; max-width: 360px; text-align: center; }
.login h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.login input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
}
.login button {
  padding: 10px 24px;
  border: 1px solid var(--line);
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.login button:hover { background: var(--brand-dark); }

/* ============================================================
   Agent activity log — /<agent>  (mobile-first, single column)
   A warm paper feed of cards. Readable humanist sans for the
   prose; the brand purple stays as the accent + pixel mark.
   ============================================================ */
.log-body {
  display: block;
  align-items: stretch;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  background: #faf9f6;
  color: #16151a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- sticky header ---- */
.log-header {
  /* Scrolls away on scroll, leaving just the sticky tabs below. */
  background: #faf9f6;
  border-bottom: 1px solid #e7e4dc;
  padding: env(safe-area-inset-top) 0 0;
}
.log-header-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 0.95rem 1.15rem 0.85rem;
}
.log-id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.log-mark {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--p-lite) 0%, var(--p) 55%, var(--p-dark) 100%);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(122, 45, 255, 0.28);
}
.log-id-text h1 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.log-tagline {
  font-size: 0.78rem;
  color: #8a857c;
  margin-top: 0.05rem;
}
.log-live {
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
  animation: logpulse 2.4s ease-out infinite;
}
@keyframes logpulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
.log-meta {
  margin-top: 0.55rem;
  font-size: 0.76rem;
  color: #9a958c;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.log-meta .log-dot { color: #cfcabf; }

/* ---- tabs (CSS-only; Activity / Messages) ---- */
.log-tabinput { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.log-tabs {
  display: flex;
  gap: 0.4rem;
  /* stay reachable while scrolling the feed */
  position: sticky;
  top: 0;
  z-index: 20;
  background: #faf9f6;
  border-bottom: 1px solid #ece9e1;
  margin: 0 -1.15rem 0.2rem;   /* span the .log-feed side padding so content doesn't bleed past the bar */
  padding: 0.55rem 1.15rem;
}
.log-tab {
  padding: 0.5rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #97928a;
  cursor: pointer;
  border-radius: 999px;
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.log-tab:hover { color: #1b1a20; }
#logtab-all:checked ~ .log-tabs label[for="logtab-all"],
#logtab-msg:checked ~ .log-tabs label[for="logtab-msg"],
#logtab-sched:checked ~ .log-tabs label[for="logtab-sched"],
#logtab-todos:checked ~ .log-tabs label[for="logtab-todos"] {
  color: #fff;
  background: linear-gradient(180deg, var(--p) 0%, var(--p-dark) 100%);
  box-shadow: 0 1px 4px rgba(122, 45, 255, 0.28);
}
.log-panel { display: none; }
#logtab-all:checked ~ .log-panel-all { display: block; }
#logtab-msg:checked ~ .log-panel-msg { display: block; }
#logtab-sched:checked ~ .log-panel-sched { display: block; }
#logtab-todos:checked ~ .log-panel-todos { display: block; }
.log-panel .log-day:first-child { margin-top: 0.9rem; }

/* proper nouns / place names, bolded for glanceability */
.log-line strong { font-weight: 700; color: #100f14; }
.sched-summary strong, .sched-title strong { font-weight: 700; color: #100f14; }

/* ---- Scheduled / To-dos tabs ---- */
.log-panel-sched .sched-group:first-child,
.log-panel-todos .sched-group:first-child { margin-top: 0.9rem; }
/* Tappable project cards open a detail pane */
.sched-proj { position: relative; cursor: pointer; padding-right: 2rem; -webkit-tap-highlight-color: transparent; }
.sched-proj:hover { border-color: #d8d2c6; }
.sched-proj .sched-chev { position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%); color: #c0bbb0; font-size: 1.3rem; line-height: 1; }
.proj-title { margin: 0 0 0.9rem; font-size: 1.15rem; color: #16151a; }
.proj-field { display: flex; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid #efece5; font-size: 0.95rem; }
.proj-field:last-child { border-bottom: none; }
.proj-flabel { flex: 0 0 6.5rem; color: #97928a; font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; padding-top: 0.18rem; }
.proj-fval { flex: 1; color: #24221d; line-height: 1.5; }
.sched-proj-body { overflow-y: auto; gap: 0; }
.proj-fileshead { margin: 1.5rem 0 0.5rem; font-size: 0.95rem; color: #16151a; }
.proj-file { font-size: 0.9rem; border-bottom: 1px solid #efece5; }
.proj-file > summary { padding: 0.55rem 0; cursor: pointer; color: var(--p); font-family: 'Courier New', Courier, monospace; list-style: none; -webkit-tap-highlight-color: transparent; word-break: break-all; }
.proj-file > summary::-webkit-details-marker { display: none; }
.proj-file-plain { padding: 0.55rem 0; color: #8b8579; font-family: 'Courier New', Courier, monospace; word-break: break-all; }
.proj-filenote { color: #b3aea3; font-style: italic; }
.proj-filebody { margin: 0.25rem 0 0.7rem; padding: 0.7rem 0.8rem; background: #fff; border: 1px solid #eee7db; border-radius: 8px; white-space: pre-wrap; word-break: break-word; font-size: 0.82rem; line-height: 1.5; max-height: 50vh; overflow: auto; }
.sched-group { margin: 0 0 1.6rem; }
.sched-grouphead {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #97928a;
}
.sched-list { list-style: none; margin: 0; padding: 0; }
.sched-item {
  background: #fff;
  border: 1px solid #ece8e1;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04);
}
.sched-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.sched-title { font-size: 1rem; font-weight: 650; color: #16151a; }
.sched-cadence {
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--p);
  white-space: nowrap;
}
.sched-for {
  margin-top: 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--p);
}
.sched-summary { margin-top: 0.28rem; font-size: 0.92rem; line-height: 1.45; color: #4a463f; }
.sched-foot {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  color: #a39d92;
}
.sched-last { white-space: nowrap; }
.sched-paused { color: #b8860b; font-weight: 600; }
.sched-last.sched-paused { white-space: normal; }
.sched-formula { font-size: 0.78rem; margin-top: 0.5rem; }
.sched-formula > summary {
  cursor: pointer;
  color: var(--p);
  font-weight: 600;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.sched-formula > summary::-webkit-details-marker { display: none; }
.sched-formula > summary::after { content: 'see formula'; }
.sched-formula[open] > summary::after { content: 'collapse formula'; }
.sched-formula[open] > summary { margin-bottom: 0.45rem; }
.sched-formula pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 0.7rem 0.8rem;
  background: #faf8f4;
  border: 1px solid #efeae2;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #4a463f;
}
.sched-status {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p);
  background: #f1ebff;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  white-space: nowrap;
}
/* ---- swipe to edit/delete ---- */
.sched-swipe { position: relative; list-style: none; margin-bottom: 0.6rem; border-radius: 14px; overflow: hidden; }
.sched-actions { position: absolute; inset: 0 0 0 auto; width: 150px; display: flex; }
.sched-act { flex: 1; border: none; color: #fff; font-weight: 650; font-size: 0.86rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sched-act-edit { background: linear-gradient(180deg, var(--p) 0%, var(--p-dark) 100%); }
.sched-act-del { background: #d23b3b; }
.sched-card {
  position: relative;
  background: #fff;
  border: 1px solid #ece8e1;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04);
  transform: translateX(0);
  transition: transform 190ms ease;
  touch-action: pan-y;
}
.sched-swipe.revealed .sched-card { transform: translateX(-150px); }
.sched-handle {
  position: absolute; top: 0.5rem; right: 0.55rem;
  border: none; background: none; color: #c2bcb1; cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 0.1rem 0.35rem; border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.sched-handle:hover { color: var(--p); }
.sched-card .sched-top { padding-right: 1.4rem; } /* room for the handle */

/* version arrows */
.sched-vnav { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: auto; }
.sched-arrow {
  border: 1px solid #e7e1d8; background: #fff; border-radius: 7px;
  width: 1.5rem; height: 1.5rem; cursor: pointer; color: var(--p);
  font-size: 0.95rem; line-height: 1; padding: 0; -webkit-tap-highlight-color: transparent;
}
.sched-arrow:disabled { color: #d3cdc3; border-color: #efeae2; cursor: default; }
.sched-vlabel { font-size: 0.7rem; color: #97928a; min-width: 2.4rem; text-align: center; }

/* edit / confirm modal */
.sched-modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 18, 10, 0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.sched-modal {
  background: var(--bg, #fbf9f5); width: 100%; max-width: 620px;
  border-radius: 20px 20px 0 0; padding: 1.25rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom));
  max-height: 90vh; overflow-y: auto; box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
}
.sched-modal h3 { margin: 0 0 1rem; font-size: 1.1rem; color: #16151a; }
.sched-modal h3 .sched-vnav { font-size: 0.8rem; }
/* The EDIT pane is full-screen on phone (formula fills; only the textarea
   scrolls) and a large centered panel on desktop. */
.sched-modal-edit {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border-radius: 0; background: #faf9f6;
  display: flex; flex-direction: column; overflow: hidden;
}
.sched-editbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: calc(env(safe-area-inset-top) + 0.65rem) 1rem 0.65rem;
  border-bottom: 1px solid #e7e4dc; background: #faf9f6;
}
.sched-editbar-btn {
  border: none; background: none; color: var(--p);
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  padding: 0.3rem 0.25rem; -webkit-tap-highlight-color: transparent;
}
.sched-editbar-save { font-weight: 700; }
.sched-editbar-btn[disabled] { color: #c2bcb1; cursor: default; }
.sched-editbar .sched-vnav { margin: 0; }
.sched-edit-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 0.85rem; overflow: hidden;
  padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom));
  max-width: 760px; width: 100%; margin: 0 auto; box-sizing: border-box;
}
.sched-field-grow { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; }
.sched-field-grow textarea {
  flex: 1 1 auto; min-height: 5rem; height: auto; resize: none;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.sched-row { display: flex; gap: 0.7rem; flex: 0 0 auto; }
.sched-row .sched-field { flex: 1; margin-bottom: 0; }
.sched-edit-body .sched-ta-short { min-height: 3.5rem; resize: none; overscroll-behavior: contain; }
.sched-edit-body .sched-field { margin-bottom: 0.8rem; }
.sched-edit-body .sched-field:last-of-type { margin-bottom: 0; }
@media (min-width: 640px) {
  .sched-modal-edit {
    position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: 92vw; max-width: 820px; height: 86vh; max-height: 86vh;
    border-radius: 16px; box-shadow: 0 12px 60px rgba(0, 0, 0, 0.32); overflow: hidden;
  }
}
.sched-field { margin-bottom: 0.95rem; }
.sched-field label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #97928a; font-weight: 700; margin-bottom: 0.32rem; }
.sched-field textarea, .sched-field input, .sched-field select {
  width: 100%; box-sizing: border-box; border: 1px solid #e2ddd4; border-radius: 10px;
  padding: 0.6rem 0.7rem; font: inherit; font-size: 16px; background: #fff; color: #24221d;
}
.sched-field textarea { min-height: 9.5rem; resize: vertical; line-height: 1.5; }
.sched-modal-actions { display: flex; gap: 0.6rem; align-items: center; justify-content: flex-end; margin-top: 0.4rem; flex: 0 0 auto; }
.sched-btn {
  padding: 0.6rem 1.25rem; border-radius: 999px; font-weight: 650; font-size: 0.9rem;
  cursor: pointer; border: 1px solid #e2ddd4; background: #fff; color: #4a463f;
}
.sched-btn[disabled] { opacity: 0.55; cursor: default; }
.sched-btn-primary { background: linear-gradient(180deg, var(--p) 0%, var(--p-dark) 100%); color: #fff; border: none; }
.sched-btn-danger { background: #d23b3b; color: #fff; border: none; }
.sched-modal-msg { color: #6a655c; font-size: 0.92rem; line-height: 1.5; margin: 0 0 1.1rem; }
.sched-modal-err { color: #c0392b; font-size: 0.84rem; margin-top: 0.6rem; min-height: 1rem; }

.sched-next { margin-top: 0.4rem; font-size: 0.85rem; color: #6a655c; }
.sched-nextlabel {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p);
  margin-right: 0.25rem;
}

/* A send that was attempted but never got through — shown like a failed
   iMessage: the line dims and a small red "Not delivered" pill follows it. */
.log-item-failed .log-line { color: #8a7d80; }
.log-item-failed .log-line strong { color: #7a4b52; }
.log-undelivered {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.42rem;
  border-radius: 999px;
  background: rgba(200, 30, 58, 0.1);
  border: 1px solid rgba(200, 30, 58, 0.35);
  color: var(--danger);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  vertical-align: 0.06em;
  white-space: nowrap;
}
/* A delivered message that fell back to another channel — a quiet footnote. */
.log-note { color: #aba59b; font-size: 0.84rem; }

/* ---- feed ---- */
.log-feed {
  max-width: 620px;
  margin: 0 auto;
  padding: 0.5rem 1.15rem 3rem;
}
.log-day { margin-top: 1.4rem; }
.log-dayhead {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b0aaa0;
  margin: 0 0 0.6rem 0.1rem;
}

/* Each day is a tidy card; inside, one hairline-separated row per action:
   a muted time and one plain sentence. Nothing else. */
.log-list {
  list-style: none;
  background: #fff;
  border: 1px solid #ece9e1;
  border-radius: 14px;
  padding: 0.15rem 1rem;
  box-shadow: 0 1px 2px rgba(20, 18, 30, 0.03);
}
.log-item {
  display: flex;
  gap: 0.95rem;
  align-items: baseline;
  padding: 0.72rem 0;
  border-bottom: 1px solid #f0ede4;
}
.log-item:last-child { border-bottom: none; }
.log-time {
  flex: 0 0 4rem;
  text-align: right;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: #aba59b;
  white-space: nowrap;
}
.log-line {
  flex: 1;
  min-width: 0;
  font-size: 0.97rem;
  color: #1b1a20;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.log-empty {
  text-align: center;
  color: #a39e94;
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

/* ---- footer ---- */
.log-foot {
  max-width: 620px;
  margin: 0 auto;
  padding: 1.5rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #eceae3;
  font-size: 0.78rem;
}
.log-foot a { color: #9a958c; text-decoration: none; }
.log-foot a:hover { color: var(--p); }
.log-logout button {
  background: none;
  border: none;
  color: #b3aea4;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.log-logout button:hover { color: var(--p); }

/* ---- login / not-configured card ---- */
.log-login {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.15rem calc(2rem + env(safe-area-inset-bottom));
  gap: 2rem;
}
.log-login-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: #fff;
  border: 1px solid #ece9e1;
  border-radius: 18px;
  padding: 2.2rem 1.6rem 1.9rem;
  box-shadow: 0 8px 30px rgba(20, 18, 30, 0.06);
}
.log-login-mark {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--p-lite) 0%, var(--p) 55%, var(--p-dark) 100%);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.74rem;
  box-shadow: 0 3px 12px rgba(122, 45, 255, 0.3);
}
.log-login-card h1 { font-size: 1.35rem; font-weight: 700; }
.log-login-sub { color: #8a857c; font-size: 0.85rem; margin-top: 0.2rem; margin-bottom: 1.4rem; }
.log-login-err { color: var(--danger); font-size: 0.82rem; margin-bottom: 0.9rem; }
.log-login-card input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid #ddd8cd;
  border-radius: 11px;
  font: inherit;
  font-size: 1rem;
  background: #fbfaf7;
  margin-bottom: 0.85rem;
}
.log-login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(122, 45, 255, 0.14);
}
.log-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #75706a;
  text-align: left;
  margin-bottom: 1.1rem;
}
.log-remember input { accent-color: var(--p); }
.log-login-card button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--p) 0%, var(--p-dark) 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: filter 120ms ease;
}
.log-login-card button[type="submit"]:hover { filter: brightness(1.07); }
.log-login-card button[type="submit"]:active { transform: translateY(1px); }
