/* Saved It — app layer on top of nocturne.css tokens.
   Type is deliberately large: the audience is older readers. Nothing below 15px,
   body copy at 19px, every tap target at least 56px tall. */

:root { --app-max: 560px; --tabbar-h: 92px; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
* { -webkit-tap-highlight-color: transparent; }

#screen {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

h1 { font-size: 34px; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 30px; letter-spacing: -.02em; margin: 0; }
.sub { font-size: 16px; color: var(--color-neutral-400); }
.kicker { font-size: 13px; letter-spacing: .11em; text-transform: uppercase; color: var(--color-accent-400); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row-gap { display: flex; gap: 10px; }
.head { display: flex; flex-direction: column; gap: 3px; }

/* — search + filters — */
.search {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px; height: 60px;
  background: var(--color-surface);
  border-radius: 14px; box-shadow: 0 0 0 1px var(--color-neutral-800);
}
.search svg { width: 22px; height: 22px; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 18px; color: var(--color-text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: inherit; font-size: 15px; padding: 10px 15px;
  border-radius: 11px; cursor: pointer;
  background: var(--color-surface); color: var(--color-neutral-400);
  border: 1px solid var(--color-neutral-800);
}
.chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  color: var(--color-accent-100); border-color: var(--color-accent);
}

/* — list rows — */
.item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; padding: 16px 14px; border: 0; border-radius: 14px;
  font-family: inherit; color: var(--color-text); cursor: pointer;
  background: var(--color-surface); box-shadow: 0 0 0 1px var(--color-neutral-800);
}
.item:hover, .item:active { background: var(--color-neutral-900); }
.mark {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--color-neutral-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-800);
  font-size: 19px; font-weight: 600; color: var(--color-accent-300);
}
.mark-sm { width: 44px; height: 44px; font-size: 16px; }
.item-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.item-title { font-size: 21px; line-height: 1.2; font-weight: 500; }
.item-where { font-size: 16px; color: var(--color-neutral-400); }
.item-who { font-size: 15px; color: var(--color-neutral-500); }
.chev { width: 20px; height: 20px; flex: none; color: var(--color-neutral-600); }

/* — buttons — */
.big {
  font-family: inherit; font-size: 20px; font-weight: 500;
  padding: 19px; border-radius: 15px; cursor: pointer; width: 100%;
  color: var(--color-accent-100);
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  border: 1px solid var(--color-accent);
}
.big:hover { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
.quiet {
  font-family: inherit; font-size: 18px; padding: 17px; border-radius: 15px;
  cursor: pointer; width: 100%; color: var(--color-text);
  background: transparent; border: 1px solid var(--color-neutral-700);
}
.quiet:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.link {
  align-self: flex-start; font-family: inherit; font-size: 17px;
  padding: 12px 6px; border: 0; background: transparent;
  color: var(--color-accent-400); cursor: pointer;
}
.link:hover { color: var(--color-accent-300); }
.small {
  font-family: inherit; font-size: 16px; padding: 11px 14px; border-radius: 12px;
  cursor: pointer; flex: none; color: var(--color-accent-300);
  background: transparent; border: 1px solid var(--color-accent);
}
.small:hover { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }

/* — the four ways in — */
.way {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 20px 16px; border-radius: 16px; cursor: pointer;
  font-family: inherit; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-neutral-800);
}
.way:hover { border-color: var(--color-neutral-600); }
.way-first {
  background: linear-gradient(180deg, var(--color-accent-900), var(--color-surface));
  border-color: var(--color-accent-700);
}
.way-first:hover { border-color: var(--color-accent); }
.way-icon {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--color-neutral-900); color: var(--color-accent-300);
}
.way-first .way-icon { background: var(--color-accent-800); color: var(--color-accent-100); }
.way-icon svg { width: 28px; height: 28px; }
.way-text { display: flex; flex-direction: column; gap: 4px; }
.way-title { font-size: 23px; font-weight: 500; line-height: 1.15; }
.way-note { font-size: 16px; color: var(--color-neutral-400); }

/* — cards / panels — */
.panel {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 18px; border-radius: 16px;
  background: var(--color-surface); box-shadow: 0 0 0 1px var(--color-accent-800);
}
.panel-quiet { box-shadow: 0 0 0 1px var(--color-neutral-800); }
.note {
  padding: 24px 18px; border-radius: 14px; background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-neutral-800);
  font-size: 18px; line-height: 1.45; color: var(--color-neutral-400);
}
.rule {
  height: 1px; border: 0; margin: 2px 0;
  background: linear-gradient(to right, transparent, var(--color-divider) 30px,
              var(--color-divider) calc(100% - 30px), transparent);
}

/* — voice — */
.voice { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.mic-wrap { position: relative; display: grid; place-items: center; width: 180px; height: 180px; }
.mic-ring {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: var(--color-accent); animation: pulse 1.9s ease-out infinite;
}
.mic-ring:nth-of-type(2) { animation-delay: .95s; }
.mic {
  position: relative; display: grid; place-items: center;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--color-accent-800); box-shadow: inset 0 0 0 1px var(--color-accent);
  border: 0; cursor: pointer; color: var(--color-accent-100);
}
.mic svg { width: 48px; height: 48px; }
.transcript { min-height: 92px; font-size: 26px; line-height: 1.3; color: var(--color-accent-100); }
@keyframes pulse { 0% { transform: scale(1); opacity: .55 } 70%,100% { transform: scale(1.9); opacity: 0 } }

/* — detail — */
.preview {
  position: relative; display: grid; place-items: center;
  height: 210px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(150deg, var(--color-accent-900) 0%, var(--color-surface) 55%, var(--color-neutral-900) 100%);
  box-shadow: 0 0 0 1px var(--color-accent-800);
}
.preview-book { height: 300px; }
.preview-initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 96px; font-weight: 600; letter-spacing: -.04em;
  color: color-mix(in srgb, var(--color-accent-400) 18%, transparent);
}
.play {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px 18px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 18px; color: var(--color-accent-100);
}
.play-circle {
  display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent-800) 80%, transparent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
.play-circle svg { width: 30px; height: 30px; }
.detail-title { font-size: 31px; line-height: 1.12; letter-spacing: -.02em; margin: 0; }
.summary { font-size: 19px; line-height: 1.5; text-wrap: pretty; }
.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--color-accent-800); border-top-color: var(--color-accent-400);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* — tab bar — */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 8px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--color-bg); box-shadow: 0 -1px 0 var(--color-neutral-900);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border: 0; border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  background: transparent; color: var(--color-neutral-500);
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { background: var(--color-surface); color: var(--color-text); }
.tab-primary {
  flex: 1.15; color: var(--color-accent-100); border: 1px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
}
.tab-primary:hover { background: color-mix(in srgb, var(--color-accent) 28%, transparent); }

/* — toast — */
.toast {
  position: fixed; left: 14px; right: 14px; top: calc(14px + env(safe-area-inset-top));
  z-index: 60; max-width: calc(var(--app-max) - 28px); margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: 14px; background: var(--color-accent-900);
  box-shadow: 0 0 0 1px var(--color-accent-700), 0 12px 30px rgba(0,0,0,.55);
  font-size: 16px; color: var(--color-accent-100);
  animation: rise .28s ease both;
}
@keyframes rise { from { transform: translateY(-10px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
