/*
 * Freends
 * Layout: a quiet sidebar beside one reading column. The tempo switch is the
 * centre of the design: each tempo is a time of day (noon, golden hour, dusk,
 * night) and its colour tints the whole interface.
 */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Warm, quiet neutrals and one accent: easy on the eyes over a long session. */
  --bg: oklch(0.984 0.004 90);
  --bg-sunken: oklch(0.962 0.006 90);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.947 0.006 90);
  --surface-3: oklch(0.912 0.008 90);
  --bubble: oklch(0.942 0.007 90);
  --line: oklch(0.905 0.008 90);
  --line-strong: oklch(0.83 0.01 90);
  --text: oklch(0.23 0.006 90);
  --text-2: oklch(0.43 0.008 90);
  --text-3: oklch(0.59 0.008 90);
  --accent: oklch(0.77 0.11 75);
  --accent-deep: oklch(0.5 0.09 70);
  --on-accent: oklch(0.24 0.03 70);
  --danger: oklch(0.55 0.2 25);
  --danger-soft: oklch(0.55 0.2 25 / 0.1);
  --ok: oklch(0.58 0.14 155);
  --code-bg: oklch(0.97 0.005 90);
  --scrim: oklch(0.2 0.01 90 / 0.36);

  --tok-comment: oklch(0.6 0.01 90);
  --tok-string: oklch(0.5 0.13 150);
  --tok-number: oklch(0.55 0.16 50);
  --tok-keyword: oklch(0.5 0.18 295);
  --tok-fn: oklch(0.5 0.15 250);
  --tok-type: oklch(0.52 0.11 200);

  --shadow-1: 0 1px 2px oklch(0.2 0.01 90 / 0.05), 0 2px 8px oklch(0.2 0.01 90 / 0.04);
  --shadow-2: 0 2px 6px oklch(0.2 0.01 90 / 0.05), 0 12px 32px oklch(0.2 0.01 90 / 0.08);
  --shadow-3: 0 8px 24px oklch(0.2 0.01 90 / 0.1), 0 28px 70px oklch(0.2 0.01 90 / 0.16);

  --accent-ink: var(--accent-deep);
  --accent-wash: color-mix(in oklch, var(--accent) 20%, transparent);
  --thumb: var(--surface);
  --hover: color-mix(in oklch, var(--text) 6%, transparent);
  --hover-strong: color-mix(in oklch, var(--text) 10%, transparent);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.6, 0, 0.2, 1);
  /* Quick and settled: nothing overshoots or lingers. */
  --spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring-soft: cubic-bezier(0.2, 0.8, 0.2, 1);

  --sidebar-w: 272px;
  --column: 740px;
  --beat: 1.4s;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(0.255 0.004 90);
    --bg-sunken: oklch(0.222 0.004 90);
    --surface: oklch(0.295 0.005 90);
    --surface-2: oklch(0.322 0.005 90);
    --surface-3: oklch(0.37 0.006 90);
    --bubble: oklch(0.205 0.004 90);
    --line: oklch(0.34 0.005 90);
    --line-strong: oklch(0.44 0.006 90);
    --text: oklch(0.955 0.006 90);
    --text-2: oklch(0.8 0.008 90);
    --text-3: oklch(0.64 0.008 90);
    --danger: oklch(0.72 0.17 25);
    --danger-soft: oklch(0.72 0.17 25 / 0.14);
    --ok: oklch(0.76 0.14 155);
    --code-bg: oklch(0.215 0.004 90);
    --scrim: oklch(0.1 0.004 90 / 0.6);
    --tok-comment: oklch(0.62 0.01 90);
    --tok-string: oklch(0.82 0.11 150);
    --tok-number: oklch(0.82 0.11 65);
    --tok-keyword: oklch(0.79 0.11 300);
    --tok-fn: oklch(0.81 0.09 240);
    --tok-type: oklch(0.82 0.09 195);
    --shadow-1: 0 1px 2px oklch(0 0 0 / 0.25), 0 2px 8px oklch(0 0 0 / 0.15);
    --shadow-2: 0 2px 6px oklch(0 0 0 / 0.25), 0 12px 32px oklch(0 0 0 / 0.3);
    --shadow-3: 0 8px 24px oklch(0 0 0 / 0.35), 0 28px 70px oklch(0 0 0 / 0.45);
    --accent-ink: var(--accent);
    --accent-wash: color-mix(in oklch, var(--accent) 14%, transparent);
    --thumb: var(--surface-3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.255 0.004 90);
  --bg-sunken: oklch(0.222 0.004 90);
  --surface: oklch(0.295 0.005 90);
  --surface-2: oklch(0.322 0.005 90);
  --surface-3: oklch(0.37 0.006 90);
  --bubble: oklch(0.205 0.004 90);
  --line: oklch(0.34 0.005 90);
  --line-strong: oklch(0.44 0.006 90);
  --text: oklch(0.955 0.006 90);
  --text-2: oklch(0.8 0.008 90);
  --text-3: oklch(0.64 0.008 90);
  --danger: oklch(0.72 0.17 25);
  --danger-soft: oklch(0.72 0.17 25 / 0.14);
  --ok: oklch(0.76 0.14 155);
  --code-bg: oklch(0.215 0.004 90);
  --scrim: oklch(0.1 0.004 90 / 0.6);
  --tok-comment: oklch(0.62 0.01 90);
  --tok-string: oklch(0.82 0.11 150);
  --tok-number: oklch(0.82 0.11 65);
  --tok-keyword: oklch(0.79 0.11 300);
  --tok-fn: oklch(0.81 0.09 240);
  --tok-type: oklch(0.82 0.09 195);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.25), 0 2px 8px oklch(0 0 0 / 0.15);
  --shadow-2: 0 2px 6px oklch(0 0 0 / 0.25), 0 12px 32px oklch(0 0 0 / 0.3);
  --shadow-3: 0 8px 24px oklch(0 0 0 / 0.35), 0 28px 70px oklch(0 0 0 / 0.45);
  --accent-ink: var(--accent);
  --accent-wash: color-mix(in oklch, var(--accent) 14%, transparent);
  --thumb: var(--surface-3);
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
#app {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
::selection {
  background: color-mix(in oklch, var(--accent) 45%, transparent);
}
:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
svg.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.solid {
  fill: currentColor;
  stroke: none;
}
.logo-a {
  fill: var(--accent);
  stroke: none;
}
.logo-b {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.noscript {
  padding: 2rem;
  text-align: center;
}
kbd {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.num {
  font-variant-numeric: tabular-nums;
}

/* Thin, unobtrusive scrollbars. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* ---------------------------------------------------------------- boot */

.boot {
  height: 100%;
  display: grid;
  place-items: center;
}
.boot-mark {
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: scale(0.92);
    opacity: 0.6;
  }
}

/* ---------------------------------------------------------------- buttons */

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background-color 0.15s, color 0.15s, transform 0.2s var(--spring);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn:active {
  transform: scale(0.92);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 550;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  transition: background-color 0.15s, transform 0.2s var(--spring), opacity 0.15s;
}
.btn:hover {
  background: var(--surface-3);
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: color-mix(in oklch, var(--accent) 88%, var(--text));
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover {
  background: color-mix(in oklch, var(--danger) 18%, transparent);
}
.btn-quiet {
  background: none;
  color: var(--text-2);
}
.btn-quiet:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-wide {
  width: 100%;
  height: 46px;
  font-size: 15px;
  border-radius: 13px;
}

/* A toggle switch (role="switch"). */
.switch {
  position: relative;
  width: 42px;
  height: 25px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.25);
  transition: transform 0.18s var(--spring);
}
.switch[aria-checked="true"] {
  background: var(--accent);
}
.switch[aria-checked="true"]::after {
  transform: translateX(17px);
}
.switch[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* A segmented control with a sliding thumb. */
.segmented {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.segmented-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 9px;
  background: var(--thumb);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--spring), width 0.2s var(--spring);
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s;
}
.segmented button[aria-checked="true"] {
  color: var(--text);
}

/* ---------------------------------------------------------------- shell */

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.shell[data-sidebar="closed"] {
  grid-template-columns: 0px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 3;
  width: var(--sidebar-w);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-sunken);
  transition: transform 0.2s var(--spring-soft), opacity 0.16s;
}
.shell[data-sidebar="closed"] .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 8px 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand svg {
  width: 26px;
  height: 26px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 550;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform 0.15s var(--spring), box-shadow 0.2s;
}
.new-chat:hover {
  box-shadow: var(--shadow-2);
}
.new-chat:active {
  transform: scale(0.98);
}
.new-chat .icon {
  color: var(--accent-ink);
}
.new-chat kbd {
  margin-left: auto;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  margin-top: 2px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-3);
  transition: background-color 0.15s;
}
.search:hover,
.search:focus-within {
  background: var(--surface-2);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
}
.search input::placeholder {
  color: var(--text-3);
}
.search input::-webkit-search-cancel-button {
  appearance: none;
}

