/* ============================================================
   The Design Minis site's look, for the original tools.

   Loaded LAST, after dialkit-match.css. It changes no markup and no
   behaviour: it restates the tool's colour roles in the site's palette
   (src/app/site.css on designminis.com), takes the site's type (Geist),
   its shapes (square panels joined by 1px hairlines, 10px corners on
   40px controls, 12px on floating menus) and its one primary button,
   the graphite pill. No blur anywhere: the site has no glass.

   Same file in every tool. Remove its <link> to get the old look back.
   ============================================================ */

/* ---- the site's palette, light and dark ---- */
:root {
  --site-bg: oklch(100% 0 0);
  --site-surface: oklch(96.6% 0.0015 250);
  --site-surface-hover: oklch(94.6% 0.002 250);
  --site-raised: oklch(100% 0 0);
  /* What a slider has filled and a pressed button: darker than the surface in light, lighter in dark. */
  --site-active: oklch(90.5% 0.003 250);
  --site-line: oklch(92% 0.003 250);
  --site-text: oklch(24% 0.008 250);
  --site-text-muted: oklch(58% 0.008 250);
  --site-text-faint: oklch(70% 0.008 250);
  --site-shadow-panel: 0 18px 40px -14px oklch(20% 0.02 250 / 0.28), 0 2px 8px oklch(20% 0.02 250 / 0.06);
  --site-shadow-menu: 0 16px 40px -12px oklch(20% 0.02 250 / 0.22), 0 2px 8px oklch(20% 0.02 250 / 0.08);
  --site-font: "Geist", ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  --site-gap: 12px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --site-bg: oklch(15.5% 0.004 250);
  --site-surface: oklch(20.5% 0.005 250);
  --site-surface-hover: oklch(24% 0.006 250);
  --site-raised: oklch(27.5% 0.007 250);
  --site-active: oklch(27.5% 0.007 250);
  --site-line: oklch(27% 0.006 250);
  --site-text: oklch(95% 0.003 250);
  --site-text-muted: oklch(70% 0.006 250);
  --site-text-faint: oklch(54% 0.006 250);
  --site-shadow-panel: 0 18px 40px -14px oklch(0% 0 0 / 0.7), 0 2px 8px oklch(0% 0 0 / 0.4);
  --site-shadow-menu: 0 16px 40px -12px oklch(0% 0 0 / 0.6), 0 2px 8px oklch(0% 0 0 / 0.35);
}

/* ---- the tool's roles, pointed at the site's ----
   [data-theme] so this beats tokens.css's dark block whichever theme is on. */
:root[data-theme] {
  --md-sys-color-surface: var(--site-bg);
  --md-sys-color-surface-bright: var(--site-bg);
  --md-sys-color-surface-dim: var(--site-surface);
  --md-sys-color-on-surface: var(--site-text);
  --md-sys-color-surface-variant: var(--site-surface);
  --md-sys-color-on-surface-variant: var(--site-text-muted);
  --md-sys-color-surface-container-lowest: var(--site-bg);
  --md-sys-color-surface-container-low: var(--site-bg);
  --md-sys-color-surface-container: var(--site-surface);
  --md-sys-color-surface-container-high: var(--site-surface);
  --md-sys-color-surface-container-highest: var(--site-raised);
  --md-sys-color-primary: var(--site-text);
  --md-sys-color-on-primary: var(--site-bg);
  --md-sys-color-primary-container: var(--site-surface);
  --md-sys-color-on-primary-container: var(--site-text);
  --md-sys-color-secondary: var(--site-text-muted);
  --md-sys-color-secondary-container: var(--site-surface);
  --md-sys-color-on-secondary-container: var(--site-text);
  --md-sys-color-tertiary-container: var(--site-surface);
  --md-sys-color-on-tertiary-container: var(--site-text);
  --md-sys-color-outline: var(--site-text-faint);
  --md-sys-color-outline-variant: var(--site-line);
  --md-sys-color-inverse-surface: var(--site-raised);
  --md-sys-color-inverse-on-surface: var(--site-text);
  --md-sys-color-inverse-primary: var(--site-text);
  --app-hairline: inset 0 0 0 1px var(--site-line);
  --app-studio-top: var(--site-surface);
  --app-studio-bottom: var(--site-bg);
  --md-sys-typescale-plain-font: var(--site-font);
  --md-sys-typescale-brand-font: var(--site-font);

  /* dialkit-match's own numbers */
  --dk-radius: 10px;
  --dk-fill: var(--site-surface);
  --dk-fill-hover: var(--site-surface-hover);
  --dk-fill-active: var(--site-active);
  --dk-line: var(--site-line);
  --dk-line-hover: var(--site-text-faint);
  --dk-line-subtle: var(--site-line);
  --dk-ink: var(--site-text);
  --dk-ink-label: var(--site-text-muted);
  --dk-ink-quiet: var(--site-text-faint);
}

