:root {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --panel-soft: #f7faf2;
  --line: #d9d7ca;
  --ink: #27302c;
  --muted: #68716b;
  --accent: #4f8f82;
  --accent-soft: #d9e7df;
  --blue-soft: #dce7ef;
  --rose-soft: #f1dfdb;
  --done: #9aa39b;
  --danger: #9f443d;
  color-scheme: light;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid #3e766c;
  border-radius: 7px;
  background: #477f75;
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid #b8d4cb;
  outline-offset: 2px;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 720;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 720;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.splash-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 32px 20px 22px;
  background: radial-gradient(circle at 50% 38%, #fffdf8 0, #f7faf2 42%, #f5f1e8 100%);
  color: var(--ink);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.splash-shell.is-hiding {
  opacity: 0;
  visibility: hidden;
}

.splash-center {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.splash-mark {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 143, 130, 0.22);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 18px 44px rgba(70, 74, 62, 0.14);
  animation: splashPulse 1600ms ease-in-out infinite;
}

.splash-mark img {
  width: 64px;
  height: 64px;
  display: block;
}

.splash-footer {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

@keyframes splashPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 50px rgba(70, 74, 62, 0.12);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.menu-closed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.menu-arrow {
  position: fixed;
  top: 50%;
  left: 320px;
  transform: translateY(-50%);
  z-index: 12;
  width: 28px;
  min-width: 28px;
  min-height: 64px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  font-size: 20px;
  box-shadow: 4px 0 18px rgba(39, 48, 44, 0.1);
  transition: left 180ms ease;
}

.menu-closed .menu-arrow {
  left: 0;
}

.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(39, 48, 44, 0.2);
}

.sidebar {
  position: relative;
  z-index: 10;
  border-right: 1px solid var(--line);
  background: #efeadf;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  min-height: 100vh;
  width: 320px;
  overflow: hidden;
  transition: transform 180ms ease;
}

.menu-closed .sidebar {
  transform: translateX(-320px);
}

.brand-row,
.content-header,
.dialog-header,
.dialog-actions,
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-row {
  padding-left: 0;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  font-size: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.call-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.call-link {
  width: 100%;
  min-height: 68px;
  text-align: left;
  display: grid;
  gap: 4px;
  padding: 10px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--ink);
}

.call-link[aria-current="true"] {
  border-color: #80aaa2;
  background: var(--accent-soft);
}

.call-link.archived {
  color: var(--done);
  background: #f5f5f0;
}

.call-link.archived strong,
.call-link.archived .muted {
  text-decoration: line-through;
}

.all-open-link {
  background: #fff7ed;
}

.call-link strong {
  font-size: 14px;
}

.progress-line {
  color: #56645d;
  font-size: 12px;
  line-height: 1.35;
}

.call-archive {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}

.content {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.94);
  backdrop-filter: blur(12px);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sections {
  display: grid;
  gap: 12px;
  padding: 14px 18px 24px;
  overflow: auto;
}

.section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.section-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.summary-text,
.context-list,
.transcript {
  line-height: 1.5;
  font-size: 13px;
}

.item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid #e4e0d4;
  border-radius: 7px;
  background: #fff;
}

.item.done {
  color: var(--done);
  background: #f5f5f0;
}

.item.done .item-title,
.item.done .item-detail {
  text-decoration: line-through;
}

.item input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.item-title {
  font-weight: 680;
  line-height: 1.35;
}

.item-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.item-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #475d69;
  padding: 2px 7px;
  font-size: 11px;
}

.done-divider {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 0;
}

.done-divider span {
  height: 1px;
  background: var(--line);
}

.archive-toggle {
  min-height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
}

.archive-toggle-wide {
  width: 100%;
  justify-content: center;
}

.date-divider {
  color: var(--muted);
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 680;
}

.transcript {
  max-height: 52vh;
  overflow: auto;
  white-space: pre-wrap;
  background: #fbfaf5;
  padding: 10px;
  border-radius: 7px;
  border: 1px solid #e4e0d4;
}

.settings-dialog {
  width: min(420px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 0;
  color: var(--ink);
}

.settings-dialog::backdrop {
  background: rgba(37, 43, 39, 0.22);
}

.settings-dialog form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.menu-closed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    box-shadow: 12px 0 38px rgba(39, 48, 44, 0.16);
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu-arrow {
    left: min(320px, calc(100vw - 28px));
  }

  .menu-closed .menu-arrow {
    left: 0;
  }
}