.chats {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 4px -4px 0;
  padding: 0 4px 12px;
}
.chat-group + .chat-group {
  margin-top: 14px;
}
.chat-group h3 {
  padding: 6px 12px 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.chat-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 35px;
  padding: 0 6px 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s, color 0.15s;
}
.chat-item:hover,
.chat-item[data-menu="open"] {
  background: var(--surface-2);
  color: var(--text);
}
.chat-item[aria-current="page"] {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 550;
}
.chat-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-item .chat-more {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}
.chat-item:hover .chat-more,
.chat-item:focus-within .chat-more,
.chat-item[data-menu="open"] .chat-more {
  opacity: 1;
}
.chat-item .chat-more:hover {
  background: var(--surface);
}
.chat-item input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  margin-left: -6px;
  border: 0;
  border-radius: 6px;
  outline: 2px solid var(--accent-ink);
  background: var(--surface);
}
.chats-empty {
  padding: 18px 12px;
  color: var(--text-3);
  font-size: 13.5px;
}
.chat-item.is-new {
  animation: slide-in 0.2s var(--spring-soft) both;
}
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}
.meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter span {
  position: absolute;
  inset: 0;
  transform-origin: left;
  border-radius: inherit;
  background: var(--accent);
  transition: transform 0.35s var(--ease-out);
}
.meter[data-level="high"] span {
  background: var(--danger);
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 8px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 0.15s;
}
.account:hover,
.account[aria-expanded="true"] {
  background: var(--surface-2);
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.account-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 550;
}
.account .icon {
  color: var(--text-3);
}
.scrim {
  display: none;
}

