/* NOVA AI · components.css
   Everything you can see and touch. Layout/positioning of the shell lives in layout.css. */

/* ---------- Buttons ---------- */

.icon-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { background: var(--press); transform: scale(0.94); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn--sm .icon { width: 17px; height: 17px; }
.icon-btn.is-done { color: var(--spark-ink); }
@media (pointer: coarse) {
  .icon-btn { width: var(--tap); height: var(--tap); }
  .icon-btn--sm { width: 40px; height: 40px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  font-size: var(--fs-md);
  font-weight: 600;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--field-line); background-color: var(--sunken); }
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background-color: var(--ink); border-color: var(--ink); opacity: 0.88; }
.btn--primary.is-danger { background: var(--danger); border-color: var(--danger); color: var(--on-ink); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background-color: var(--danger-soft); }
.btn--block { width: 100%; justify-content: flex-start; }
.btn--block + .btn--block { margin-top: 10px; }

/* ---------- Brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; border-radius: var(--r-md); }
.brand__mark { width: 28px; height: 28px; color: var(--ink); }
.brand__name { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.brand__ai { margin-left: 5px; font-size: 0.62em; font-weight: 600; letter-spacing: 0.01em; color: var(--spark-ink); vertical-align: 0.42em; }

/* ---------- Sidebar: new chat, search, history, profile ---------- */

.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-md);
  font-weight: 600;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.new-chat:hover { border-color: var(--line-strong); }
.new-chat:active { transform: scale(0.985); }
.new-chat__plus { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--spark); color: #241f1a; }
.new-chat__plus .icon { width: 16px; height: 16px; stroke-width: 2.4; }

.search { position: relative; display: flex; align-items: center; }
.search__icon { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search__input {
  width: 100%;
  min-height: 40px;
  padding: 0 38px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--sunken);
  font-size: 1rem;
  outline: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.search__input::placeholder { color: var(--ink-3); }
.search__input:focus { background: var(--surface); border-color: var(--field-line); }
.search__input::-webkit-search-cancel-button, .search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search__clear { position: absolute; right: 5px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-3); }
.search__clear:hover { background: var(--hover); color: var(--ink); }
.search__clear .icon { width: 16px; height: 16px; }

.history__group + .history__group { margin-top: 14px; }
.history__label { padding: 6px 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.history__item { position: relative; display: flex; align-items: center; border-radius: var(--r-md); }
.history__link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 42px 0 12px;
  border-radius: var(--r-md);
  text-align: left;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.history__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__item:hover .history__link { background: var(--hover); color: var(--ink); }
.history__item.is-active .history__link { background: var(--press); color: var(--ink); font-weight: 600; }
.history__item.is-active::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: var(--spark); }
.history__more {
  position: absolute;
  right: 3px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.history__item:hover .history__more, .history__item.is-active .history__more, .history__more:focus-visible, .history__more[aria-expanded="true"] { opacity: 1; }
.history__more:hover { background: var(--press); color: var(--ink); }
@media (hover: none) { .history__more { opacity: 1; } }
@media (pointer: coarse) {
  .history__link { min-height: var(--tap); }
  .history__more { width: 40px; height: 40px; margin-top: -20px; right: 2px; }
}
.history__empty { padding: 32px 16px; text-align: center; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-3); }
.history__empty strong { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink-2); }

.profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 10px 4px 6px;
  border-radius: var(--r-lg);
  text-align: left;
  transition: background-color var(--t-fast) var(--ease);
}
.profile:hover { background: var(--hover); }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 0.875rem; font-weight: 700; }
.profile__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.profile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; }
.profile__sub { font-size: var(--fs-xs); color: var(--ink-3); }
.profile__gear { width: 18px; height: 18px; color: var(--ink-3); }

/* The theme button shows the theme you will switch to */
.theme-icon--sun { display: none; }
[data-theme="dark"] .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* ---------- Menu (conversation actions) ---------- */