/* dialkit's own variables live on .dialkit-root; one class more wins. */
:root[data-theme] .dialkit-root {
  --dial-surface: var(--site-surface);
  --dial-surface-hover: var(--site-surface-hover);
  --dial-surface-active: var(--site-active);
  --dial-surface-subtle: var(--site-surface);
  --dial-border: var(--site-line);
  --dial-border-hover: var(--site-text-faint);
  --dial-text-root: var(--site-text);
  --dial-text-primary: var(--site-text);
  --dial-text-label: var(--site-text-muted);
  --dial-text-secondary: var(--site-text-muted);
  --dial-text-tertiary: var(--site-text-faint);
  --dial-glass-bg: var(--site-bg);
  --dial-dropdown-bg: var(--site-surface);
  --dial-shadow-dropdown: var(--site-shadow-menu);
  --dial-backdrop-blur: 0px;
  --dial-radius: 10px;
}

/* ---- type ---- */
html, body { font-family: var(--site-font); letter-spacing: 0; }
button, input, select, textarea { font-family: inherit; letter-spacing: 0; }

/* ---- the frame: one hairline box, 12px off the window, like the site's main column ---- */
html, body { background: var(--site-bg); }
#app { padding: var(--site-gap); grid-template-rows: 64px minmax(0, 1fr); }
.md-top-app-bar {
  height: 64px; padding: 0 12px 0 12px; gap: 8px;
  background: var(--site-bg);
  border: 1px solid var(--site-line);
  box-shadow: none;
}
.md-top-app-bar .brand {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--site-surface); color: var(--site-text);
}
.md-top-app-bar .brand svg { width: 20px; height: 20px; }
.md-top-app-bar .title { margin-left: 4px; }
.md-top-app-bar .title h1 { font: 500 17px/24px var(--site-font); letter-spacing: -0.01em; }
.md-top-app-bar .title span { font-size: 14px; color: var(--site-text-faint); }

.workspace {
  padding: 0; gap: 0;
  background: var(--site-bg);
  border: 1px solid var(--site-line); border-top: 0;
}
.workspace > * + * { border-left: 1px solid var(--site-line); }
.panel { border-radius: 0; background: var(--site-bg); }
.viewport { border-radius: 0; box-shadow: none; }

