/* Meeting Copilot — clean, classic SaaS. Neutral canvas, one purple accent,
   Inter throughout. No decoration; craft lives in spacing, hierarchy, and calm
   state handling. */


:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --sidebar: #ffffff;
  --border: #e9e9ee;
  --border-strong: #dcdce3;
  --text: #18181b;
  --muted: #71717a;
  --faint: #a1a1aa;

  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f1ecfe;
  --accent-border: #ddd0fb;
  --accent-text: #6d28d9;

  --green: #0f9d6b; --green-soft: #e7f7f0;
  --amber: #b45309; --amber-soft: #fdf0dc;
  --red: #dc2626; --red-soft: #fde8e8;

  --r: 8px; --r-md: 10px; --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(24,24,27,.06);
  --shadow-md: 0 6px 24px rgba(24,24,27,.10);
  --shadow-drawer: -16px 0 48px rgba(24,24,27,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 8px 14px; border-radius: var(--r); font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: #fafafb; border-color: var(--faint); }
.btn:active { transform: translateY(.5px); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f1f4; color: var(--text); }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }


/* --- Markdown Styles ------------------------------------------------------- */
.md-content {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  font-family: var(--font-sans);
}
.md-content h1 {
  font-size: 22px; margin-top: 24px; margin-bottom: 12px; font-weight: 600; color: var(--text);
}
.md-content h2 {
  font-size: 18px; margin-top: 24px; margin-bottom: 10px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.md-content h3 {
  font-size: 16px; margin-top: 20px; margin-bottom: 8px; font-weight: 600; color: var(--text);
}
.md-content p {
  margin-top: 0; margin-bottom: 16px;
}
.md-content ul, .md-content ol {
  margin-top: 0; margin-bottom: 16px; padding-left: 24px;
}
.md-content li {
  margin-bottom: 6px;
}
.md-content strong {
  color: var(--text); font-weight: 600;
}
.md-content a {
  color: var(--accent); text-decoration: none;
}
.md-content a:hover {
  text-decoration: underline;
}
.md-content blockquote {
  border-left: 3px solid var(--border-strong); margin: 0 0 16px 0; padding-left: 16px; color: var(--muted);
}
.md-content pre {
  background: rgba(0,0,0,0.2); padding: 12px; border-radius: 6px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; margin-bottom: 16px; border: 1px solid var(--border);
}
.md-content code {
  background: rgba(0,0,0,0.2); padding: 2px 4px; border-radius: 4px; font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.md-content hr {
  border: 0; border-top: 1px solid var(--border); margin: 24px 0;
}

/* --- Sign-in --------------------------------------------------------------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 40px 36px; text-align: center;
}
.signin-mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent);
  display: grid; place-items: center; margin: 0 auto 18px; color: #fff;
}
.signin-card h1 { font-size: 19px; margin: 0 0 4px; }
.signin-card p { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.signin-card .btn-accent { width: 100%; padding: 11px; }

/* --- Day calendar ---------------------------------------------------------- */
.cal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-date { font-size: 16px; font-weight: 650; }
.cal-date .dow { color: var(--muted); font-weight: 600; margin-right: 8px; }
.cal-allday { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.cal-allday:empty { display: none; }
.allday-ev { padding: 6px 12px; border-radius: var(--r); font-size: 13px; font-weight: 500; background: #f3f4f6; color: var(--muted); border: 1px solid var(--border); }

.cal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-scroll { max-height: calc(100vh - 230px); overflow-y: auto; }
.cal-body { position: relative; }
.hour { position: absolute; left: 0; right: 0; border-top: 1px solid #f0f0f3; }
.hour-label { position: absolute; left: 0; width: 56px; padding-right: 10px; text-align: right; font-size: 11px; color: var(--faint); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.lane { position: absolute; top: 0; left: 64px; right: 14px; }
.ev {
  position: absolute; overflow: hidden; border-radius: 7px; padding: 4px 9px; cursor: pointer;
  border: 1px solid transparent; box-sizing: border-box; transition: filter .12s, box-shadow .12s;
}
.ev:hover { filter: brightness(.98); box-shadow: var(--shadow-sm); }
.ev .ev-title { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .ev-time { font-size: 11px; opacity: .8; }
.ev.captured { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); }
.ev.scheduled { background: #fff; color: var(--accent-text); border-color: var(--accent-border); }
.ev.scheduled::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.ev.plain { background: #f4f4f6; color: var(--muted); border-color: var(--border); }
.ev .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; opacity: .8; }
.cal-empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* --- Pills / status -------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.ok { background: var(--accent-soft); color: var(--accent-text); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.gray { background: #f1f1f4; color: var(--muted); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.live { background: var(--red-soft); color: var(--red); }

/* Live indicator */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(220,38,38,.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); } 70% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.ev.live { box-shadow: 0 0 0 1.5px var(--red); }

.presence { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; background: #fbfbfc; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13.5px; font-weight: 500; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }

/* --- Detail drawer --------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(24,24,27,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 720px; max-width: 92vw; z-index: 50;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-drawer);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head .dh-main { min-width: 0; flex: 1; }
.drawer-head h3 { margin: 0 0 3px; font-size: 16px; line-height: 1.3; }
.drawer-head .dh-meta { color: var(--muted); font-size: 12.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.section { margin-bottom: 22px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 8px; }
.prose { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; color: #27272e; }

/* Rendered summary markdown */
.md { font-size: 13.5px; line-height: 1.6; color: #27272e; }
.md-h { margin: 18px 0 6px; font-weight: 700; color: var(--text); line-height: 1.35; }
.md-h:first-child { margin-top: 0; }
h3.md-h { font-size: 15px; }
h4.md-h { font-size: 13.5px; }
h5.md-h { font-size: 12.5px; color: var(--muted); }
.md-p { margin: 0 0 9px; }
.md-ul { margin: 0 0 10px; padding-left: 18px; }
.md-ul li { margin: 3px 0; }
.md strong { font-weight: 700; color: var(--text); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* Calm state cards (generating / empty / scheduled) */
.state { text-align: center; padding: 30px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: #fcfcfd; }
.state .state-icon { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--accent); display: grid; place-items: center; }
.state h4 { margin: 0 0 4px; font-size: 14px; }
.state p { margin: 0; color: var(--muted); font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Meetings list --------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.input { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); font: inherit; background: var(--surface); width: 100%; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fafafb; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 600; font-size: 13.5px; }
.list-row .lr-meta { color: var(--muted); font-size: 12px; margin-top: 1px; }
.muted-note { color: var(--muted); font-size: 13px; }

/* --- Empty / settings ------------------------------------------------------ */
.placeholder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 40px; text-align: center; color: var(--muted); }
.placeholder h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }

/* Draft email picker (drawer) */
select.input { appearance: auto; }
.draft-row { display: flex; gap: 8px; align-items: center; }
.tpl-select { flex: 1; }
.draft-out { margin-top: 10px; }
.draft-out:empty { display: none; }
.draft-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; word-break: break-word; }
.draft-subject { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.draft-body { background: #fbfbfc; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }

/* Template editor (settings) */
.tpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.tpl-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tpl-card-head .input { flex: 1; font-weight: 600; }
.tpl-instr { width: 100%; min-height: 90px; resize: vertical; font-family: inherit; line-height: 1.5; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .drawer { width: 100vw; }
}

/* --- Combo Box ----------------------------------------------------------- */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.combo-item {
  padding: 9px 12px; cursor: pointer; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-item:hover, .combo-item.active { background: #eef2ff; }
.combo-create {
  position: sticky; top: 0; z-index: 1;
  color: var(--accent); font-weight: 600;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.combo-create:hover, .combo-create.active { background: #eef2ff; }

/* --- Chat Bubbles -------------------------------------------------------- */
.chat-history {
  display: flex; flex-direction: column; gap: 16px; margin: 20px 0;
  background: #fbfbfc; border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px 16px;
}
.chat-message { display: flex; flex-direction: column; max-width: 85%; }
.chat-me { align-self: flex-end; align-items: flex-end; }
.chat-them { align-self: flex-start; align-items: flex-start; }
.chat-header { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chat-time { font-weight: normal; margin-left: 4px; opacity: 0.8; }
.chat-body {
  padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.4;
  word-break: break-word;
}
.chat-me .chat-body { background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.chat-them .chat-body { background: #eef2ff; color: #1e1e24; border-bottom-left-radius: 4px; border: 1px solid #dce4fc; }
