/* ==========================================================================
   Unicode Formatter - app styles

   Design goal: the main workspace should feel like one small tool, not a
   control panel. Power features live behind a single disclosure ("More
   tools"), so the default screen asks for exactly one decision - the pill.
   ========================================================================== */

:root {
  --uf-accent: #4f46e5;
  --uf-accent-soft: #eef2ff;
  --uf-accent-border: #c7d2fe;
  --uf-ok: #059669;
  --uf-warn: #b45309;
  --uf-warn-soft: #fef3c7;
  --uf-err: #dc2626;
  --uf-err-soft: #fee2e2;
  --uf-panel: #ffffff;
  --uf-panel-alt: #f8fafc;
  --uf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --uf-ring: 0 0 0 3px rgba(79, 70, 229, .28);
}

[data-theme="dark"] {
  --bg-canvas: #0b1120;
  --surface-card: #111827;
  --surface-muted: #1b2436;
  --border-subtle: #26324a;
  --text-primary: #f1f5f9;
  --text-secondary: #b6c2d6;
  --text-muted: #7c8aa3;
  --uf-accent: #a5b4fc;
  --uf-accent-soft: #1e2447;
  --uf-accent-border: #3b4478;
  --uf-ok: #34d399;
  --uf-warn: #fbbf24;
  --uf-warn-soft: #3a2f10;
  --uf-err: #f87171;
  --uf-err-soft: #3d1d1d;
  --uf-panel: #111827;
  --uf-panel-alt: #0e1526;
  --uf-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --uf-ring: 0 0 0 3px rgba(165, 180, 252, .3);
  color-scheme: dark;
}

body {
  background-image:
    radial-gradient(1000px 520px at 88% -10%, rgba(79, 70, 229, .10), transparent 62%),
    radial-gradient(760px 420px at 4% 2%, rgba(2, 132, 199, .09), transparent 58%);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  /* Horizontal gutter only. The header's top offset is owned by
     --aczh-header-pad-top in /responsive.css -- never pad the top of this box. */
  padding-inline: clamp(1rem, 3.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ------------------------------------------------------------------ head */
.page-head { margin-bottom: clamp(.8rem, 1.8vw, 1.2rem); }
.page-head h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text-primary);
  line-height: 1.15;
}
.lede {
  margin-top: .35rem;
  max-width: 68ch;
  font-size: clamp(.875rem, 1.3vw, .97rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ------------------------------------------------------------- workspace */
.workspace {
  background: var(--uf-panel);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(14px, 2vw, 20px);
  box-shadow: var(--uf-shadow);
  overflow: hidden;
}

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > .pane { padding: clamp(.8rem, 1.6vw, 1.1rem); min-width: 0; }
.split > .pane + .pane { border-left: 1px solid var(--border-subtle); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split > .pane + .pane { border-left: 0; border-top: 1px solid var(--border-subtle); }
}

.pane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 26px;
  margin-bottom: .55rem;
}
.pane-name {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
}
.pane-actions { display: flex; gap: .3rem; }
.mini {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  padding: .2rem .45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.mini:hover { color: var(--uf-accent); background: var(--uf-accent-soft); }

/* --------------------------------------------------------------- toolbar */
.toolbar {
  padding: .6rem clamp(.8rem, 1.6vw, 1.1rem);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--uf-panel-alt);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .5rem;
}
.tb-group {
  display: flex;
  gap: .15rem;
  align-items: center;
  padding-right: .5rem;
  border-right: 1px solid var(--border-subtle);
}
.tb-grow { border-right: 0; padding-right: 0; margin-left: auto; }

.tb {
  min-width: 32px;
  height: 32px;
  padding: 0 .5rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}
.tb:hover { background: var(--surface-muted); color: var(--text-primary); }
.tb.on { background: var(--uf-accent-soft); border-color: var(--uf-accent-border); color: var(--uf-accent); }

.tb-swatch {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 32px;
  padding: 0 .4rem;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}
.tb-swatch:hover { background: var(--surface-muted); }
.tb-swatch select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  max-width: 96px;
  /* Native selects size to their text and land around 19px tall, which is a
     poor target inside a 32px control. */
  height: 28px;
}

