/* Service screens: assistants, settings, audit log. */

.panel-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.app-ic, .audit-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.how { display: grid; gap: 12px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.how-title { font-weight: 600; }

.key-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.key-out { display: grid; gap: 12px; padding: 18px; border-radius: var(--r); background: var(--accent-soft); }
.key-out > .row .ic { color: var(--accent-text); }
.key-out .copybox { background: var(--surface); }
.key-step { display: grid; gap: 8px; }

/* settings */
.tz-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.tz { flex: 1 1 320px; min-width: 0; }
.tz-save .btn { min-height: 44px; }
.tz-now { flex-basis: 100%; order: 3; margin-top: -2px; }
.tz-now::first-letter { text-transform: uppercase; }

.theme-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.theme-tile {
  appearance: none; display: grid; gap: 4px; justify-items: start; align-content: start; padding: 10px 10px 14px; text-align: left; cursor: pointer;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 90ms ease-out;
}
.theme-tile > :not(.theme-swatch) { padding-inline: 4px; }
@media (hover: hover) { .theme-tile:hover { border-color: color-mix(in srgb, var(--accent-text) 60%, transparent); } }
.theme-tile:active { transform: scale(0.99); }
.theme-tile:focus-visible { border-radius: var(--r); }
.theme-tile[aria-checked="true"] { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.theme-name { font-weight: 600; margin-top: 8px; }
/* Theme previews draw each theme in the chosen colours; settings.js puts them in --sw-* on the swatch. */
.theme-swatch {
  display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 4px; width: 100%; height: 64px; padding: 6px; border-radius: 10px;
  background: var(--sw-bg); box-shadow: inset 0 0 0 1px var(--sw-line);
}
.theme-swatch i { border-radius: 5px; }
.theme-swatch i:nth-child(1) { grid-row: span 2; background: var(--sw-side); box-shadow: inset 0 0 0 1px var(--sw-line); }
.theme-swatch i:nth-child(2) { background: var(--sw-surface); box-shadow: inset 0 0 0 1px var(--sw-line); }
.theme-swatch i:nth-child(3) { background: var(--sw-accent); width: 60%; }
.theme-swatch.auto { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 4px; padding: 0; background: none; box-shadow: none; }
.theme-swatch.auto > .theme-swatch { height: 64px; grid-template-columns: 1fr 1.4fr; }
.theme-swatch.auto > .theme-swatch i:nth-child(3) { width: 80%; }

/* appearance */
.look { gap: 22px; }
.look-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.look-saved:empty { display: none; }
.palette-wrap { position: relative; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (min-width: 1100px) { :root:not([data-size="120"]):not([data-size="135"]) .palette-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.palette-tile, .font-tile, .size-btn, .look-toggle { -webkit-tap-highlight-color: transparent; }
.palette-tile {
  appearance: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  min-height: 52px; padding: 8px 12px 8px 8px; text-align: left; cursor: pointer; font-size: 0.875rem; font-weight: 550;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 90ms ease-out;
}
.palette-tile > .look-chip { grid-row: span 2; }
.palette-tile > .xs { grid-column: 2; font-weight: 400; }
.look-chip {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--chip) 0 50%, var(--chip-2) 50% 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.look-chip.rainbow { background: conic-gradient(from 200deg, #B0281F, #B39256, #2E7D54, #1E6F8C, #3B4FA0, #7B3F7A, #B0281F); }
.look-color-input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

.font-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 10px; }
@media (min-width: 1100px) { :root:not([data-size="120"]):not([data-size="135"]) .font-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }
.font-tile {
  appearance: none; display: grid; gap: 2px; justify-items: start; align-content: start; padding: 12px 14px 14px; text-align: left; cursor: pointer;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 90ms ease-out;
}
.font-tile .theme-name { margin-top: 4px; }
.font-sample { font-size: 1.5rem; line-height: 1.2; color: var(--text); }
.ff-onest { font-family: "Onest", ui-sans-serif, system-ui, sans-serif; }
.ff-golos { font-family: "Golos Text", ui-sans-serif, system-ui, sans-serif; }
.ff-manrope { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; }
.ff-inter { font-family: "Inter", ui-sans-serif, system-ui, sans-serif; }
.ff-system { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.fh-prata { font-family: "Prata", Georgia, serif; }
.fh-lora { font-family: "Lora", Georgia, serif; font-weight: 500; }
.fh-same { font-family: var(--font); font-weight: 650; letter-spacing: -0.02em; }

.size-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.size-row { display: inline-flex; align-items: flex-end; gap: 4px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.size-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: calc(var(--r-sm) - 3px); color: var(--text-2); line-height: 1; font-weight: 600;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
/* fixed pixel sizes on purpose: the letters show the choice, they should not grow with it */
.size-btn.s90 { font-size: 13px; } .size-btn.s100 { font-size: 16px; } .size-btn.s110 { font-size: 19px; } .size-btn.s120 { font-size: 22px; } .size-btn.s135 { font-size: 26px; }
@media (hover: hover) { .size-btn:hover { color: var(--text); } }
.size-btn[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.look-toggles { display: grid; gap: 0; border-top: 1px solid var(--line); }
.look-toggle { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.look-toggle:last-child { border-bottom: 0; padding-bottom: 0; }
.look-toggle .grow { display: grid; gap: 2px; }
.look-toggle-title { font-weight: 550; }

@media (hover: hover) { .palette-tile:hover, .font-tile:hover { border-color: color-mix(in srgb, var(--accent-text) 60%, transparent); } }
.palette-tile:active, .font-tile:active { transform: scale(0.99); }
.palette-tile[aria-checked="true"], .font-tile[aria-checked="true"] { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }

.facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: 0.8125rem; color: var(--text-2); }
.facts dd { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }

/* audit */
.page > .audit-day { gap: 10px; }
.audit-day-title { font-size: 0.9375rem; color: var(--text); }
.page:has(.audit-day) { gap: 28px; }
.audit .item { padding: 11px 16px; gap: 12px; }
.audit .item-title { overflow-wrap: anywhere; }
.audit .item.failed .audit-ic { background: var(--danger-soft); color: var(--danger); }
.audit .item.failed .item-title { color: var(--danger); }
.audit-time { flex: none; white-space: nowrap; align-self: flex-start; padding-top: 2px; }

@media (max-width: 640px) {
  .look .panel-head { flex-wrap: wrap; }
  .look-actions { width: 100%; justify-content: space-between; order: 3; }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .size-btn { width: 40px; }
  .tz-save, .tz-save .btn { width: 100%; }
  .tz-save { order: 4; }
  .tz-now { margin-top: -4px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .audit .item { padding: 11px 14px; }
}