/* ---------------------------------------------------------------- main */

.main {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: clip;
}
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 14px 0 12px;
}
.topbar .toggle-open {
  transition: opacity 0.15s;
}
.shell[data-sidebar="open"] .topbar .toggle-open {
  width: 0;
  margin-right: -8px;
  opacity: 0;
  pointer-events: none;
}
.chat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text-2);
}
.thread-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 24px;
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 12px 20px 40px;
}
.main[data-empty="true"] .thread-scroll {
  display: none;
}

/* ---------------------------------------------------------------- welcome */

.welcome {
  display: none;
  justify-content: center;
  margin-top: auto;
  padding: 0 20px 30px;
}
.main[data-empty="true"] .welcome {
  display: flex;
}
.greeting {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.2vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  animation: fade-up 0.22s var(--ease-out) both;
}
.greeting-mark {
  width: 34px;
  height: 34px;
  flex: none;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
/* The message box sits a little above the middle of an empty page. */
.main[data-empty="true"] .dock {
  margin-bottom: auto;
  padding-bottom: max(14vh, 24px);
}
.main[data-empty="true"] .fineprint {
  visibility: hidden;
}
/* The old illustrated sky is retired; the sign-in page still creates one. */
.sky {
  display: none !important;
}

/* ---------------------------------------------------------------- messages */

.msg {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.msg.is-new {
  animation: rise 0.2s var(--spring-soft) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.msg-user {
  align-items: flex-end;
  gap: 4px;
}
.msg-user .msg-actions {
  height: 28px;
}
.bubble {
  max-width: min(82%, 600px);
  padding: 10px 16px;
  border-radius: 20px 20px 6px 20px;
  background: var(--surface-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15.5px;
  line-height: 1.55;
}
.msg-user.is-new .bubble {
  transform-origin: 100% 100%;
  animation: bubble-in 0.2s var(--spring) both;
}
@keyframes bubble-in {
  from {
    transform: scale(0.9);
  }
}
.msg-files {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 82%;
}
.file-thumb {
  width: 132px;
  height: 132px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 240px;
  height: 44px;
  padding: 0 14px 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.file-chip .icon {
  color: var(--accent-ink);
}
.file-chip span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.file-chip small {
  color: var(--text-3);
  font-size: 11.5px;
  flex: none;
}
.msg-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.msg:hover .msg-actions,
.msg:focus-within .msg-actions,
.msg:last-child .msg-actions {
  opacity: 1;
}
.msg-actions .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--text-3);
}
.msg-actions .icon-btn .icon {
  width: 16px;
  height: 16px;
}
.edit-box {
  width: min(100%, 600px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: rise 0.18s var(--spring-soft) both;
}
.edit-box textarea {
  width: 100%;
  min-height: 72px;
  max-height: 40vh;
  resize: vertical;
  border: 0;
  outline: 0;
  background: none;
  font-size: 15.5px;
  line-height: 1.55;
}
.edit-box div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.msg-assistant {
  gap: 10px;
}
.msg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12.5px;
}
.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.msg-meta .icon {
  width: 14px;
  height: 14px;
  color: var(--accent-ink);
}
.msg-meta i {
  font-style: normal;
  opacity: 0.5;
}

/* The orbit: a dot circling at the tempo's pace while Opus works. */
.orbit {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklch, var(--text-3) 45%, transparent);
}
.orbit::after {
  content: "";
  position: absolute;
  top: -3.5px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
  transform-origin: 3px 10px;
  animation: orbit var(--beat) linear infinite;
}
@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.thinking {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.thinking-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  margin-left: -8px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  transition: background-color 0.15s, color 0.15s;
}
.thinking-head:hover {
  background: var(--surface-2);
  color: var(--text);
}
.thinking-head .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-ink);
}
.thinking-head .chev {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform 0.18s var(--spring);
}
.thinking[data-open="true"] .chev {
  transform: rotate(90deg);
}
.thinking[data-state="active"] .thinking-label {
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}
.thinking-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.thinking-body {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
}
.thinking[data-open="true"] .thinking-body,
.thinking[data-state="active"] .thinking-body {
  grid-template-rows: 1fr;
}
.thinking-clip {
  min-height: 0;
  overflow: hidden;
}
.thinking-text {
  margin: 6px 0 4px 7px;
  padding: 2px 0 2px 16px;
  border-left: 1.5px solid var(--line-strong);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* While Opus is still thinking, show only the latest few lines, like a ticker. */
.thinking[data-state="active"]:not([data-open="true"]) .thinking-clip {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 5.4em;
  mask-image: linear-gradient(to bottom, transparent, #000 55%);
}

.searches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  height: 30px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  animation: pop 0.2s var(--spring) both;
}
.search-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--accent-ink);
}
.search-chip span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.search-chip[data-state="running"] .icon {
  animation: orbit 1.4s linear infinite;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  height: 30px;
  padding: 0 11px 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.source:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.source b {
  font-weight: 600;
  color: var(--accent-ink);
  flex: none;
}
.source span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  animation: rise 0.18s var(--spring-soft) both;
}
.notice .icon {
  margin-top: 1px;
  color: var(--accent-ink);
}
.notice[data-kind="error"] {
  background: var(--danger-soft);
  color: var(--text);
}
.notice[data-kind="error"] .icon {
  color: var(--danger);
}
.notice button {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent-ink);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- prose */

