/* The components, verbatim from the app
   GENERATED by scripts/gen-design-kit.mjs from apps/calvin/src/app/globals.css.
   Do not edit here — an edit is a value the app does not have, which is the drift
   this file exists to end. Change globals.css and re-run.
   The system is documented in apps/calvin/DESIGN_SYSTEM.md. */

/* 86 rules, extracted rather than reimplemented. A preview that uses
   these classes runs the same CSS the app runs. */

.ld-selectable,
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

.pt-safe {
  padding-top: env(safe-area-inset-top);
}

.ld-press {
  transition: transform var(--dur-2) var(--ease-spring), opacity var(--dur-1) ease,
    background-color var(--dur-2) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ld-press:active {
  transform: scale(0.965);
  transition-duration: var(--dur-1);
}

@media (prefers-reduced-motion: reduce) {
  .ld-press { transition: none; }
  .ld-press:active { transform: none; }
}

.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding: 0 14px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--dur-2) var(--ease-spring), opacity var(--dur-1) ease,
    background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.ld-btn:active { transform: scale(0.965); transition-duration: var(--dur-1); }

.ld-btn:disabled { opacity: 0.45; cursor: default; }

.ld-btn:disabled:active { transform: none; }

.ld-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.ld-btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

.ld-btn-danger { background: none; border-color: var(--red-edge); color: var(--red); }

.ld-btn-plain { padding: 0 6px; border-color: transparent; background: none; color: var(--accent); font-weight: 500; }

.ld-tap { position: relative; }

.ld-tap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, var(--tap-min));
  height: max(100%, var(--tap-min));
}

.ld-field {
  width: 100%;
  min-height: var(--tap-min);
  box-sizing: border-box;
  padding: 8px 12px;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-field);
  outline: none;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}

.ld-field:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ld-field::placeholder { color: var(--text-5); }

@media (prefers-reduced-motion: reduce) {
  .ld-btn { transition: none; }
  .ld-btn:active { transform: none; }
}

.ld-surface {
  background: var(--surface-grad);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--hairline), var(--shadow-1);
}

.ld-skeleton {
  position: relative;
  overflow: hidden;
}

.ld-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: ld-shimmer 1.4s ease-in-out infinite;
}

@keyframes ld-shimmer {
  100% { transform: translateX(100%); }
}

