/* Hallmark · genre: modern-minimal · macrostructure: Index-first workbench · design-system: DESIGN.md · designed-as-app */

@font-face {
  font-family: "Passphrase Mask";
  src: url("/fonts/passphrase-mask.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-ground: oklch(93% 0.025 65);
  --color-paper: oklch(99% 0.006 75);
  --color-paper-2: oklch(96% 0.018 68);
  --color-field: oklch(99.5% 0.003 75);
  --color-rule: oklch(84% 0.03 65);
  --color-rule-2: oklch(62% 0.055 55);
  --color-muted: oklch(41% 0.04 50);
  --color-ink: oklch(23% 0.035 45);
  --color-deep: oklch(29% 0.055 40);
  --color-accent: oklch(46% 0.135 38);
  --color-accent-hover: oklch(40% 0.12 38);
  --color-accent-soft: oklch(93% 0.035 45);
  --color-on-accent: oklch(98.5% 0.01 72);
  --color-unread: oklch(45% 0.15 252);
  --color-unread-soft: oklch(92% 0.05 250);
  --color-read: oklch(43% 0.075 205);
  --color-read-soft: oklch(92% 0.04 205);
  --color-called-back: oklch(46% 0.115 58);
  --color-called-back-soft: oklch(93% 0.07 82);
  --color-done: oklch(42% 0.105 152);
  --color-done-soft: oklch(92% 0.07 155);
  --color-urgent: oklch(48% 0.19 27);
  --color-urgent-hover: oklch(42% 0.17 27);
  --color-urgent-soft: oklch(93% 0.045 25);
  --color-urgent-rule: oklch(80% 0.09 27);
  --color-warn: oklch(46% 0.115 58);
  --color-warn-rule: oklch(76% 0.1 70);
  --color-danger: oklch(48% 0.19 27);
  --color-success: oklch(42% 0.105 152);
  --color-focus: oklch(45% 0.15 252);
  --color-backdrop: oklch(23% 0.035 45 / 0.5);
  --color-chart-1: #2773c0;
  --color-chart-2: #d08a3c;

  --font-body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --font-passphrase: "Passphrase Mask";

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.875rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.75rem;

  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --control-height: 2.25rem;
  --control-height-touch: 2.75rem;
  --bar-height: 4rem;

  --shadow-dialog: 0 12px 40px oklch(23% 0.035 45 / 0.22);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 140ms;

  --z-sticky: 200;
  --z-modal: 400;
  --z-toast: 500;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--color-ink);
  background: var(--color-ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.status--unread {
  --status-color: var(--color-unread);
  --status-soft: var(--color-unread-soft);
}

.status--read {
  --status-color: var(--color-read);
  --status-soft: var(--color-read-soft);
}

.status--called-back {
  --status-color: var(--color-called-back);
  --status-soft: var(--color-called-back-soft);
}

.status--done {
  --status-color: var(--color-done);
  --status-soft: var(--color-done-soft);
}

.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--control-height);
  padding: 0 var(--space-md);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.button:hover {
  background: var(--color-paper-2);
  border-color: var(--color-muted);
}

.button:active {
  background: var(--color-rule);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.button svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.button--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.button--primary:active {
  background: var(--color-accent);
}

.button--quiet,
.button--danger {
  border-color: transparent;
  background: transparent;
  padding: 0 var(--space-xs);
  color: var(--color-muted);
}

.button--quiet:hover {
  border-color: transparent;
  background: var(--color-paper-2);
  color: var(--color-ink);
}

.button--danger {
  color: var(--color-danger);
}

.button--danger:hover {
  border-color: transparent;
  background: var(--color-urgent-soft);
}

.button--block {
  width: 100%;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--control-height-touch);
  height: var(--control-height-touch);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--color-paper-2);
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--color-ink);
}

.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.field__label {
  font-size: var(--text-md);
  font-weight: 600;
}

.field__hint {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.field__error {
  font-size: var(--text-sm);
  color: var(--color-danger);
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-height-touch);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-md);
  background: var(--color-field);
  font-size: var(--text-base);
}