.prose {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.prose > * {
  margin: 0;
}
.prose > * + * {
  margin-top: 0.85em;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.prose h1 {
  font-size: 1.5em;
}
.prose h2 {
  font-size: 1.28em;
}
.prose h3 {
  font-size: 1.1em;
}
.prose h4 {
  font-size: 1em;
}
.prose > :is(h1, h2, h3, h4):not(:first-child) {
  margin-top: 1.5em;
}
.prose strong {
  font-weight: 650;
}
.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklch, var(--accent-ink) 45%, transparent);
  transition: text-decoration-color 0.15s;
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li + li,
.prose li > ul,
.prose li > ol {
  margin-top: 0.3em;
}
.prose li::marker {
  color: var(--text-3);
}
.prose li.task {
  list-style: none;
  margin-left: -1.4em;
  display: flex;
  gap: 0.55em;
}
.task-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 0.34em;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  color: var(--on-accent);
}
.task-box[data-done="true"] {
  border-color: var(--accent);
  background: var(--accent);
}
.task-box .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.6;
}
.prose blockquote {
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--line-strong);
  color: var(--text-2);
}
.prose blockquote > * + * {
  margin-top: 0.6em;
}
.prose hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 1.6em 0;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}
.prose :not(pre) > code {
  padding: 0.14em 0.42em;
  border-radius: 6px;
  background: var(--surface-2);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.prose table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.93em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
}
.prose th,
.prose td {
  max-width: 34ch;
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: 600;
  font-size: 0.93em;
  color: var(--text-2);
  background: var(--bg-sunken);
  white-space: nowrap;
}
.prose tr + tr td {
  border-top: 1px solid var(--line);
}
.prose td[data-align="right"],
.prose th[data-align="right"] {
  text-align: right;
}
.prose td[data-align="center"],
.prose th[data-align="center"] {
  text-align: center;
}

.code {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--code-bg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
  transition: background-color 0.15s, color 0.15s;
}
.code-copy:hover {
  background: var(--surface-2);
  color: var(--text);
}
.code-copy .icon {
  width: 14px;
  height: 14px;
}
.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.62;
  tab-size: 2;
}
.code pre code {
  font-size: inherit;
}
.tok-comment {
  color: var(--tok-comment);
  font-style: italic;
}
.tok-string {
  color: var(--tok-string);
}
.tok-number {
  color: var(--tok-number);
}
.tok-keyword {
  color: var(--tok-keyword);
}
.tok-fn {
  color: var(--tok-fn);
}
.tok-type {
  color: var(--tok-type);
}

/* ---------------------------------------------------------------- composer */

