/* tuvl components (skill: tuvl-design). Needs tokens.css. Taken from the cloud.tuvl.io console; the last sections (upload, machines, settings) are optional. */
* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .25s ease, color .25s ease; }
h1 { font-size: 22px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.03em; padding: 2px 8px; }
.brand img { width: 28px; height: 30px; object-fit: contain; }
.brand span { line-height: 1.15; } .brand .sub { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: grid; gap: 4px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 48px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.page { padding: 4px 28px 56px; max-width: 1180px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.top .theme { min-width: 36px; justify-content: center; }
.crumbs { font-size: 12px; margin-bottom: 4px; }
.ico { flex: none; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.stack { display: grid; gap: 16px; } .stack-s { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .gap-s { gap: 6px; }
.grid { display: grid; gap: 16px; } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tile { padding: 14px 16px; }
.tile .num { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.tile .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; } tr.link:hover td { background: var(--soft); }
td.num, th.num { text-align: right; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 10px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.btn:hover { background: var(--soft); border-color: var(--ink-2); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; width: 100%; }
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: grid; gap: 4px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--idle-bg); color: var(--idle); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.pulse::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .chip.pulse::before { animation: none; } }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.tag { border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); background: var(--soft); }

/* messages */
.callout { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); background: var(--soft); }
.callout.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.callout.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.callout.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty b { color: var(--ink); font-size: 15px; }
.findings { display: grid; gap: 6px; padding: 14px 18px; }
.finding { display: grid; grid-template-columns: max-content max-content 1fr; gap: 10px; align-items: baseline; }
pre.log { margin: 0; padding: 12px 14px; background: var(--soft); border-radius: 8px; overflow: auto; max-height: 280px; font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sheen 1.3s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 360px; z-index: 5; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-radius: 6px 6px 0 0; transition: color .15s ease, background .15s ease; }
.tabs button:hover { color: var(--ink); background: var(--soft); }
.tabs button[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); background: transparent; }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; display: grid; gap: 14px; border-radius: 14px; }
.auth-footer { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; letter-spacing: .02em; padding-top: 14px; border-top: 1px solid var(--line); }
.auth-footer a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* movable & resizable side panels with macOS controls */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 100vw); background: var(--panel); z-index: 41; box-shadow: var(--shadow); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.drawer-tools { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--soft); cursor: grab; user-select: none; flex-shrink: 0; direction: ltr; }
.drawer-tools .grip { flex: 1; color: var(--muted); font-size: 11px; letter-spacing: 3px; text-align: center; opacity: .75; }
.mac-controls { display: inline-flex; align-items: center; gap: 7px; user-select: none; flex-shrink: 0; }
.mac-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.16); padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: transform 0.1s ease, filter 0.1s ease; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); background: #ccc; }
.mac-dot:hover { filter: brightness(0.9); }
.mac-dot:active { transform: scale(0.92); filter: brightness(0.8); }
.mac-dot.close { background: #ff5f56; border-color: #e0443e; }
.mac-dot.min { background: #ffbd2e; border-color: #dea123; }
.mac-dot.max { background: #27c93f; border-color: #1aab29; }
.mac-glyph { width: 8px; height: 8px; opacity: 0; transition: opacity 0.15s ease; color: rgba(0, 0, 0, 0.72); }
.mac-controls:hover .mac-glyph { opacity: 1; }
.drawer-edge { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; cursor: col-resize; z-index: 3; }
.drawer-edge:hover { background: var(--accent-soft); }
.drawer.floating { right: auto; bottom: auto; border: 1px solid var(--line-strong); border-radius: 12px; resize: both; overflow: hidden; min-width: 380px; min-height: 260px; box-shadow: var(--shadow); }
.drawer.floating .drawer-edge { display: none; }
.drawer.maximized { left: 12px !important; top: 12px !important; right: auto !important; bottom: auto !important; width: calc(100vw - 24px) !important; height: calc(100vh - 24px) !important; border-radius: 12px !important; border: 1px solid var(--line-strong) !important; resize: none !important; }
.drawer.maximized .drawer-edge { display: none !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; } .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-2 { grid-template-columns: 1fr; }
  .page, .top { padding-left: 16px; padding-right: 16px; }
}

/* upload */
.drop { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
details > summary { cursor: pointer; }
details[open] > summary { margin-bottom: 10px; }
select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; width: 100%; }
select[disabled] { opacity: .7; }

/* machines */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cmd { background: var(--soft); padding: 6px 10px; border-radius: 8px; overflow-x: auto; white-space: nowrap; max-width: 100%; }
.findings.flush { padding: 0; }
.findings.flush .finding { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.card-head p { margin: 2px 0 0; }

/* settings */
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
td .stack-s { min-width: 180px; }
.row.end { align-items: flex-end; }
.grow { flex: 1 1 280px; min-width: 0; }
.mt { margin-top: 16px; }