/* A panel's head is a strip like the site's: name, then its count after a slash. */
.panel > header {
  min-height: 56px; padding: 0 16px; gap: 0;
  border-bottom: 1px solid var(--site-line);
}
.panel > header h2 { flex: 0 1 auto; font: 500 15px/20px var(--site-font); letter-spacing: -0.005em; }
.panel > header .count {
  padding: 0; border-radius: 0; background: none;
  font: 400 15px/20px var(--site-font); letter-spacing: 0;
  color: var(--site-text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.panel > header .count::before { content: "/" / ""; margin: 0 .3em; }
.panel .scroll { padding: 4px 16px 16px; scrollbar-color: var(--site-line) transparent; }
.panel .scroll::-webkit-scrollbar-thumb { background: var(--site-line); }
.panel > footer { border-top: 1px solid var(--site-line); }

/* Groups are divided by full-width hairlines, the panel's own. */
.group { margin-inline: -16px; padding-inline: 16px; }
.group + .group { border-top-color: var(--site-line); }
.group > .group-head { font: 500 14px/20px var(--site-font); letter-spacing: 0; color: var(--site-text); }
.field-label, .group-title { color: var(--site-text-muted); }
.hint { color: var(--site-text-muted); }

/* ---- buttons ---- */
.md-button, .md-icon-button { border-radius: 10px; }
.md-top-app-bar .md-button { height: 40px; font-size: 14px; }
.md-top-app-bar .md-icon-button { width: 40px; height: 40px; color: var(--site-text-muted); }
.md-top-app-bar .md-icon-button:hover:not(:disabled) { background: var(--site-surface); color: var(--site-text); }

/* Quiet buttons: a surface-grey control, like the site's filters and "More" buttons. */
.md-button--outlined,
.md-button--tonal,
.md-button--text:hover:not(:disabled) {
  background: var(--site-surface); color: var(--site-text); box-shadow: none;
}
.md-button--outlined:hover:not(:disabled),
.md-button--tonal:hover:not(:disabled) { background: var(--site-surface-hover); }

/* The one action a bar or a dialog is for: the site's graphite pill, dark in both themes. */
.md-top-app-bar #btn-export,
.md-button--filled {
  border: 1px solid #000;
  background: linear-gradient(180deg, #1f2023 0%, #28292c 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 1px rgba(255,255,255,.05), 0 1px 1px rgba(0,0,0,.5), 0 3px 8px rgba(0,0,0,.35);
  color: #f4f4f5; text-shadow: 0 -1px 0 rgba(0,0,0,.5);
}
.md-top-app-bar #btn-export:hover:not(:disabled),
.md-button--filled:hover:not(:disabled) { background: linear-gradient(180deg, #27282b 0%, #303135 100%); }
.md-top-app-bar #btn-export:active,
.md-button--filled:active { background: linear-gradient(180deg, #19191c 0%, #222326 100%); box-shadow: 0 1px 1px rgba(0,0,0,.5); }
.md-top-app-bar #btn-export::before,
.md-button--filled::before { display: none; }
.md-top-app-bar #btn-export svg { color: #f4f4f5; }

/* Plinth's export is a split button: both halves are the pill, joined by one faint seam. */
.md-top-app-bar .split-more {
  height: 40px;
  border: 1px solid #000; border-left: 0;
  background: linear-gradient(180deg, #1f2023 0%, #28292c 100%);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.1), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 1px rgba(0,0,0,.5), 0 3px 8px rgba(0,0,0,.35);
  color: #f4f4f5;
}
.md-top-app-bar .split-more:hover:not(:disabled) { background: linear-gradient(180deg, #27282b 0%, #303135 100%); }
.md-top-app-bar .split > #btn-export { border-right: 0; }

/* Material's tinted state layer gives way to the site's plain colour steps. */
.md-button::before, .md-icon-button::before { display: none; }

.md-icon-button--tonal { background: var(--site-active); color: var(--site-text); }

/* ---- over the canvas: solid, hairlined, no glass ---- */
.viewport-dock {
  padding: 4px; gap: 2px; border-radius: 12px;
  background: var(--site-surface);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--site-line), var(--site-shadow-menu);
}
.viewport-dock .md-icon-button { width: 36px; height: 36px; border-radius: 8px; color: var(--site-text-muted); }
.viewport-dock .md-icon-button:hover:not(:disabled) { background: var(--site-surface-hover); color: var(--site-text); }
.viewport-dock .md-icon-button--tonal,
.viewport-dock .md-icon-button[aria-pressed="true"] { background: var(--site-active); color: var(--site-text); }
.viewport-dock .sep { height: 20px; margin: 0 4px; background: var(--site-line); }

.viewport-hint {
  height: 36px; border-radius: 10px;
  background: var(--site-surface); color: var(--site-text-muted);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--site-line);
  font: 500 12px/16px var(--site-font); letter-spacing: 0;
}
.viewport-hint:hover { background: var(--site-surface-hover); color: var(--site-text); }

.viewport-credit {
  border-radius: calc(5px * var(--credit-scale));
  background: var(--site-surface);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--site-line);
}
.viewport-credit:hover { background: var(--site-surface-hover); }
.viewport-credit .credit-label { fill: var(--site-text-muted); }
.viewport-credit .credit-name,
.viewport-credit .credit-mark { fill: var(--site-text); }

.drop-overlay {
  border-radius: 0; inset: 0;
  border: 1px dashed var(--site-text-faint);
  background: color-mix(in srgb, var(--site-bg) 82%, transparent);
  color: var(--site-text);
  backdrop-filter: none;
}

/* ---- dialogs: the site's pop-up, square with a title strip ---- */
.md-dialog {
  border-radius: 0; padding: 0;
  border: 1px solid var(--site-line);
  background: var(--site-bg); color: var(--site-text);
  box-shadow: var(--site-shadow-panel);
}
.md-dialog::backdrop { background: oklch(0% 0 0 / 0.55); }
.md-dialog .content { padding: 0 24px 24px; }
.md-dialog h2 {
  display: flex; align-items: center; min-height: 58px;
  margin: 0 -24px 20px; padding: 0 24px;
  border-bottom: 1px solid var(--site-line);
  font: 500 17px/24px var(--site-font); letter-spacing: -0.01em;
}
.md-dialog .actions { padding: 12px 24px; border-top: 1px solid var(--site-line); gap: 8px; }
.md-dialog .actions .md-button { height: 40px; padding: 0 16px; font-size: 14px; }
.md-dialog .actions .md-button--text { background: var(--site-surface); color: var(--site-text); }
.md-dialog .actions .md-button--text:hover:not(:disabled) { background: var(--site-surface-hover); }

.md-snackbar {
  border-radius: 10px;
  background: var(--site-surface); color: var(--site-text);
  box-shadow: inset 0 0 0 1px var(--site-line), var(--site-shadow-menu);
}
.md-snackbar button { color: var(--site-text); }

kbd {
  border-radius: 6px; border-bottom: 0;
  background: var(--site-surface); color: var(--site-text);
  font: 500 12px/16px var(--site-font);
}

/* ---- stacked on a phone: hairlines go across instead ---- */
@media (max-width: 960px) {
  .workspace > * + * { border-left: 0; border-top: 1px solid var(--site-line); }
}