.dock {
  position: relative;
  flex: none;
  width: 100%;
  max-width: calc(var(--column) + 8px);
  margin: 0 auto;
  padding: 0 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.main[data-empty="false"] .dock::before {
  content: "";
  position: absolute;
  inset: -28px 0 100%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.jump {
  position: absolute;
  left: 50%;
  top: -50px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(8px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.18s var(--spring);
}
.jump[data-show="true"] {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transition: border-color 0.15s, box-shadow 0.18s;
}
.composer:focus-within {
  border-color: color-mix(in oklch, var(--accent-ink) 55%, var(--line));
  box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-wash);
}
.composer[data-drop="true"] {
  border-style: dashed;
  border-color: var(--accent-ink);
  box-shadow: var(--shadow-2), 0 0 0 6px var(--accent-wash);
}
.composer textarea {
  display: block;
  width: 100%;
  max-height: min(42vh, 360px);
  padding: 16px 20px 6px;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font-size: 16px;
  line-height: 1.5;
}
.composer textarea::placeholder {
  color: var(--text-3);
}
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px 10px;
}
.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.composer-right {
  gap: 8px;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  min-width: 34px;
  justify-content: center;
  padding: 0 9px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 550;
  transition: background-color 0.2s, color 0.2s, transform 0.2s var(--spring);
}
.tool:hover {
  background: var(--surface-2);
  color: var(--text);
}
.tool:active {
  transform: scale(0.94);
}
.send {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.12), 0 4px 12px color-mix(in oklch, var(--accent) 40%, transparent);
  transition: transform 0.16s var(--spring), opacity 0.2s, background-color 0.2s, box-shadow 0.2s, border-radius 0.18s var(--spring);
}
.send:hover {
  transform: translateY(-1px);
}
.send:active {
  transform: scale(0.9);
}
.send[disabled] {
  background: var(--surface-3);
  color: var(--text-3);
  box-shadow: none;
  cursor: default;
  transform: none;
}
.send .icon {
  position: absolute;
  width: 19px;
  height: 19px;
  stroke-width: 2.1;
  transition: transform 0.2s var(--spring), opacity 0.2s;
}
.send .send-stop {
  opacity: 0;
  transform: scale(0.3) rotate(-90deg);
}
.composer[data-busy="true"] .send {
  border-radius: 50%;
}
.composer[data-busy="true"] .send-arrow {
  opacity: 0;
  transform: scale(0.3) rotate(90deg);
}
.composer[data-busy="true"] .send-stop {
  opacity: 1;
  transform: none;
}

.tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 12px 0;
}
.tray-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 220px;
  height: 52px;
  padding: 0 30px 0 6px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13px;
  animation: pop 0.18s var(--spring) both;
}
.tray-item img,
.tray-item .tray-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-3);
}
.tray-icon {
  display: grid;
  place-items: center;
  color: var(--accent-ink);
}
.tray-name {
  min-width: 0;
  display: grid;
}
.tray-name span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tray-name small {
  color: var(--text-3);
  font-size: 11.5px;
}
.tray-item[data-state="error"] {
  background: var(--danger-soft);
}
.tray-item[data-state="error"] small {
  color: var(--danger);
}
.tray-item[data-state="uploading"] img,
.tray-item[data-state="uploading"] .tray-icon {
  animation: breathe 1.2s ease-in-out infinite;
}
.tray-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-3);
}
.tray-remove:hover {
  background: var(--surface-3);
  color: var(--text);
}
.tray-remove .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}
.fineprint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------------------------------------------------------- menus */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: menu-in 0.14s var(--spring) both;
}
.menu[data-closing="true"] {
  animation: menu-out 0.12s ease-in both;
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}
@keyframes menu-out {
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  transition: background-color 0.12s;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--surface-2);
  outline: 0;
}
.menu-item .icon {
  color: var(--text-2);
}
.menu-item[data-danger="true"],
.menu-item[data-danger="true"] .icon {
  color: var(--danger);
}
.menu-item small {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
}
.menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}
.menu-label {
  padding: 6px 10px 4px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* ---------------------------------------------------------------- modal */

.backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  animation: fade 0.15s ease-out both;
}
.backdrop[data-closing="true"] {
  animation: fade 0.16s ease-in reverse both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 820px);
  max-height: min(100%, 680px);
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: modal-in 0.2s var(--spring-soft) both;
}
.modal[data-size="small"] {
  width: min(100%, 420px);
}
.backdrop[data-closing="true"] .modal {
  animation: modal-out 0.16s ease-in both;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}
@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px 24px;
}
.modal-head h2 {
  flex: 1;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 24px 24px;
}
.modal-body > * + * {
  margin-top: 22px;
}
.tabs {
  flex: none;
  padding: 0 24px 10px;
}
.confirm p {
  color: var(--text-2);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field {
  display: grid;
  gap: 7px;
}
.field > span,
.field > label,
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.field small,
.hint {
  font-size: 12.5px;
  color: var(--text-3);
}
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.15s;
}
.input {
  height: 44px;
  padding: 0 14px;
}
.textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}
.input:hover,
.textarea:hover {
  border-color: var(--line-strong);
}
.input:focus,
.textarea:focus {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.input[readonly] {
  color: var(--text-2);
  background: var(--surface-2);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.row > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}
.row h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.row p {
  font-size: 13px;
  color: var(--text-3);
}
.divider {
  height: 1px;
  background: var(--line);
}
.form-error {
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  animation: shake 0.4s var(--ease-out);
}
@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  80% {
    transform: translateX(-2px);
  }
}

/* ---------------------------------------------------------------- usage */