.menu {
  position: fixed;
  z-index: var(--z-menu);
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: pop-in var(--t-fast) var(--ease);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-md);
  text-align: left;
  font-size: var(--fs-md);
  font-weight: 500;
}
.menu__item:hover, .menu__item:focus-visible { background: var(--hover); outline-offset: -2px; }
.menu__item .icon { width: 18px; height: 18px; color: var(--ink-3); }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.menu__item--danger:hover, .menu__item--danger:focus-visible { background: var(--danger-soft); }
@media (pointer: coarse) { .menu__item { min-height: var(--tap); } }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 28rem);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--toast-bg);
  color: var(--toast-ink);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-md);
  line-height: 1.35;
  pointer-events: auto;
  animation: toast-in var(--t-med) var(--ease);
}
.toast .icon { width: 18px; height: 18px; }
.toast.is-leaving { animation: toast-out var(--t-fast) var(--ease) forwards; }
.toast__action { margin-left: auto; padding-left: 8px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------- Welcome (the one expressive moment: the spark ignites once on load) ---------- */

.hero-mark { position: relative; display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px; color: var(--ink); }
.hero-mark__svg { width: 56px; height: 56px; overflow: visible; }
.hero-mark__svg .mark-ring { stroke-width: 3; }
.hero-mark__svg .mark-spark { transform-box: fill-box; transform-origin: center; animation: spark-ignite 900ms var(--ease) 200ms both; }
.hero-mark__halo { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--spark); opacity: 0; animation: halo 1200ms var(--ease) 300ms 1 both; }
body.is-settled .hero-mark__halo { display: none; }
body.is-settled .hero-mark__svg .mark-spark { animation: none; }

.greeting { font-size: var(--fs-hero); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
.greeting-sub { margin-top: 10px; font-family: var(--font-read); font-size: 1.1rem; line-height: 1.5; color: var(--ink-2); }

.suggestions { display: grid; gap: 10px; width: 100%; margin-top: 28px; }
.chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 16px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: left;
  font-size: var(--fs-md);
  font-weight: 500;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.chip .icon { color: var(--spark-ink); }
.chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.chip:active { transform: scale(0.985); }
@media (min-width: 640px) { .suggestions { grid-template-columns: 1fr 1fr; } }

@keyframes spark-ignite { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.55); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes halo { 0% { transform: scale(0.55); opacity: 0; } 18% { opacity: 0.75; } 100% { transform: scale(2.4); opacity: 0; } }

/* ---------- Messages: your words in the grotesque, NOVA's replies in the reading serif ---------- */

.msg { display: flex; flex-direction: column; min-width: 0; }
.msg.is-new { animation: msg-in var(--t-med) var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg--user { align-items: flex-end; }
.msg__bubble {
  max-width: 88%;
  padding: 10px 16px;
  border-radius: 20px 20px 6px 20px;
  background: var(--bubble);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg--user .msg__actions { margin-top: 2px; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.msg--user:hover .msg__actions, .msg--user:focus-within .msg__actions { opacity: 1; }
@media (hover: none) { .msg--user .msg__actions { display: none; } }

.msg__content { min-width: 0; font-family: var(--font-read); font-size: var(--fs-read); line-height: var(--lh-read); overflow-wrap: anywhere; }
.msg__content:empty { display: none; }
.msg__foot { display: flex; align-items: center; gap: 2px; min-height: 34px; margin-top: 10px; }
.msg__mark { flex: none; width: 22px; height: 22px; margin-right: 8px; color: var(--ink-3); }
.msg__mark svg { width: 100%; height: 100%; }
.msg[data-status="streaming"] .msg__mark { color: var(--ink); }
.msg[data-status="streaming"] .msg__mark svg { animation: orbit 1.5s linear infinite; }
.msg[data-status="streaming"] .msg__actions { visibility: hidden; }
@keyframes orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .msg[data-status="streaming"] .msg__mark { color: var(--spark-ink); } }

.msg__actions { display: flex; gap: 2px; }
/* "Another reply" only makes sense on the newest message; copying needs some text to copy */
.msg--assistant:not(:last-child) [data-action="regenerate"] { display: none; }
.msg__content:empty ~ .msg__foot [data-action="copy"] { display: none; }
.msg__tag { margin-left: 8px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--hover); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.msg__error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-md);
  line-height: 1.4;
}
.msg__error .icon { margin-top: 1px; }
.msg__error span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.msg__error button { flex: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* On a touch screen the retry link gets a full-size tap area (44px) without changing how it looks or where it sits */
@media (pointer: coarse) { .msg__error button { padding: 12px 8px; margin: -12px -8px; } }

/* ---------- Prose: rendered markdown inside replies ---------- */

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 650; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 1.6em 0 0.55em; font-family: var(--font-ui); font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
.prose h2 { font-size: 1.35em; }
.prose h3 { font-size: 1.17em; }
.prose h4, .prose h5, .prose h6 { font-size: 1.02em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.3em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--ink-3); }
.prose li > ul, .prose li > ol { margin: 0.3em 0; }
.prose a { color: var(--spark-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose blockquote { margin: 0 0 1em; padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.prose hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--line); }
.prose :not(pre) > code { padding: 0.15em 0.4em; border: 1px solid var(--line); border-radius: 6px; background: var(--code-bg); font-family: var(--font-mono); font-size: 0.86em; }

.code { margin: 0 0 1.1em; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--code-bg); }
.code__head { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 3px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-ui); }
.code__lang { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.code__copy { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.code__copy:hover { background: var(--hover); color: var(--ink); }
.code__copy .icon { width: 15px; height: 15px; }
.code__copy.is-done { color: var(--spark-ink); }
.code__pre { margin: 0; padding: 14px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; white-space: pre; tab-size: 2; color: var(--ink); }
.code__pre code { padding: 0; border: 0; background: none; font: inherit; }

.table-wrap { margin: 0 0 1.1em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.9em; line-height: 1.45; }
.prose th, .prose td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--sunken); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose .al-c { text-align: center; }
.prose .al-r { text-align: right; }

/* ---------- Composer ---------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-composer);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}
.composer:focus-within { border-color: var(--field-line); box-shadow: var(--shadow-composer), 0 0 0 4px var(--spark-soft); }
.composer__input {
  flex: 1;
  min-width: 0;
  max-height: min(38vh, 14rem);
  padding: 9px 0;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 1rem;
  line-height: 1.5;
  overflow-y: auto;
}
.composer__input::placeholder { color: var(--ink-3); }
.composer__send {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.composer__send .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.composer__send .icon--stop { display: none; }
.composer__send[data-state="stop"] .icon--send { display: none; }
.composer__send[data-state="stop"] .icon--stop { display: block; }
.composer__send:disabled { background: var(--press); color: var(--ink-3); }
.composer__send:not(:disabled):hover { transform: scale(1.06); }
.composer__send:not(:disabled):active { transform: scale(0.93); }
.composer__note { margin-top: 8px; text-align: center; font-size: var(--fs-xs); line-height: 1.4; color: var(--ink-3); }

.scroll-down {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--ink-2);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.scroll-down.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* ---------- Dialogs: settings (sheet on phones), confirm and rename (centred) ---------- */

.dialog { max-width: none; max-height: none; padding: 0; overflow: visible; border: 0; background: transparent; color: var(--ink); }
.dialog::backdrop { background: var(--scrim); animation: fade-in var(--t-med) var(--ease); }
.dialog.is-closing::backdrop { animation: fade-out var(--t-fast) var(--ease) forwards; }
.dialog[open] { animation: dialog-in var(--t-med) var(--ease); }
.dialog.is-closing { animation: dialog-out var(--t-fast) var(--ease) forwards; }

.dialog__panel { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-lg); }
.dialog--alert { width: min(92vw, 24rem); }
.dialog--alert .dialog__panel { padding: 22px 22px 18px; }
.dialog--sheet { width: min(92vw, 34rem); }
.dialog--sheet .dialog__panel { max-height: 88vh; max-height: min(88dvh, 46rem); }

