/* Neon Pig scheduling. One token set per theme; every screen uses the same radius, type scale and tokens. */
:root {
  --canvas: #141414; --card: #1c1c1c; --hair: #2a2a2a; --cell: #242424;
  --text: #ededed; --body: #d7d7d7; --title: #f5f5f5; --section: #f0f0f0;
  --muted: #8d8d8d; --faint: #6f6f6f;
  --field: #111111; --field-b: #333333;
  --btn: #161616; --btn-b: #3a3a3a; --btn-t: #f2f2f2;
  --pri: #f3f3f3; --pri-t: #111111;
  --danger-b: #6a3030; --danger-t: #f0b4b4;
  --top: #0c0c0c; --side: #101010; --current: #1a1a1a;
  --hover: #222222; --hover-b: #555555;
  --link: #e8e8e8; --link-h: #ffffff;
  --spot: rgba(255, 255, 255, 0.08); --key: #0c0c0c;
  --ok-edge: #3d8f6e; --err-edge: #b0503f;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --canvas: #f1f1ee; --card: #fafaf8; --hair: #dcdcd7; --cell: #e7e7e3;
  --text: #1c1c1c; --body: #2d2d2d; --title: #111111; --section: #161616;
  --muted: #6a6a6a; --faint: #8e8e8e;
  --field: #fdfdfc; --field-b: #c8c8c3;
  --btn: #f5f5f2; --btn-b: #c2c2bd; --btn-t: #161616;
  --pri: #161616; --pri-t: #f5f5f5;
  --danger-b: #d6a0a0; --danger-t: #9a2a2a;
  --top: #e4e4e0; --side: #eaeae6; --current: #dfdfda;
  --hover: #ebebe7; --hover-b: #8f8f8a;
  --link: #1c1c1c; --link-h: #000000;
  --spot: rgba(0, 0, 0, 0.05); --key: #f1f1ee;
  --ok-edge: #2f7d5d; --err-edge: #b0503f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); }
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); }
h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--title); margin: 0; }
h2 { font-size: 14px; font-weight: 500; color: var(--section); margin: 0 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small, label, th, .count { font-size: 12px; font-weight: 500; color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- chrome ---- */
.topbar { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 24px; background: var(--top); border-bottom: 1px solid var(--hair); }
.topbar .org { color: var(--text); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.shell { display: flex; min-height: calc(100vh - 44px); }
.side { width: 190px; flex: none; background: var(--side); border-right: 1px solid var(--hair); padding: 14px 10px; isolation: isolate; }
.side a { position: relative; display: block; padding: 7px 12px; margin-bottom: 2px; border-radius: 8px; color: var(--muted); font-weight: 500; background: var(--side); }
.side a:hover, .side a.current { background: var(--current); color: var(--text); }
.page { flex: 1; min-width: 0; padding: 24px; }
.public .page { min-height: 100vh; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.logo { width: 32px; height: 32px; color: var(--title); margin-bottom: 8px; }
.logo svg { display: block; width: 32px; height: 32px; }
.context { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--card); border-color: var(--hair); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---- surfaces ---- */
.card { position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 12px; padding: 16px 18px 18px; margin-bottom: 14px; }
.toolbar { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar .push { margin-left: auto; }
.toolbar > .field { min-width: 200px; }
.stack > * + * { margin-top: 12px; }
.notice { background: var(--card); border: 1px solid var(--hair); border-left: 3px solid var(--ok-edge); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; color: var(--text); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice.error { border-left-color: var(--err-edge); }
.notice.warn { border-left-color: #ffd400; }
.count { text-align: right; margin: 0 2px 6px; }

/* ---- controls ---- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
input[type=text], input[type=email], input[type=time], input[type=number], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; min-height: 32px; padding: 4px 8px; border-radius: 8px;
  background: var(--field); border: 1px solid var(--field-b); color: var(--text);
  font: inherit; font-size: 13px;
}
textarea { min-height: 72px; resize: vertical; padding: 6px 8px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible { outline: none; border-color: var(--hover-b); }
input[type=checkbox], input[type=radio] { accent-color: var(--muted); margin: 0 6px 0 0; }
.check { display: inline-flex; align-items: center; color: var(--body); font-size: 13px; font-weight: 400; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 6px 12px; border-radius: 8px; background: var(--btn); border: 1px solid var(--btn-b); color: var(--btn-t); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--hover-b); color: var(--btn-t); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: var(--pri-t); }
.btn.primary:hover { opacity: 0.9; color: var(--pri-t); }
.btn.danger { border-color: var(--danger-b); color: var(--danger-t); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--text); }

/* ---- tables ---- */
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 10px 12px; vertical-align: top; border-top: 1px solid var(--cell); color: var(--body); }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: var(--hover); }
td .sub { display: block; color: var(--muted); }
td .sub:empty { display: none; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px 18px; color: var(--muted); }

/* ---- status dots ---- */
.status { display: inline-flex; align-items: center; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex: none; background: #00aeef; }
.dot-green { background: #18de11; } .dot-magenta { background: #ec008c; } .dot-amber { background: #ffd400; } .dot-orange { background: #f74f14; } .dot-blue { background: #00aeef; }

/* ---- avatars ---- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; }
.avatar-initials { align-items: center; justify-content: center; background: var(--field); border: 1px solid var(--field-b); color: var(--text); font-weight: 500; letter-spacing: 0.02em; }
.person { display: flex; align-items: center; gap: 10px; }

/* ---- pointer spotlight ---- */
.spot { --spot-x: 50%; --spot-y: 50%; --spot-o: 0; --spot-size: 280px; position: relative; overflow: hidden; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--spot-o); background: radial-gradient(var(--spot-size) circle at var(--spot-x) var(--spot-y), var(--spot), transparent 58%); }
.spot:hover { --spot-o: 1; border-color: var(--btn-b); }
.spot > * { position: relative; z-index: 1; }

/* ---- CMYK shadow: only on the one thing a screen most needs noticed ---- */
@property --swirl-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes tool-swirl { to { --swirl-angle: 360deg; } }
.swirl-wrap { isolation: isolate; margin-bottom: 22px; }
.swirl { position: relative; margin-bottom: 0; }
.swirl::after { content: ""; position: absolute; z-index: -1; inset: 2px 6px -8px; border-radius: inherit; pointer-events: none; opacity: 0; filter: blur(12px); background: conic-gradient(from var(--swirl-angle), #00aeef, #ec008c, #ffd400, var(--key), #00aeef); }
.swirl:hover::after, .swirl:focus-within::after { opacity: 0.42; }
@media (prefers-reduced-motion: no-preference) {
  .spot::before, .swirl::after { transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1); }
  .swirl:hover::after, .swirl:focus-within::after { animation: tool-swirl 3.2s linear infinite; }
}

/* ---- links screen ---- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.link-card { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.link-card h2 { margin: 0; }
.link-url { font-size: 12px; color: var(--muted); word-break: break-all; }
.qr { width: 132px; height: 132px; padding: 8px; background: #ffffff; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: 100%; }

/* ---- booking screen ---- */
.book-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 14px; align-items: start; }
.book-grid .card { margin: 0; }
.book-grid > *, .picker > * { min-width: 0; }
.host-name { font-size: 14px; font-weight: 500; color: var(--section); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .btn.on, .times .btn.on, .cal button.on { background: var(--pri); border-color: var(--pri); color: var(--pri-t); }
.picker { display: grid; grid-template-columns: minmax(280px, 420px) minmax(180px, 1fr); gap: 24px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { font-size: 14px; font-weight: 500; color: var(--section); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); padding: 4px 0; }
.cal button { height: 38px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--faint); font: inherit; }
.cal button.open { background: var(--btn); border-color: var(--btn-b); color: var(--btn-t); font-weight: 500; cursor: pointer; }
.cal button.open:hover { background: var(--hover); border-color: var(--hover-b); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-height: 330px; overflow-y: auto; align-content: start; }
.summary { font-size: 14px; font-weight: 500; color: var(--section); }
.defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.defs dt { font-size: 12px; font-weight: 500; color: var(--muted); padding-top: 1px; }
.defs dd { margin: 0; color: var(--text); word-break: break-word; }

/* ---- settings ---- */
.hours { display: grid; grid-template-columns: 130px 120px 120px; gap: 8px 10px; align-items: center; }
.avatar-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.choices { display: flex; gap: 14px; flex-wrap: wrap; }
.poll-choice { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side { width: auto; display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--hair); padding: 8px 24px; }
  .side a { margin: 0; white-space: nowrap; }
  .book-grid, .picker { grid-template-columns: 1fr; }
  .topbar .who .name { display: none; }
  .hours { grid-template-columns: 110px 1fr 1fr; }
}
