@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@600;700&family=JetBrains+Mono:wght@500&display=swap");

/* Clip — component styles. Every value comes from tokens.css. */
.clip { font-family: var(--font-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
.clip *, .clip *::before, .clip *::after { box-sizing: border-box; }
.clip-stage { background: var(--surface-100); padding: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.clip-stage--col { flex-direction: column; align-items: stretch; }
.clip-label { font: 600 11px/13px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }

/* Button */
.clip-btn { appearance: none; border: 0; margin: 0; min-height: var(--size-control); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: 600 17px/22px var(--font-sans); cursor: pointer; transition: background-color .15s ease-in-out, opacity .15s ease-in-out; }
.clip-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.clip-btn--primary { background: var(--accent); color: var(--on-accent); }
.clip-btn--primary:active, .clip-btn--primary.is-pressed { background: var(--accent-pressed); }
.clip-btn--secondary { background: var(--surface-300); color: var(--ink); }
.clip-btn--plain { background: transparent; color: var(--accent-text); padding-inline: var(--space-3); }
.clip-btn--danger { background: transparent; color: var(--danger); }
.clip-btn--secondary:active, .clip-btn--plain:active, .clip-btn.is-pressed:not(.clip-btn--primary) { opacity: var(--opacity-pressed); }
.clip-btn--sm { min-height: var(--size-control-sm); padding: 0 var(--space-3); font-size: 15px; line-height: 20px; }
.clip-btn--block { display: flex; width: 100%; }
.clip-btn:disabled, .clip-btn.is-disabled { opacity: var(--opacity-disabled); cursor: default; }
.clip-btn svg { width: 18px; height: 18px; }

/* Record button */
.clip-rec { position: relative; width: var(--size-record); height: var(--size-record); border-radius: var(--radius-full); border: 4px solid var(--ink);
  background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; }
.clip-rec::after { content: ""; width: 52px; height: 52px; border-radius: var(--radius-full); background: var(--rec); transition: all .2s ease-in-out; }
.clip-rec.is-recording::after { width: 26px; height: 26px; border-radius: var(--radius-xs); }
.clip-rec:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.clip-rec-time { font: 500 13px/16px var(--font-mono); color: var(--rec); font-variant-numeric: tabular-nums; }

/* Day cell */
.clip-day { position: relative; aspect-ratio: 1; border-radius: var(--radius-xs); overflow: hidden; background: var(--surface-300);
  font: 600 15px/18px var(--font-rounded); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.clip-day > .n { position: absolute; left: 6px; bottom: 5px; }
.clip-day--future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-faint); }
.clip-day--filled { color: var(--ink-on-thumb); background: var(--thumb, #3a4a52); }
.clip-day--filled::before { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(to top, var(--scrim-thumb), transparent); }
.clip-day--filled > .n { z-index: 1; }
.clip-day--today { box-shadow: inset 0 0 0 2px var(--today); color: var(--today); }
.clip-day--filled.clip-day--today { color: var(--ink-on-thumb); }
.clip-day--selected { box-shadow: inset 0 0 0 2px var(--accent-text); }
.clip-day--selected:not(.clip-day--filled) { background: var(--accent-soft); color: var(--accent-text); }
.clip-day--suggested::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: var(--radius-full);
  background: var(--accent-text); box-shadow: 0 0 0 2px var(--surface-100); z-index: 1; }

/* Calendar month */
.clip-month { background: var(--surface-100); padding: var(--space-4) 0; }
.clip-month h3 { margin: 0 var(--space-4) var(--space-3); font: 600 22px/28px var(--font-rounded); color: var(--ink); }
.clip-month-streak { font: 400 15px/20px var(--font-sans); color: var(--ink-muted); margin-left: var(--space-2); }
.clip-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--gap-grid); padding: 0 var(--gap-grid); }
.clip-week--labels { margin-bottom: var(--space-2); }
.clip-week--labels span { text-align: center; font: 600 11px/13px var(--font-sans); letter-spacing: .06em; color: var(--ink-muted); }
.clip-week + .clip-week { margin-top: var(--gap-grid); }

/* Navigation bar + toolbar */
.clip-navbar { background: var(--surface-000); height: 52px; padding: 0 var(--space-4); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.clip-navbar-title { font: 600 17px/22px var(--font-sans); display: inline-flex; gap: var(--space-1); align-items: center; color: var(--ink); }
.clip-navbar-title svg { width: 14px; height: 14px; }
.clip-navbar > :last-child { justify-self: end; }
.clip-toolbar { background: var(--surface-000); height: 84px; padding: 0 var(--space-6); display: flex; align-items: center; justify-content: space-between; }
.clip-icon-btn { width: var(--size-control); height: var(--size-control); display: grid; place-items: center; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; }
.clip-icon-btn svg { width: var(--size-icon); height: var(--size-icon); }
.clip-icon-btn--muted { color: var(--ink-muted); }

/* Trimmer */
.clip-trim { display: grid; gap: var(--space-2); }
.clip-trim-strip { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); gap: var(--gap-grid); height: 56px; }
.clip-trim-strip > i { border-radius: var(--radius-xs); background: var(--thumb, #3a4a52); }
.clip-trim-win { position: absolute; top: -3px; bottom: -3px; border: 3px solid var(--accent-text); border-inline-width: 12px; border-radius: var(--radius-xs); }
.clip-trim-win::before, .clip-trim-win::after { content: ""; position: absolute; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 2px; background: var(--surface-000); }
.clip-trim-win::before { left: -8px; } .clip-trim-win::after { right: -8px; }
.clip-trim-dim { position: absolute; top: 0; bottom: 0; background: var(--scrim); }
.clip-trim-head { position: absolute; top: -6px; bottom: -6px; width: 2px; border-radius: 1px; background: var(--ink); }
.clip-trim-meta { display: flex; justify-content: space-between; font: 500 13px/16px var(--font-mono); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.clip-trim-meta b { color: var(--accent-text); font-weight: 500; }

/* Segmented (moment length) */
.clip-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; background: var(--surface-300); border-radius: var(--radius-md); }
.clip-seg button { appearance: none; border: 0; background: transparent; min-width: 56px; height: 32px; border-radius: 10px;
  font: 500 13px/16px var(--font-mono); color: var(--ink-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.clip-seg button[aria-pressed="true"] { background: var(--surface-200); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.clip-seg button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.clip-seg .lock { width: 11px; height: 11px; color: var(--ink-faint); }

/* Toast */
.clip-toast { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); background: var(--surface-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-toast); max-width: 360px; }
.clip-toast-disc { flex: none; width: 28px; height: 28px; border-radius: var(--radius-full); display: grid; place-items: center; color: var(--on-status); }
.clip-toast-disc svg { width: 16px; height: 16px; }
.clip-toast--success .clip-toast-disc { background: var(--success); }
.clip-toast--warning .clip-toast-disc { background: var(--warning); }
.clip-toast--danger .clip-toast-disc { background: var(--danger); }
.clip-toast-text { font: 600 15px/20px var(--font-sans); color: var(--ink); }
.clip-toast-text small { display: block; font-weight: 400; color: var(--ink-muted); }

/* Bottom sheet */
.clip-sheet-wrap { position: relative; background: var(--scrim); padding-top: var(--space-8); }
.clip-sheet { background: var(--surface-200); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-sheet); padding: var(--space-2) var(--space-6) var(--space-6); display: grid; gap: var(--space-4); }
.clip-sheet-grabber { justify-self: center; width: 36px; height: 5px; border-radius: 3px; background: var(--line); background: var(--ink-faint); opacity: .5; }
.clip-sheet h4 { margin: 0; font: 700 26px/32px var(--font-sans); color: var(--ink); }
.clip-sheet p { margin: 0; font: 400 15px/20px var(--font-sans); color: var(--ink-muted); max-width: 60ch; }
.clip-sheet-actions { display: grid; gap: var(--space-2); }

/* Premium badge */
.clip-premium { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 8px 0 6px; border-radius: var(--radius-full); background: var(--brand-deep); color: var(--on-accent);
  font: 600 11px/13px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.clip-premium svg { width: 11px; height: 11px; }
.clip-premium--dot { width: 18px; height: 18px; padding: 0; justify-content: center; }