.textarea {
  padding: var(--space-xs) var(--space-sm);
  min-height: 6rem;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: var(--space-xl);
  background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: -1px;
  border-color: var(--color-focus);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.input::placeholder {
  color: var(--color-muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: var(--text-base);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.15rem 0 0;
  accent-color: var(--color-accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: none;
  min-height: var(--control-height);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--status-color, var(--color-accent));
}

.chip[aria-pressed="true"] {
  background: var(--status-color, var(--color-accent));
  border-color: var(--status-color, var(--color-accent));
  color: var(--color-on-accent);
}

.chip svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--status-color, var(--color-accent));
}

.chip[aria-pressed="true"] svg {
  color: inherit;
}

.segmented {
  display: inline-flex;
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-md);
  background: var(--color-paper);
}

.segmented button {
  flex: 1 1 auto;
  min-height: 1.875rem;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-muted);
  font-size: var(--text-md);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--color-ink);
  background: var(--color-paper-2);
}

.segmented button[aria-pressed="true"],
.segmented button[aria-checked="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.segmented button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0 var(--space-2xs);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.tag svg {
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
}

.tag--status {
  padding: var(--space-3xs) 0.4375rem;
  border-color: transparent;
  background: var(--status-soft);
  color: var(--status-color);
  font-size: var(--text-sm);
  font-weight: 700;
}

.tag--urgent {
  color: var(--color-urgent);
  border-color: transparent;
  background: var(--color-urgent-soft);
}

.tag--warn {
  color: var(--color-warn);
  border-color: var(--color-warn-rule);
}

.tag--accent {
  color: var(--color-accent);
  border-color: transparent;
  background: var(--color-accent-soft);
}

.count {
  display: inline-flex;
  align-items: center;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
}

.audio-player {
  display: flex;
  flex: 1 1 15rem;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.audio-player__toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  cursor: pointer;
}

.audio-player__toggle:hover {
  background: var(--color-accent-hover);
}

.audio-player__toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.audio-player__time {
  flex: none;
}

.audio-player__seek {
  flex: 1 1 4rem;
  min-width: 0;
  height: var(--control-height-touch);
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.audio-player__seek:disabled {
  cursor: default;
}

.notice {
  margin: 0;
  font-size: var(--text-md);
  color: var(--color-muted);
}

.notice--error {
  color: var(--color-danger);
  font-weight: 600;
}

.notice--success {
  color: var(--color-success);
  font-weight: 600;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-paper-2);
  font-size: var(--text-md);
}

.banner--error {
  border-color: var(--color-urgent-rule);
  background: var(--color-urgent-soft);
  color: var(--color-danger);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--space-md);
  background: var(--color-backdrop);
  overflow-y: auto;
}

.dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 30rem);
  max-height: calc(100dvh - 2 * var(--space-md));
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-paper);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.dialog--wide {
  width: min(100%, 40rem);
}

dialog.dialog {
  padding: 0;
  color: inherit;
  max-width: calc(100vw - 2 * var(--space-md));
}

dialog.dialog:not([open]) {
  display: none;
}

dialog.dialog::backdrop {
  background: var(--color-backdrop);
}

.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-lg) 0;
}

.dialog__header h2 {
  font-size: var(--text-xl);
}

.dialog__header .icon-button {
  margin: calc(-1 * var(--space-xs)) calc(-1 * var(--space-xs)) 0 0;
}

.dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  overflow-y: auto;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.dialog__footer {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .dialog-backdrop {
    place-items: end stretch;
    padding: 0;
  }

  .dialog,
  .dialog--wide {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 0;
  }

  dialog.dialog {
    max-width: 100vw;
    margin: auto 0 0;
  }

  .dialog__header {
    padding: var(--space-md) var(--space-md) 0;
  }

  .dialog__body {
    padding: var(--space-md);
  }

  .dialog__footer {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .dialog__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .dialog__actions .button {
    min-height: var(--control-height-touch);
  }

  .button,
  .chip,
  .link-button,
  .segmented button {
    min-height: var(--control-height-touch);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