.usage-hero {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.usage-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.usage-big strong {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.usage-big span {
  color: var(--text-2);
}
.usage-hero .meter {
  height: 9px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.stat {
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--surface-2);
}
.stat b {
  display: block;
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat span {
  font-size: 12.5px;
  color: var(--text-2);
}
.chart {
  display: grid;
  gap: 8px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: 6px;
  border-bottom: 1px solid var(--line);
}
.chart-bar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.chart-bar span {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  transform-origin: bottom;
  animation: grow 0.25s var(--spring-soft) both;
}
.chart-bar[data-empty="true"] span {
  background: var(--surface-3);
}
.chart-bar:hover span {
  background: var(--accent-ink);
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tempo-rows {
  display: grid;
  gap: 10px;
}
.tempo-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}
.tempo-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tempo-row .icon {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}
.tempo-row .num {
  text-align: right;
  color: var(--text-2);
}

/* ---------------------------------------------------------------- people */

.people-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.invite {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.invite-code {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invite-code code {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.people {
  display: grid;
  gap: 8px;
}
.person {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 10px 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s, opacity 0.2s;
}
.person[data-state="waiting"] {
  border-color: color-mix(in oklch, var(--accent-ink) 45%, var(--line));
}
.person[data-state="paused"] {
  opacity: 0.6;
}
.person-who {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.person-who > div {
  min-width: 0;
}
.person-who b,
.person-who small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.person-who b {
  font-weight: 600;
}
.person-who small {
  color: var(--text-3);
  font-size: 12.5px;
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}
.tag[data-kind="waiting"] {
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.person-budget {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.person-budget .line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.person-budget input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent-ink);
}
.person-pro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* ---------------------------------------------------------------- toasts */

#toasts {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 440px);
  padding: 10px 16px;
  border-radius: 13px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  animation: toast-in 0.2s var(--spring) both;
}
.toast[data-closing="true"] {
  animation: toast-out 0.2s ease-in both;
}
.toast .icon {
  width: 16px;
  height: 16px;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* ---------------------------------------------------------------- auth */

.auth {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: minmax(100%, max-content);
  overflow: auto;
}
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 32px clamp(24px, 5vw, 64px) 40px;
  background: var(--bg-sunken);
  overflow: hidden;
  isolation: isolate;
}
.auth-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% 62%, color-mix(in oklch, var(--accent) 34%, transparent), transparent 72%),
    radial-gradient(40% 30% at 85% 10%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 70%);
}
.auth-hero .sky {
  width: min(460px, 86%);
  margin: 0 auto;
}
.auth-hero h1 {
  max-width: 13ch;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 58px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.auth-hero p {
  max-width: 40ch;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 16px;
}
.auth-tempos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-3);
}
.auth-tempos span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.18s;
}
.auth-tempos .icon {
  width: 16px;
  height: 16px;
}
.auth-tempos span[data-on="true"] {
  color: var(--accent-ink);
  font-weight: 600;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px 24px;
}
.auth-card {
  width: min(100%, 392px);
  display: grid;
  gap: 18px;
  animation: rise 0.22s var(--spring-soft) both;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.auth-card .sub {
  margin-top: -12px;
  color: var(--text-2);
}
.auth-card .segmented {
  display: grid;
}
.auth-fields {
  display: grid;
  gap: 14px;
}
.collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.2s var(--spring-soft), opacity 0.16s, margin 0.2s var(--spring-soft);
}
.collapse > div {
  min-height: 0;
  overflow: hidden;
  /* room for the focus ring that overflow would otherwise clip */
  margin: -5px;
  padding: 5px;
}
.collapse[data-collapsed="true"] {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: -14px;
  pointer-events: none;
}
.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}
.strength-bar {
  display: flex;
  gap: 4px;
}
.strength-bar i {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background-color 0.16s;
}
.strength-bar i[data-on="true"] {
  background: var(--accent-ink);
}
.auth-foot {
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.waiting {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden auto;
}
.waiting-card {
  width: min(100%, 440px);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  animation: rise 0.22s var(--spring-soft) both;
}
.waiting-card h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.waiting-card p {
  color: var(--text-2);
  max-width: 36ch;
}
.waiting-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 860px) {
  .shell,
  .shell[data-sidebar="closed"] {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-w), 86vw);
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    box-shadow: var(--shadow-3);
  }
  .scrim {
    display: block;
    position: fixed;
    z-index: 2;
    inset: 0;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s;
  }
  .shell[data-sidebar="open"] .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .shell[data-sidebar="open"] .topbar .toggle-open {
    width: 34px;
    margin-right: 0;
    opacity: 1;
    pointer-events: auto;
  }
  .new-chat kbd,
  .search kbd {
    display: none;
  }
  .auth {
    display: block;
  }
  .auth-hero {
    padding-bottom: 28px;
  }
  .auth-hero .sky {
    width: min(300px, 70%);
  }
  .person {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .person-budget {
    grid-column: 1 / -1;
    order: 4;
  }
}
@media (max-width: 560px) {
  .thread {
    padding-inline: 16px;
    gap: 22px;
  }
  .dock {
    padding-inline: 10px;
  }
  .pick-tempo,
  .tool-chip span,
  .model-pick .chev {
    display: none;
  }
  .model-pick {
    padding: 0 8px;
  }
  .composer-right {
    gap: 6px;
  }
  .bubble,
  .msg-files {
    max-width: 90%;
  }
  .modal-head {
    padding-left: 18px;
  }
  .modal-body,
  .tabs {
    padding-inline: 18px;
  }
  .backdrop {
    padding: 0;
    place-items: end center;
  }
  .modal {
    max-height: 92%;
    border-radius: 22px 22px 0 0;
  }
  .fineprint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- odds and ends */

/* Only the newest reply can be retried. */
.msg-assistant:not(:last-child) .retry {
  display: none;
}
.edit-box .hint {
  margin-right: auto;
  align-self: center;
}
.modal-stack > * + * {
  margin-top: 22px;
}
.trailing {
  align-items: center;
}
.btn .orbit {
  border-color: color-mix(in oklch, var(--on-accent) 35%, transparent);
}
.btn .orbit::after {
  background: var(--on-accent);
}
.sidebar .brand .icon,
.auth-hero .brand .icon {
  width: 26px;
  height: 26px;
  stroke: none;
}
.auth-hero .brand {
  align-self: flex-start;
}

.dock-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  font-size: 13.5px;
  animation: rise 0.18s var(--spring-soft) both;
}
.dock-alert > .icon {
  color: var(--danger);
}
.dock-alert span {
  flex: 1;
  min-width: 0;
}
.dock-alert button {
  font-weight: 600;
  color: var(--accent-ink);
  white-space: nowrap;
}
.dock-alert-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.dock-alert-close .icon {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

/* Menu items that carry a line of explanation. */
.menu:has(.tall) {
  width: min(300px, calc(100vw - 16px));
}
.menu-item.tall {
  height: auto;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 10px;
}
.menu-item.tall .icon {
  margin-top: 2px;
}
.menu-item .bars {
  color: var(--accent-ink);
}
.menu-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.menu-text b {
  font-weight: 600;
}
.menu-item .menu-text small {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-3);
}
.menu-item .menu-check {
  width: 16px;
  height: 16px;
  color: var(--accent-ink);
  stroke-width: 2.2;
}
.tempo-row .bars {
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------- quiet layer
   Calmer versions of the shell, the message box and the messages, plus the
   pieces for running code, memory and generated files. */

.sidebar {
  gap: 2px;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.new-chat {
  height: 38px;
  font-weight: 500;
  background: none;
  box-shadow: none;
}
.new-chat:hover {
  background: var(--hover);
  box-shadow: none;
}
.search {
  height: 38px;
}
.search:hover,
.search:focus-within {
  background: var(--hover);
}
.chat-group h3 {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.chat-item {
  height: 34px;
}
.chat-item:hover,
.chat-item[data-menu="open"] {
  background: var(--hover);
}
.chat-item[aria-current="page"] {
  background: var(--hover-strong);
  font-weight: 500;
}
.chat-item .chat-more:hover {
  background: var(--hover);
}
.account:hover,
.account[aria-expanded="true"] {
  background: var(--hover);
}
.avatar {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}
.account-name {
  font-weight: 500;
}

.thread {
  gap: 28px;
}
.bubble {
  border-radius: 18px;
  background: var(--bubble);
}
.msg-user.is-new .bubble {
  animation: none;
}
.msg.is-new {
  animation: fade-up 0.18s var(--ease-out) both;
}
.prose {
  font-size: 16px;
  line-height: 1.7;
}
.msg-meta {
  font-size: 12px;
}

.composer {
  border-radius: 20px;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 6px 20px oklch(0 0 0 / 0.05);
}
.composer:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 6px 20px oklch(0 0 0 / 0.07);
}
.composer[data-drop="true"] {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.composer textarea {
  padding: 16px 18px 4px;
}
.composer-row {
  padding: 6px 8px 8px;
}
.tool {
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  font-weight: 500;
}
.tool:hover {
  background: var(--hover);
}
.tool.plus {
  width: 32px;
  padding: 0;
  border: 1px solid var(--line);
}
.tool.plus[aria-expanded="true"] {
  background: var(--hover);
}
.tool-chips {
  display: flex;
  gap: 4px;
  min-width: 0;
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
  animation: pop 0.16s var(--ease-out) both;
}
.tool-chip .icon {
  width: 15px;
  height: 15px;
}
.tool-chip .chip-x {
  width: 0;
  opacity: 0;
  transition: width 0.2s var(--ease-out), opacity 0.15s;
}
.tool-chip:hover .chip-x,
.tool-chip:focus-visible .chip-x {
  width: 12px;
  opacity: 0.8;
}
.model-pick {
  gap: 6px;
  padding: 0 8px 0 10px;
  color: var(--text);
  font-size: 13.5px;
}
.pick-tempo {
  color: var(--text-3);
  font-weight: 400;
}
.model-pick .chev {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform 0.16s var(--ease-out);
}
.model-pick[aria-expanded="true"] {
  background: var(--hover);
}
.model-pick[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}
.send {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}
.send:hover {
  transform: none;
  opacity: 0.88;
}
.send[disabled] {
  opacity: 1;
}
.composer[data-busy="true"] .send {
  border-radius: 9px;
}
.send .icon {
  width: 17px;
  height: 17px;
}
.fineprint {
  font-size: 11.5px;
}

/* Running code: one quiet line per step, opened to see the code and output. */
.steps {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.step-head,
.memory-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  height: 30px;
  margin-left: -8px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  transition: background-color 0.15s, color 0.15s;
}
.step-head:hover,
.memory-line:hover {
  background: var(--hover);
  color: var(--text);
}
.step-head .icon,
.memory-line .icon {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}
.step-label,
.memory-line span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.step-head .chev {
  width: 14px;
  height: 14px;
  transition: transform 0.16s var(--ease-out);
}
.step[data-open="true"] .chev {
  transform: rotate(90deg);
}
.step[data-state="running"] .step-label,
.memory-line[data-state="running"] span {
  animation: pulse 1.6s ease-in-out infinite;
}
.step[data-state="failed"] .step-head .icon:first-child {
  color: var(--danger);
}
.step-wrap {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
}
.step[data-open="true"] .step-wrap {
  grid-template-rows: 1fr;
}
.step-clip {
  min-height: 0;
  overflow: hidden;
}
.step-body {
  display: grid;
  gap: 8px;
  padding: 4px 0 10px;
}
.step-code {
  font-size: 14px;
}
.step-out {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.step-out[data-kind="error"] {
  color: var(--danger);
}
.memory-line {
  align-self: flex-start;
  color: var(--text-3);
  font-size: 13px;
}

/* Files Claude made. */
.outputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.output-image {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: oklch(1 0 0);
}
.output-image img {
  display: block;
  max-width: 100%;
  max-height: 440px;
  height: auto;
}
.outputs .file-chip {
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s;
}
.outputs .file-chip:hover {
  background: var(--hover);
}

/* Settings: what Claude remembers. */
.notes {
  display: grid;
  gap: 10px;
}
.note {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.note-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 5px 5px 14px;
  background: var(--surface-2);
}
.note-head b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13.5px;
  font-weight: 600;
}
.note-head small {
  color: var(--text-3);
  font-size: 12px;
}
.note pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px 14px 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- performance */

/* Contents of a section fade in as it opens. */
.thinking[data-open="true"] .thinking-text,
.step[data-open="true"] .step-body {
  animation: fade 0.15s ease-out both;
}
/* Long chats: the browser skips laying out and painting messages far off screen. */
.thread > .msg:not(:nth-last-child(-n + 4)) {
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

/* ---------------------------------------------------------------- what Claude is doing */

.activity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.activity-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 30px;
  margin-left: -8px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--text-3);
  font-size: 14.5px;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.activity-head:hover {
  background: var(--hover);
  color: var(--text-2);
}
.activity-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.activity .chev {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.2s var(--ease-out);
}
.activity[data-open="true"] .chev {
  transform: rotate(90deg);
}
.dots {
  display: inline-flex;
  gap: 3px;
  flex: none;
}
.dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-ink);
  animation: dot 1.2s ease-in-out infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.16s;
}
.dots i:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes dot {
  0%,
  70%,
  100% {
    opacity: 0.25;
  }
  35% {
    opacity: 1;
  }
}
.activity[data-state="done"] .dots {
  display: none;
}
.activity-body {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px 0 4px;
}
.activity[data-open="true"] .activity-body {
  display: flex;
  animation: fade 0.15s ease-out both;
}
.activity-body .thinking-text {
  align-self: stretch;
  margin: 0 0 4px 7px;
}

/* ---------------------------------------------------------------- settings */

.modal[data-size="settings"] {
  width: min(100%, 880px);
  height: min(100%, 640px);
}
.modal[data-size="settings"] .modal-head h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal[data-size="settings"] .modal-body {
  display: flex;
  padding: 0;
  overflow: hidden;
}
.settings {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.settings-tab:hover {
  background: var(--hover);
  color: var(--text);
}
.settings-tab[aria-current="true"] {
  background: var(--hover-strong);
  color: var(--text);
}
.settings-tab .icon {
  width: 18px;
  height: 18px;
}
.settings-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 28px;
}

/* Usage: a line per thing, with how much of the month's allowance it has used. */
.usage-lines {
  display: grid;
  gap: 20px;
}
.usage-line {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 84px;
  align-items: center;
  gap: 24px;
}
.usage-what {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.usage-what b {
  font-size: 14.5px;
  font-weight: 500;
}
.usage-what small {
  color: var(--text-3);
  font-size: 13px;
}
.usage-line .meter {
  height: 7px;
}
.usage-pct {
  color: var(--text-2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.usage-heading {
  font-size: 15px;
  font-weight: 600;
}
.chart .usage-heading {
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .settings {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .settings-tab {
    flex: none;
    height: 34px;
  }
  .settings-content {
    padding: 18px 18px 24px;
  }
  .usage-line {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .usage-line .meter {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