/* font strip: each button previews the style it applies */
.font-strip {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .45rem;
  padding-top: .5rem;
  border-top: 1px dashed var(--border-subtle);
}
.strip-label {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.strip-scroll {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
  flex: 1;
}
.strip-btn {
  flex-shrink: 0;
  min-width: 44px;
  height: 34px;
  padding: 0 .55rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-primary);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  transition: all .14s;
  overflow: hidden;
}
.strip-btn:hover {
  border-color: var(--uf-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.strip-btn.on { border-color: var(--uf-accent); background: var(--uf-accent-soft); }
.strip-more {
  flex-shrink: 0;
  height: 34px;
  padding: 0 .6rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
}
.strip-more:hover { border-color: var(--uf-accent); color: var(--uf-accent); }

/* ---------------------------------------------------------------- editor */
.editor {
  min-height: 290px;
  max-height: 56vh;
  overflow-y: auto;
  padding: .75rem .85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: .94rem;
}
.editor:focus { border-color: var(--uf-accent-border); }
.editor > *:first-child { margin-top: 0; }
.editor p { margin: 0 0 .7em; }
.editor h1 { font-size: 1.45rem; font-weight: 800; margin: 1em 0 .45em; line-height: 1.2; }
.editor h2 { font-size: 1.22rem; font-weight: 700; margin: 1em 0 .45em; }
.editor h3 { font-size: 1.06rem; font-weight: 700; margin: .9em 0 .4em; }
.editor ul, .editor ol { margin: 0 0 .7em; padding-left: 1.5rem; }
.editor li { margin-bottom: .25em; }
.editor blockquote {
  margin: .7em 0;
  padding: .35rem .85rem;
  border-left: 3px solid var(--uf-accent-border);
  color: var(--text-secondary);
}
.editor code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-muted);
  padding: .1em .35em;
  border-radius: 5px;
}
.editor pre {
  font-family: var(--font-mono);
  font-size: .85rem;
  background: var(--surface-muted);
  padding: .7rem .85rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: .7em 0;
}
.editor pre code { background: none; padding: 0; }
.editor a { color: var(--uf-accent); }
[data-uf-hl="yellow"] { background: #fef08a; border-radius: 3px; }
[data-uf-hl="green"]  { background: #bbf7d0; border-radius: 3px; }
[data-uf-hl="blue"]   { background: #bfdbfe; border-radius: 3px; }
[data-uf-hl="purple"] { background: #e9d5ff; border-radius: 3px; }
[data-uf-hl="red"]    { background: #fecaca; border-radius: 3px; }
[data-uf-hl="orange"] { background: #fed7aa; border-radius: 3px; }
[data-uf-hl="black"]  { background: #334155; color: #fff; border-radius: 3px; }
[data-uf-hl="white"]  { background: #f8fafc; box-shadow: inset 0 0 0 1px #cbd5e1; border-radius: 3px; }

.tip { margin-top: .5rem; font-size: .78rem; color: var(--text-muted); }

/* ----------------------------------------------------------------- pills */
.pills { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .6rem; }
.pill {
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .72rem;
  /* Without this the pills land near 26px tall, which reads as cramped even
     where the shared coarse-pointer rule does not apply. */
  min-height: 30px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all .15s;
}
.pill:hover { color: var(--text-primary); border-color: #cbd5e1; }
.pill.on { background: var(--uf-accent); border-color: var(--uf-accent); color: #fff; }
[data-theme="dark"] .pill.on { color: #0b1120; }

.counter {
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.counter.warn { color: var(--uf-warn); }
.counter.err { color: var(--uf-err); }

/* ---------------------------------------------------------------- output */
.output {
  font-family: var(--font-mono);
  font-size: .87rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: .8rem .9rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  min-height: 290px;
  max-height: 56vh;
  overflow-y: auto;
  color: var(--text-primary);
  margin: 0;
}
.output:empty::after { content: "Your formatted text appears here."; color: var(--text-muted); }
.output-inline { min-height: 0; }
.output-banner { font-size: .95rem; }

.actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  padding: .48rem .85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all .16s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--uf-accent-border); color: var(--uf-accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--uf-accent);
  border-color: var(--uf-accent);
  color: #fff;
  padding-inline: 1.1rem;
}
[data-theme="dark"] .btn-primary { color: #0b1120; }
.btn-primary:hover { color: inherit; filter: brightness(1.07); }
.limit-wrap { margin-left: auto; }
.limit-select {
  font: inherit;
  font-size: .74rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: .25rem .45rem;
  cursor: pointer;
  max-width: 190px;
}
.limit-select:hover { border-color: var(--border-subtle); color: var(--text-primary); }

.issues { list-style: none; margin: .55rem 0 0; padding: 0; display: grid; gap: .3rem; }
.issues:empty { display: none; }
.issues li {
  font-size: .78rem;
  padding: .4rem .6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.issues li.warn { background: var(--uf-warn-soft); border-color: color-mix(in srgb, var(--uf-warn) 35%, transparent); color: var(--uf-warn); }
.issues li.error { background: var(--uf-err-soft); border-color: color-mix(in srgb, var(--uf-err) 35%, transparent); color: var(--uf-err); }
.issues li.info { background: var(--uf-accent-soft); border-color: var(--uf-accent-border); color: var(--uf-accent); }

/* ---------------------------------------------------------------- drawer */
.drawer { border-top: 1px solid var(--border-subtle); background: var(--uf-panel-alt); }
.drawer > summary {
  cursor: pointer;
  padding: .6rem clamp(.8rem, 1.6vw, 1.1rem);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::before { content: "\25B8"; font-size: .8rem; transition: transform .18s; }
.drawer[open] > summary::before { transform: rotate(90deg); }
.drawer > summary:hover { color: var(--uf-accent); }
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .55rem .8rem;
  padding: .2rem clamp(.8rem, 1.6vw, 1.1rem) .9rem;
}
.opt { display: flex; flex-direction: column; gap: .22rem; }
.opt-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: .6rem; }
.opt > span { font-size: .73rem; color: var(--text-muted); font-weight: 600; }
.opt input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--uf-accent); flex-shrink: 0; }

/* ----------------------------------------------------------------- tools */
.tools-wrap { margin-top: clamp(.7rem, 1.6vw, 1rem); }
.tools-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem clamp(.8rem, 1.6vw, 1.1rem);
  border: 1px solid var(--border-subtle);
  background: var(--uf-panel);
  color: var(--text-secondary);
  border-radius: 9999px;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--uf-shadow);
  transition: all .18s cubic-bezier(.16, 1, .3, 1);
}
.tools-toggle:hover { color: var(--uf-accent); border-color: var(--uf-accent-border); }
.tools-caret { display: inline-block; transition: transform .18s; font-size: .75rem; }
.tools-toggle[aria-expanded="true"] .tools-caret { transform: rotate(90deg); }
.tools-hint {
  font-weight: 500;
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 620px) { .tools-hint { display: none; } }

.tools-body {
  margin-top: .55rem;
  background: var(--uf-panel);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(12px, 1.8vw, 18px);
  box-shadow: var(--uf-shadow);
  padding: clamp(.75rem, 1.6vw, 1.1rem);
}
.tools-body[hidden] { display: none; }

.tool-nav {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .55rem;
  margin-bottom: .8rem;
  border-bottom: 1px solid var(--border-subtle);
}
.tool-nav::-webkit-scrollbar { display: none; }
.tool-tab {
  flex-shrink: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .34rem .8rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all .15s;
}
.tool-tab:hover { background: var(--surface-muted); color: var(--text-primary); }
.tool-tab.active { background: var(--uf-accent-soft); border-color: var(--uf-accent-border); color: var(--uf-accent); }

.tool-panel[hidden] { display: none; }
.tool-blurb { font-size: .84rem; color: var(--text-secondary); margin-bottom: .7rem; line-height: 1.55; }
.tool-title { font-size: .95rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
.tool-title:first-child { margin-top: 0; }
.tool-out { display: flex; gap: .6rem; align-items: flex-start; margin-top: .7rem; }
.tool-out .output { flex: 1; }
.tool-out-btns { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

.input {
  font: inherit;
  font-size: .88rem;
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: .5rem .65rem;
  width: 100%;
  min-width: 0;
}
.input:focus-visible, .tb:focus-visible, .pill:focus-visible,
.strip-btn:focus-visible, .btn:focus-visible, .tool-tab:focus-visible,
.editor:focus-visible, .icon-btn:focus-visible, .mini:focus-visible,
.limit-select:focus-visible, .tools-toggle:focus-visible, .strip-more:focus-visible {
  outline: none;
  box-shadow: var(--uf-ring);
  border-color: var(--uf-accent);
}
.input-sm { font-size: .8rem; padding: .34rem .5rem; }
.textarea { min-height: 130px; resize: vertical; font-family: var(--font-mono); line-height: 1.6; }
.textarea-lg { min-height: 190px; font-family: var(--font-mono); line-height: 1.6; margin-top: .6rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  border-radius: 9999px;
  cursor: pointer;
  transition: all .16s;
  flex-shrink: 0;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--uf-accent); border-color: var(--uf-accent-border); transform: translateY(-1px); }

/* --------------------------------------------------------------- studio */
.fancy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: .45rem;
  margin: .75rem 0 0;
}
.fancy-item {
  text-align: left;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  border-radius: 11px;
  padding: .5rem .65rem;
  cursor: pointer;
  font: inherit;
  transition: all .16s;
  min-width: 0;
}
.fancy-item:hover { border-color: var(--uf-accent); transform: translateY(-1px); }
.fancy-item.active { border-color: var(--uf-accent); background: var(--uf-accent-soft); }
.fancy-name { display: block; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .1rem; }
.fancy-sample { display: block; font-size: 1.05rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem;
}
.divider-item {
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  border-radius: 11px;
  padding: .55rem .65rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: all .16s;
  min-width: 0;
}
.divider-item:hover { border-color: var(--uf-accent); transform: translateY(-1px); }
.divider-item .dlabel { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .15rem; }
.divider-item .dtext { display: block; font-family: var(--font-mono); font-size: .76rem; color: var(--text-primary); white-space: pre; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- guide */
.table-wrap { overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 620px; }
.guide-table th, .guide-table td {
  border: 1px solid var(--border-subtle);
  padding: .4rem .55rem;
  text-align: left;
  vertical-align: top;
}
.guide-table th { background: var(--surface-muted); font-weight: 700; color: var(--text-secondary); }
.guide-table td.note { color: var(--text-secondary); }
.yes { color: var(--uf-ok); font-weight: 700; }
.no { color: var(--text-muted); }

.prose { font-size: .87rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: .8rem; max-width: 78ch; }
.prose code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-muted); padding: .1em .35em; border-radius: 5px; color: var(--text-primary); }

.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .45rem; }
.shortcuts > div {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: .42rem .55rem;
  background: var(--surface-muted);
}
.shortcuts span { margin-left: .4rem; }
kbd {
  font-family: var(--font-mono);
  font-size: .72rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .1rem .35rem;
  color: var(--text-primary);
}

.preview-box { margin-top: .8rem; }
.preview-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.preview {
  padding: .7rem .8rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-primary);
  overflow-x: auto;
}
.preview h1 { font-size: 1.3rem; font-weight: 800; }
.preview h2 { font-size: 1.15rem; font-weight: 700; }
.preview blockquote { margin: .6em 0; padding-left: .8rem; border-left: 3px solid var(--uf-accent-border); color: var(--text-secondary); }
.preview ul, .preview ol { padding-left: 1.4rem; }
.preview table { border-collapse: collapse; margin: .6em 0; }
.preview td, .preview th { border: 1px solid var(--border-subtle); padding: .3rem .55rem; }

.seg { display: inline-flex; background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: 9999px; padding: .2rem; }
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  padding: .28rem .8rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all .16s;
}
.seg-btn.active { background: var(--surface-card); color: var(--uf-accent); box-shadow: var(--uf-shadow); }

/* ----------------------------------------------------------------- misc */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--uf-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.15rem;
  width: min(560px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.modal-head h2 { font-size: 1.02rem; font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translate(-50%, 1.4rem);
  background: var(--text-primary);
  color: var(--bg-canvas);
  padding: .6rem 1.1rem;
  border-radius: 9999px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .22s cubic-bezier(.16, 1, .3, 1);
  z-index: 70;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