.dialog__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.dialog__title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.dialog__text { margin: 8px 0 4px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog__body { flex: 1; min-height: 0; padding: 0 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.dialog__about { margin-top: 18px; font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-3); }

@media (max-width: 639.98px) {
  .dialog--sheet { width: 100%; margin: auto 0 0; }
  .dialog--sheet .dialog__panel { max-height: 90vh; max-height: 90dvh; padding-bottom: env(safe-area-inset-bottom); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .dialog--sheet[open] { animation: sheet-in var(--t-slow) var(--ease); }
  .dialog--sheet.is-closing { animation: sheet-out var(--t-med) var(--ease-io) forwards; }
}

@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }

/* ---------- Settings form controls ---------- */

.group { padding: 16px 0 8px; }
.group + .group { border-top: 1px solid var(--line); }
.group__title { margin-bottom: 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }

.field { margin-bottom: 16px; }
.field__label { display: block; margin-bottom: 8px; font-size: var(--fs-md); font-weight: 600; }
.field__hint { margin-top: 6px; font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-3); }

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--spark-soft); }
.input--area { min-height: 6.5rem; line-height: 1.5; resize: vertical; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px; border-radius: var(--r-lg); background: var(--sunken); }
.seg__opt { position: relative; display: block; }
.seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__opt span {
  display: block;
  padding: 9px 8px;
  border-radius: var(--r-md);
  text-align: center;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.seg__opt input:checked + span { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); font-weight: 600; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; cursor: pointer; }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row .field__label { margin: 0; }
.switch-row .field__hint { margin: 0; }
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  margin: 0;
  border: 1.5px solid var(--field-line);
  border-radius: 99px;
  background: var(--sunken);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform var(--t-med) var(--ease), background-color var(--t-fast) var(--ease);
}
.switch:checked { background: var(--ink); border-color: var(--ink); }
.switch:checked::after { background: var(--on-ink); transform: translateX(20px); }