.ld-page {
  animation: ld-page-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ld-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ld-rise {
  animation: ld-rise-in 0.42s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes ld-rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ld-tabbar {
  background: rgba(17, 17, 19, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ld-tab-pill {
  position: absolute;
  top: 6px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  pointer-events: none;
  will-change: transform;
}

.ld-navbar {
  --t: 0; /* @kind other */
  --gutter: 12px;
  position: sticky;
  /* Sticks to the top of the SAFE area, not the top of the viewport. With the
     status bar reserved by iOS (`statusBarStyle: black`) this resolves to 0 and
     is a no-op; anywhere the app does draw under the status bar — landscape, a
     future translucent style — `top: 0` would park the condensed title behind
     the clock as soon as a page scrolled. */
  top: env(safe-area-inset-top);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  margin: 0 calc(-1 * var(--gutter)) 12px;
  padding: 0 var(--gutter);
}

.ld-navbar-bg {
  position: absolute;
  inset: 0;
  opacity: var(--t);
  background: rgba(12, 12, 14, 0.74);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.ld-navbar-title {
  position: relative;
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  /* 26px → 17px, done as a scale so it never touches layout. */
  transform: scale(calc(1 - var(--t) * 0.346));
  transform-origin: center center;
}

.ld-navbar-right {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  /* Fades out as the bar condenses — at 17px the title and a date side by side
     in a 46px bar is more than the bar can carry. */
  opacity: calc(1 - var(--t));
  pointer-events: none;
}

.ld-navbar-action {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.ld-segmented {
  position: relative;
  display: flex;
  background: #0c0c0e;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 12px;
}

.ld-segmented-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #202027 0%, #191920 100%);
  box-shadow: var(--hairline), var(--shadow-1);
  pointer-events: none;
  transition: transform var(--dur-3) var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {
  .ld-segmented-thumb { transition: none; }
}

.ld-segmented-xs {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
}

.ld-scrim {
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ld-sheet {
  /* Lifted a shade above .ld-surface — a sheet sits on top of the cards, and
     matching their exact value made it read as flush with the page. */
  background: linear-gradient(180deg, #1a1a1f 0%, #101013 42%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--hairline), var(--shadow-3);
  will-change: transform;
}

.ld-sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: #3f3f46;
}

.ld-key {
  background-color: #1c1c1e;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform var(--dur-2) var(--ease-spring),
    background-color var(--dur-2) var(--ease-out);
}

.ld-key:active,
.ld-key-down {
  transform: scale(0.9);
  background-color: #3a3a3c;
  transition-duration: 0.04s;
}

.ld-key-back { background-color: #151517; }

.ld-key-back:active,
.ld-key-back.ld-key-down { background-color: #3a3a3c; }

@keyframes ld-dot-fill {
  0%   { transform: scale(0.4); }
  55%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.ld-dot-filled { animation: ld-dot-fill 0.26s var(--ease-out) both; }

@keyframes ld-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(220%); }
}

.ld-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ld-sweep 0.9s var(--ease-in-out) infinite;
}

@keyframes ld-unlock {
  to { opacity: 0; transform: scale(1.04); filter: blur(2px); }
}

.ld-unlock { animation: ld-unlock 0.32s var(--ease-out) both; }

.ld-graph-in { animation: ld-graph-in 0.5s var(--ease-out) both; }

@keyframes ld-graph-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Goo chat ────────────────────────────────────────────────────────────────
   The chat is a PRESENTED SHEET, not a page: scrim behind it (`.ld-scrim`, the
   same one every modal uses), a translucent header and composer that never
   move, and the transcript scrolling between them. It borrows the sheet's
   surface and the nav bar's blur on purpose — Goo used to be the one full-screen
   surface in the app built from its own flat hex literals, which is why it read
   as a different product from the notes pages.

   THE LOCK — the bug this shape exists to fix. Focusing the composer pushed
   Goo's first message off the top of the screen. `100dvh` does not shrink for
   the keyboard (dvh tracks browser chrome, not the input accessory), so the
   panel stayed screen-tall while iOS slid the visual viewport up to reveal the
   field — and a `position: fixed` layer rides the visual viewport, so the whole
   chat went up with it and the top third was simply gone. Nothing in CSS can see
   the keyboard, so `.ld-goo-frame` is sized and offset from `visualViewport` in
   JS (goo-chat.tsx) and everything below lays out inside what is actually
   visible. Two consequences are encoded here rather than there:
     * the transcript BOTTOM-ANCHORS (`.ld-goo-log > div { margin-top: auto }

.ld-goo-frame {
  --kb-inset: env(safe-area-inset-bottom);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  /* Replaced imperatively by the visualViewport subscription; this is only what
     the first paint uses, before the listener has run once. */
  height: 100dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  overscroll-behavior: none;
  /* Nothing in the frame scrolls except the transcript, which opts back in with
     `pan-y`. Without this a drag anywhere else rubber-bands the page behind. */
  touch-action: none;
}

.ld-goo-panel {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  transform-origin: center 62%;
  will-change: transform, opacity;
}

.ld-goo-bar {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: rgba(12, 12, 14, 0.74);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.ld-goo-head { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06); }

.ld-goo-foot { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }

.ld-goo-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ld-goo-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.ld-goo-log > div { margin-top: auto; }

.ld-goo-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ld-goo-row-me { justify-content: flex-end; }

.ld-goo-row > svg,
.ld-goo-trigger > svg { flex-shrink: 0; }

.ld-bubble {
  max-width: 82%;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.ld-bubble-goo {
  background: var(--surface-grad);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--hairline), var(--shadow-1);
  border-bottom-left-radius: 6px;
}

.ld-bubble-me {
  background: linear-gradient(180deg, #6f72f7 0%, #5457e4 100%);
  box-shadow: var(--hairline), var(--shadow-2);
  border-bottom-right-radius: 6px;
}

.ld-msg { animation: ld-msg-in 0.3s var(--ease-out) both; }

@keyframes ld-msg-in {
  from { opacity: 0; transform: translateY(7px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ld-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ld-typing i {
  width: var(--dot, 6px);
  height: var(--dot, 6px);
  border-radius: 999px;
  background: currentColor;
  animation: ld-typing-wave 1.3s var(--ease-in-out) infinite;
}

.ld-typing i:nth-child(2) { animation-delay: 0.16s; }

.ld-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes ld-typing-wave {
  0%, 62%, 100% { transform: translateY(0); opacity: 0.4; }
  31%           { transform: translateY(-4px); opacity: 1; }
}

.ld-composer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 4px 6px 4px 13px;
  transition: box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.ld-composer:focus-within {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ld-composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  background: none;
  border: none;
  outline: none;
  padding: 7px 0;
  /* 16px is a hard floor on every input in this app: below it iOS Safari zooms
     the page on focus and never zooms back — which, on this surface, zoomed the
     chat and scrolled the header off the top. It was 15. */
  font-size: 16px;
  line-height: 1.45;
  font-family: inherit;
  color: var(--text);
  max-height: 124px;
  overflow-y: auto;
  /* A textarea soft-wraps at spaces and nothing else, so one long unbroken
     token — a URL, a note slug, a hash — scrolls the field sideways instead of
     wrapping, and the start of your own sentence goes off the left edge. Same
     rule the bubbles have carried all along. */
  overflow-wrap: anywhere;
}

.ld-composer textarea::placeholder { color: #52525b; }

.ld-goo-send {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}

.ld-goo-send:disabled { opacity: 0.3; transform: scale(0.92); cursor: default; }

.ld-goo-jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  /* Nearly opaque, not merely tinted: it floats over a wall of reply text, and
     at 0.92 the sentence behind it read straight through the label. */
  background: rgba(28, 28, 32, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  animation: ld-msg-in 0.22s var(--ease-out) both;
}

.ld-goo-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 9px 9px 11px;
  border-radius: var(--radius);
  background: var(--surface-grad);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--hairline), var(--shadow-1);
}

@media (prefers-reduced-motion: reduce) {
  .ld-skeleton::after { animation: none; }
  .ld-page { animation: none; }
  .ld-rise { animation: none; }
  .ld-dot-filled { animation: none; }
  .ld-sweep::after { animation: none; }
  .ld-unlock { animation: none; }
  .ld-key { transition: none; }
  .ld-key:active, .ld-key-down { transform: none; }
  .ld-msg { animation: none; }
  .ld-graph-in { animation: none; }
  .ld-goo-jump { animation: none; }
  /* The typing dots keep animating: they are not decoration, they are the only
     signal that Goo is working. Reduced to a fade in place, no travel. */
  .ld-typing i { animation-name: ld-typing-fade; }
  .ld-goo-send { transition: none; }
}

@keyframes ld-typing-fade {
  0%, 62%, 100% { opacity: 0.4; }
  31%           { opacity: 1; }
}
