/* Blickfunk tool style, matching blickfunk.com: near-black surfaces,
   13 px Inter, semibold titles, violet accent, pill buttons,
   small caps labels, feedback in place. */

:root {
  color-scheme: dark;
  --bg: var(--bf-bg);
  --panel: var(--bf-panel);
  --fg: var(--bf-text);
  --muted: rgb(255 255 255 / 0.6);
  --faint: rgb(255 255 255 / 0.5);
  --line: rgb(255 255 255 / 0.12);
  --line-strong: rgb(255 255 255 / 0.3);
  --field: rgb(255 255 255 / 0.04);
  --brand: var(--bf-violet);
  --accent: var(--bf-violet-light);
  --error: #f09880;
  --radius: 6px;
  font: 13px/1.45 var(--bf-sans);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }

h1, h2, h3, p { margin: 0; }
.title {
  font-weight: 600;
  font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance;
}
.label { font-size: 11px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.status { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--error); }
.empty { color: var(--faint); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; margin-top: 16px; }

/* App bar: the same in every tool. */
.app-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(8 9 10 / 0.9);
  backdrop-filter: blur(8px);
}
.app-bar .logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.app-bar .logo img { display: block; width: 24px; height: 24px; }
.app-bar .slash { opacity: 0.3; }
.app-bar .app { color: var(--muted); text-decoration: none; }
.app-bar .app:hover { color: var(--fg); }
.app-bar .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-bar #who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons: primary white pill (one per view), secondary outline, destructive coral text. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer;
  height: 30px; padding: 0 14px; border-radius: 999px;
  background: var(--fg); color: #000; border: 0;
}
.button:hover { opacity: 0.85; }
.button.secondary { background: none; color: var(--fg); border: 1px solid var(--line-strong); }
.button.secondary:hover { opacity: 1; border-color: var(--fg); }
.button.ghost { background: none; color: var(--muted); font-weight: 400; padding: 0 6px; }
.button.ghost:hover { opacity: 1; color: var(--fg); }
.button.danger { background: none; color: var(--error); font-weight: 400; padding: 0; height: auto; }
.button.danger:hover { text-decoration: underline; opacity: 1; }
.button.large { height: 40px; padding: 0 22px; font-size: 14px; }
.button:disabled { opacity: 0.35; pointer-events: none; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
input {
  font: inherit; color: inherit; width: 100%; height: 32px; padding: 0 10px;
  background: var(--field); border: 1px solid rgb(255 255 255 / 0.15); border-radius: var(--radius);
}
input:focus { outline: none; border-color: rgb(255 255 255 / 0.6); }
.form { display: flex; flex-direction: column; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

pre {
  margin: 8px 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all;
}

/* Layout: content in the middle, side panel on the right. */
.narrow { max-width: 640px; margin: 0 auto; padding: 64px 20px; display: flex; flex-direction: column; gap: 12px; }
.narrow .gap { margin-top: 16px; }
/* Styleguide (tools): navigation in a side panel flush left, content in the middle. */
.page { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.main { padding: 32px 36px 64px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.side {
  border-right: 1px solid var(--line); background: var(--panel); padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 32px;
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; padding: 6px 8px; border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.side-nav a:hover { background: rgb(255 255 255 / 0.05); color: var(--fg); }
.side-nav a[aria-current="page"] { background: rgb(255 255 255 / 0.1); color: var(--fg); }
.side section { display: flex; flex-direction: column; gap: 10px; }
.side .sub { margin-top: 16px; }
.block { margin-top: 48px; display: flex; flex-direction: column; gap: 10px; }

/* Computers, by group */
.group { margin-top: 28px; }
.group-head {
  display: flex; align-items: baseline; gap: 10px; padding: 0 8px 8px; width: 100%;
  background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.group-head:hover .label { color: var(--fg); }
.chevron { width: 8px; height: 8px; border-right: 1.2px solid var(--muted); border-bottom: 1.2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; flex: none; }
.chevron.folded { transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .chevron { transition: none; } }
.star { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; background: none; border: none; color: var(--faint); fill: none; cursor: pointer; flex: none; }
.star:hover { color: var(--fg); }
.star.on { color: var(--fg); fill: var(--fg); }
.star svg { fill: inherit; }
.list { border-top: 1px solid var(--line); }
.device {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--line);
}
.device:hover { background: rgb(255 255 255 / 0.03); }
.device .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.device .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.device .warning { width: 14px; height: 14px; flex: none; color: var(--error); }
.device .meta { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .confirm { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.button.connect { height: 28px; padding: 0 14px; }
.device .info input { height: 28px; }
select {
  font: inherit; color: inherit; height: 28px; padding: 0 8px; max-width: 160px;
  background: var(--field); border: 1px solid rgb(255 255 255 / 0.15); border-radius: var(--radius);
}
select:focus { outline: none; border-color: rgb(255 255 255 / 0.6); }
select option { background: var(--panel); }

/* Groups panel */
.groups .g { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.groups .g .g-top { display: flex; align-items: center; gap: 8px; }
.groups .g .g-profile { display: flex; align-items: center; gap: 4px; }
.groups .g:first-child { border-top: 1px solid var(--line); }
.groups .g .gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groups .g input { height: 28px; }
.inline-form { display: flex; gap: 8px; }
.profiles .profile { border-bottom: 1px solid var(--line); padding: 0; }
.profiles .profile:first-child { border-top: 1px solid var(--line); }
.profiles { margin-top: 20px; }
.profiles .profile-head { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: auto; cursor: pointer; }
.profiles .profile-head .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: 700; }
.profiles .profile-body { display: flex; flex-direction: column; gap: 2px; padding: 0 0 10px; }
.profiles .profile-body > .gname { font-size: 12px; color: var(--faint); padding-left: 14px; width: fit-content; }
.profiles .profile-body .wallpaper { padding: 4px 0 4px 14px; }
.profiles .profile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 0 14px; }
.profile-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.profile-actions .inline-form { margin: 0; }
.device .meta.kiosk-line { display: flex; align-items: center; gap: 4px; }
.autostart { display: flex; flex-direction: column; padding: 2px 0 4px; }
.autostart .switch-row { align-items: center; cursor: default; }
.autostart input[type=url], .autostart input[type=text] { height: 26px; width: auto; flex: 1; min-width: 160px; max-width: 360px; font-size: 12px; }
.autostart input[type=number] { height: 26px; width: 64px; font-size: 12px; }
.autostart input[type=time] { height: 26px; width: auto; font-size: 12px; }
.schedule-row { flex-wrap: wrap; gap: 6px 8px; }
.schedule .days { display: inline-flex; gap: 2px; }
.schedule .day { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.schedule .day input { width: auto; height: auto; margin: 0; accent-color: var(--accent); }
/* Save bar under the kiosk settings: explicit saving, with the reach. */
.kiosk-save { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; }
.kiosk-save:empty { display: none; }
.kiosk-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kiosk .kiosk-confirm input[type=password] { height: 36px; width: 240px; max-width: 100%; flex: none; font-size: 13px; padding: 0 12px; }
.kiosk-confirm .note { flex-basis: 100%; color: var(--faint); font-size: 12px; }
/* The kiosk password: a normal-sized field, like the page's other forms. */
.kiosk-password { gap: 8px; padding: 8px 0 4px; flex-wrap: wrap; }
.kiosk .kiosk-password input[type=password] { height: 36px; width: 280px; max-width: 100%; flex: none; font-size: 13px; padding: 0 12px; }
.groups .g .inline-select { max-width: 180px; color: var(--fg); }
details summary { cursor: pointer; list-style: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "– "; }
details[open] > :not(summary) { margin-top: 10px; }
.side strong { color: var(--fg); font-weight: 700; }
.tabs { display: flex; gap: 20px; margin-bottom: 20px; }
.tabs a {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
  text-decoration: none; padding-bottom: 4px; border-bottom: 1px solid transparent;
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); }
.dot.on { background: var(--fg); border-color: var(--fg); }

/* Activity and tokens */
.log .entry {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.log .when, .tokens .meta { color: var(--accent); }
.downloads .meta { color: var(--faint); font-variant-numeric: tabular-nums; }
.tokens .token { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }

/* Downloads */
.downloads { display: flex; flex-direction: column; }
.downloads .file {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.downloads .file:first-child { border-top: 1px solid var(--line); }
.downloads .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.downloads .platform { font-weight: 700; }
.downloads .copied { color: var(--fg); }
.device .update { color: var(--accent); }
.inline-select {
  background: none; border: none; color: var(--fg); font: inherit; font-size: 12px; padding: 0 2px; cursor: pointer;
  text-decoration: underline dotted rgb(255 255 255 / 0.4); text-underline-offset: 3px;
}
.device .meta.wallpaper { display: flex; align-items: center; gap: 6px; }
.wallpaper .thumb { height: 22px; width: auto; max-width: 40px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line); }
.icon-button.screens { position: relative; border-color: transparent; color: var(--faint); }
.icon-button.screens:hover, .icon-button.screens:focus-within { color: var(--fg); border-color: var(--line-strong); }
.icon-button.screens.set { color: var(--accent); }
.icon-button.awake { border-color: transparent; color: var(--faint); }
.icon-button.awake:hover, .icon-button.awake:focus-visible { color: var(--fg); border-color: var(--line-strong); }
.icon-button.awake.set { color: var(--accent); }
.icon-button.screens select { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; padding: 0; opacity: 0; cursor: pointer; font-size: 13px; }
.wallpaper .icon-button.quiet { border-color: transparent; color: var(--faint); }
.icon-button.quiet:hover, .icon-button.quiet:focus-visible { color: var(--fg); border-color: var(--line-strong); outline: none; }
.icon-button.bin { width: 20px; height: 20px; }
.button.link, button.link {
  background: none; border: none; padding: 0; font: inherit; color: var(--fg); cursor: pointer;
  text-decoration: underline dotted rgb(255 255 255 / 0.4); text-underline-offset: 3px;
}
/* Loading placeholders: roughly the size of what replaces them. */
.skeleton { display: block; height: 11px; border-radius: 4px; background: rgb(255 255 255 / 0.07); }
.skeleton.inline { display: inline-block; vertical-align: middle; }
.skeleton.title { height: 22px; width: 180px; margin-bottom: 6px; }
.skeleton.short { width: 28%; height: 9px; }
.skeleton-group { margin-top: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.skeleton-row { pointer-events: none; min-height: 114px; }
.skeleton.w30 { width: 30%; } .skeleton.w40 { width: 40%; } .skeleton.w50 { width: 50%; }
.skeleton.w60 { width: 60%; } .skeleton.w70 { width: 70%; } .skeleton.w80 { width: 80%; }
.skeleton.w-summary { width: 96px; } .skeleton.w-heading { width: 140px; }
.skeleton-row .info { gap: 8px; }
.skeleton-side { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
#summary { min-height: 1.4em; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: skeleton-pulse 1.4s ease-in-out infinite; }
  @keyframes skeleton-pulse { 50% { opacity: 0.45; } }
}
.kiosk summary { cursor: pointer; width: fit-content; }
.kiosk summary:hover { color: var(--fg); }
.kiosk[open] { padding-bottom: 6px; }
.kiosk .switch-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; padding: 3px 0 3px 14px; cursor: pointer; }
.kiosk .switch-row input { width: auto; height: auto; padding: 0; margin: 0; accent-color: var(--accent); transform: translateY(1px); }
.kiosk .note { color: var(--faint); }
.icon-button.bin { border: none; color: var(--faint); width: 24px; height: 24px; }
.icon-button.bin:hover, .icon-button.bin:focus-visible { color: var(--error); outline: none; }
.editable { cursor: text; }
.editable:hover, .editable:focus-visible { text-decoration: underline dotted rgb(255 255 255 / 0.4); text-underline-offset: 3px; outline: none; }
.rename { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
/* The name being renamed keeps its own type; a quiet underline and caret show it's editable. */
.editing {
  outline: none; white-space: nowrap; overflow: hidden; text-overflow: clip; caret-color: var(--accent);
  border-bottom: 1px solid var(--accent); padding-bottom: 1px; min-width: 2ch;
}
.editing::selection, .editing *::selection { background: rgb(77 163 255 / 0.35); }
.icon-button {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: none; color: var(--fg); cursor: pointer;
}
.icon-button:hover { background: var(--fg); color: #000; }
.device[draggable="true"] { cursor: grab; }
.peek-view { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px 20px; }
.peek-view:not(:has(img)) { flex-direction: row; align-items: center; gap: 12px; }
.peek-view img { display: block; width: 100%; max-width: 720px; border-radius: var(--radius); border: 1px solid var(--line); }
.peek-bar { display: flex; align-items: center; gap: 12px; }
.peek-note:empty { display: none; }
.icon-button.peek.on { color: var(--accent); }
.device.dragging { opacity: 0.4; }
.group.drop-target { outline: 1px dashed var(--accent); outline-offset: 6px; border-radius: var(--radius); }
.device .connected { color: var(--accent); }
.file-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  background: none; color: var(--muted); border: 1px solid var(--line-strong);
}
.icon-button:hover { color: var(--fg); border-color: var(--fg); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
  .button, .device, .app-bar .app { transition: opacity 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out; }
}

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); position: static; height: auto; }
  .main { padding: 24px 20px 40px; }
  .device { grid-template-columns: 10px minmax(0, 1fr); }
  .device .confirm { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .app-bar #who { display: none; }
}


/* Groups live in the computer list: heading with its tools, and in-place
   confirmations (with the number of computers) for anything that goes out. */
.group-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.group-actions .inline-form { margin: 0; }
.group-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.group-bar .group-head { flex: 1; min-width: 0; }
.group-tools { display: flex; align-items: center; gap: 6px; }
.group-tools .inline-select { max-width: 180px; color: var(--fg); }
.confirm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.confirm-row .button { height: 28px; padding: 0 14px; }

/* Uptime */
.uptime-slack { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.uptime-now { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.uptime-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.uptime-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.uptime-name { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.uptime-numbers { display: flex; gap: 14px; justify-content: flex-end; }
.uptime-row .strip, .uptime-row .uptime-own, .uptime-row .hours-editor { grid-column: 1 / -1; }
.strip { display: flex; height: 14px; gap: 0; }
.strip span { flex: 1; min-width: 1px; }
.strip span.day { margin-left: 2px; }
.strip .s-u { background: #2f8f5b; }
.strip .s-d { background: var(--error); }
.strip .s-a { background: #d39a2c; }
.strip .s-o { background: rgb(255 255 255 / 0.06); }
.strip .s-x { background: transparent; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08); }
.hours-editor { padding: 6px 0; }
.hours-editor input[type=time] { height: 26px; width: auto; font-size: 12px; }
