/* Tortuga interface. Colors come from theme.css (variables), so themes change instantly. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.ico { display: inline-flex; vertical-align: middle; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.accent { color: var(--accent); }
.good { color: var(--good); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- frame, header, nav ---------- */
.frame { max-width: 1280px; margin: 0 auto; padding: 14px 16px 60px; }
.app-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 8px 14px; background: var(--win); border: 1px solid var(--border); border-radius: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; color: var(--accent); }
.logo:hover { text-decoration: none; }
.logo img { height: 34px; max-width: 180px; object-fit: contain; display: block; }
.wordmark { font-family: 'Pirata One', 'Palatino Linotype', Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1; letter-spacing: 0.02em; color: var(--accent); }
.logo { gap: 10px; }
.brand-icon { width: 38px; height: 38px; border-radius: 50%; display: block; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.cog { display: inline-flex; padding: 7px; border-radius: 10px; color: var(--muted); border: 1px solid transparent; }
.cog:hover, .cog:focus-visible { color: var(--text); border-color: var(--border); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 13px; border-radius: 9px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { background: var(--win); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
.nav .admin-link { margin-left: auto; border: 1px solid var(--border); }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
.greeting { font-size: 30px; font-weight: 300; margin: 6px 0 18px; }
.greeting .who { font-weight: 600; color: var(--accent); }

/* ---------- windows ---------- */
.win { background: var(--win); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.win.plain { background: transparent; border: 0; padding: 0; }
.win.admin-only { border-style: dashed; }
.win-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: -2px 0 10px; min-height: 22px; }
.win-name { font-weight: 500; }
.win-title.bare { margin: -4px 0 6px; min-height: 22px; }
.collapse-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px -6px -4px 0; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.collapse-btn:hover { color: var(--text); border-color: var(--border); }
.win.collapsed > .win-body { display: none; }
.win.collapsed > .win-title { margin-bottom: 0; }
.win-inset { background: var(--win2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; background: var(--win2); border: 1px solid var(--border); color: var(--muted); line-height: 1.6; }
.pill.jellyfin { color: var(--accent); }
.pill.navidrome { color: var(--good); }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.stale { color: var(--warn); border-color: var(--warn); }
.note { color: var(--muted); font-size: 13px; padding: 4px 0; }
.note.warn { color: var(--warn); }
.note.good { color: var(--good); }
.stack { display: grid; gap: 12px; }
.stack-col { display: grid; gap: 16px; align-content: start; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; width: 100%; }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.home-grid > * { grid-column: span 12; }
.home-grid > .span-upcoming, .home-grid > .span-library { grid-column: span 12; }
@media (min-width: 900px) { .home-grid > .span-upcoming, .home-grid > .span-library { grid-column: span 6; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--win2); border: 1px solid transparent; border-radius: 10px; color: var(--text); position: relative; min-width: 0; }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile-icon { width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tile-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.tile-icon.edit { background: none; border: 1px dashed var(--border); border-radius: 9px; padding: 2px; cursor: pointer; }
.letter { width: 100%; height: 100%; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--border); color: var(--text); font-weight: 600; }
.tile-text { display: grid; min-width: 0; }
.tile-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dot.up { background: var(--good); }
.dot.down { background: var(--bad); }
.np { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.np + .np { border-top: 1px solid var(--border); }
.poster { width: 40px; height: 58px; border-radius: 6px; object-fit: cover; background: var(--border); flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.poster.missing { visibility: hidden; }
.np-main { flex: 1; min-width: 0; }
.np-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.np-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; }
.row + .row { border-top: 1px solid var(--border); }
.tag { display: inline-block; font-size: 11px; padding: 0 8px; border-radius: 6px; background: var(--win2); border: 1px solid var(--border); color: var(--muted); margin-top: 2px; }
.tag.movie { color: var(--good); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--win2); border-radius: 10px; padding: 10px 12px; }
.big { font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.15; }
.speeds { display: flex; gap: 28px; align-items: baseline; flex-wrap: wrap; }
.speeds .big { margin: 0 4px 0 6px; }
.spark { margin: 8px 0 4px; height: 56px; }
.spark svg { width: 100%; height: 100%; display: block; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dl { padding: 7px 0; }
.dl + .dl { border-top: 1px solid var(--border); }
.dl-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head { margin-bottom: 4px; }

/* ---------- forms, buttons ---------- */
.field { display: grid; gap: 4px; }
.field-label { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.field .field-label { margin: 0; }
.hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=url], input[type=search], select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--win2); color: var(--text); font: inherit; min-height: 38px;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
select { width: auto; max-width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; min-height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--win2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.link { background: none; border: 0; color: var(--muted); }
.btn.wide { width: 100%; }
.btn:disabled, .icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border); }
.icon-btn.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.switch-track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--good); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--bg); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { padding: 6px 14px; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; min-height: 34px; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.check.off { opacity: 0.55; cursor: default; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.danger-zone { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; color: var(--text); display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 12px; background: var(--win2); }
.swatch.theme-swatch { background: var(--bg); box-shadow: inset 0 0 0 5px var(--win); }
.swatch.on { border-color: var(--text); outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch:disabled { opacity: 0.3; cursor: not-allowed; }
.swatch.wheel-btn { background: conic-gradient(#ff5a5a, #ffd24a, #4be08a, #3ac7ff, #8b6bff, #ff5ad0, #ff5a5a); color: #fff; }
.wheel-btn svg { filter: drop-shadow(0 0 2px #000); }
.picker-host { margin-top: 6px; }
.picker { background: var(--win2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 10px; width: 100%; max-width: 260px; }
.picker-title { font-weight: 600; }
.wheel-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto; touch-action: none; }
.wheel { width: 168px; height: 168px; border-radius: 50%; cursor: crosshair; display: block; }
.wheel-marker { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.picker-row { display: flex; align-items: center; gap: 10px; }
.picker-row input[type=range] { flex: 1; accent-color: var(--accent); }
.hex { max-width: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.preview { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.view-tab { margin-bottom: 8px; }
.view-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 4px 14px; min-height: 36px; }
.view-row.head { padding-left: 0; font-weight: 600; border-bottom: 1px solid var(--border); }

/* ---------- admin ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-layout { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .admin-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.admin-menu { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.admin-menu a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; }
.admin-menu a.on { background: var(--win); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
.admin-menu a:hover { text-decoration: none; color: var(--text); }
@media (min-width: 900px) { .admin-menu { flex-direction: column; overflow: visible; } }
.admin-content { display: grid; gap: 16px; min-width: 0; }
.gate { max-width: 420px; margin: 40px auto; display: grid; gap: 12px; text-align: center; justify-items: stretch; }
.gate .field, .gate .stack { text-align: left; }
.gate-icon { color: var(--warn); }
.user-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 2px 0; text-align: left; flex-wrap: wrap; }
.user-name { font-weight: 600; }
.user-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.perms { display: grid; gap: 8px; }
.perm-sections { padding-left: 24px; }
.layout-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.layout-row.head { border-bottom: 1px solid var(--border); }
.layout-row.legend { color: var(--muted); font-size: 11px; padding: 6px 0 0; }
.layout-row.legend span:not(.grow) { width: 38px; text-align: center; }
.layout-row.legend .spacer { width: 66px; }
.app-row { display: flex; align-items: center; gap: 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.logo-preview { background: repeating-conic-gradient(var(--win2) 0 25%, var(--border) 0 50%) 0 0 / 16px 16px; border-radius: 10px; padding: 16px; display: flex; justify-content: center; }
.logo-preview img { max-height: 70px; max-width: 100%; }
.qr { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; }
.secret, .codes code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--win2); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ---------- sign-in, maintenance ---------- */
.center { min-height: 90vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--win); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 380px; display: grid; gap: 14px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.login-logo .logo img { height: 48px; }
.login-logo .wordmark { font-size: 30px; }
.maint { text-align: center; display: grid; gap: 12px; justify-items: center; max-width: 440px; }
.code404 { font-size: 96px; font-weight: 800; color: var(--accent); line-height: 1; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--win); border: 1px solid var(--border); border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; display: grid; gap: 12px; }
.modal h2 { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.popmenu { position: fixed; z-index: 60; background: var(--win); border: 1px solid var(--border); border-radius: 10px; padding: 4px; display: grid; min-width: 200px; }
.popmenu button { background: none; border: 0; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 7px; font: inherit; cursor: pointer; }
.popmenu button:hover { background: var(--win2); }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; width: min(92vw, 420px); }
.toast { background: var(--win); border: 1px solid var(--border); border-left: 4px solid var(--good); padding: 10px 14px; border-radius: 10px; }
.toast.bad { border-left-color: var(--bad); }

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .frame { padding: 10px 12px 50px; }
  .greeting { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { flex-direction: column; text-align: center; padding: 14px 8px; gap: 8px; }
  .tile-icon { width: 52px; height: 52px; }
  .tile-text { justify-items: center; width: 100%; }
  .tile-desc { display: none; }
  .two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .big { font-size: 22px; }
  .layout-row { flex-wrap: wrap; }
  .codes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ======================= later tabs ======================= */
@font-face { font-family: 'Pirata One'; font-weight: 400; font-display: swap; src: url('/fonts/pirata-one-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 400; font-display: swap; src: url('/fonts/caveat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 700; font-display: swap; src: url('/fonts/caveat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Patrick Hand'; font-display: swap; src: url('/fonts/patrick-hand-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Shadows Into Light'; font-display: swap; src: url('/fonts/shadows-into-light-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Indie Flower'; font-display: swap; src: url('/fonts/indie-flower-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Permanent Marker'; font-display: swap; src: url('/fonts/permanent-marker-latin-400-normal.woff2') format('woff2'); }

:root { --mv-bg: #2e2257; --mv-fg: #b9a6ff; --tv-bg: #16422c; --tv-fg: #7fe3b9; --mu-bg: #12365a; --mu-fg: #8ec1ff; --gm-bg: #5a1d1d; --gm-fg: #ff9d9d; }
[data-mode="light"] { --mv-bg: #e8e0ff; --mv-fg: #4b2fb5; --tv-bg: #d6f3e4; --tv-fg: #0e6b43; --mu-bg: #dbeafe; --mu-fg: #1d4ed8; --gm-bg: #fde0e0; --gm-fg: #b42323; }

.tab-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.tab-grid > * { grid-column: span 12; }
@media (min-width: 900px) {
  .tab-grid > .s-movies, .tab-grid > .s-tv, .tab-grid > .s-music, .tab-grid > .s-books { grid-column: span 6; }
  .tab-grid.infra > .s-security, .tab-grid.infra > .s-host { grid-column: span 6; }
  .tab-grid.play > .s-library { grid-column: span 8; }
  .tab-grid.play > .s-scoreboard { grid-column: span 4; }
}
@media (min-width: 1100px) {
  .tab-grid.news > .s-reddit, .tab-grid.news > .s-blogs, .tab-grid.news > .s-prices { grid-column: span 4; }
  .tab-grid.gaming > .s-headlines { grid-column: span 7; }
  .tab-grid.gaming.no-epic > .s-headlines { grid-column: span 12; }
  .tab-grid.gaming > .s-epic { grid-column: span 5; }
  .tab-grid.gaming > .s-wishlist, .tab-grid.gaming > .s-romm, .tab-grid.gaming > .s-switch { grid-column: span 4; }
}
.nowrap { white-space: nowrap; }
.spaced { margin-top: 12px; }
.center-row { display: flex; justify-content: center; margin-top: 12px; }
.coming { font-size: 22px; color: var(--muted); text-align: center; padding: 28px 0; }
.toggle-label { display: inline-flex; align-items: center; gap: 8px; }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.row-title { overflow: hidden; text-overflow: ellipsis; color: var(--text); }
a.row-title:hover { color: var(--accent); }
.row .row-title { min-width: 0; flex: 1; }
.src { min-width: 74px; }

/* covers */
.covers { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 10px; }
.covers.scroll { display: flex; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.covers.scroll .cover-cell { flex: 0 0 130px; }
.cover-cell { display: grid; gap: 3px; color: var(--text); min-width: 0; align-content: start; }
.cover-cell:hover { text-decoration: none; }
a.cover-cell:hover .cover { outline: 2px solid var(--accent); }
.cover { display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--win2); position: relative; }
.cover.sq { aspect-ratio: 1; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .letter { border-radius: 0; font-size: 28px; }
.cover-title { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.covers.games { --cols: 5; }
.covers.small-row { --cols: 6; margin-bottom: 12px; }
@media (max-width: 640px) { .covers { grid-template-columns: repeat(3, minmax(0, 1fr)); } .covers.games, .covers.small-row { --cols: 3; } .covers.small-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* news */
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.ev { display: inline-block; max-width: 100%; padding: 1px 7px; border-radius: 5px; font-size: 11px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.movie { background: var(--mv-bg); color: var(--mv-fg); }
.ev.show { background: var(--tv-bg); color: var(--tv-fg); }
.ev.music { background: var(--mu-bg); color: var(--mu-fg); }
.ev.game { background: var(--gm-bg); color: var(--gm-fg); }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-title { min-width: 150px; text-align: center; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; color: var(--muted); font-size: 11px; margin-bottom: 4px; text-align: center; }
.cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-cell { min-height: 92px; background: var(--win2); border-radius: 6px; padding: 3px 4px; display: grid; align-content: start; gap: 2px; min-width: 0; }
.cal-cell.blank { background: transparent; }
.cal-cell.today { outline: 1px solid var(--accent); }
.cal-day { font-size: 11px; color: var(--muted); }
.cal-cell .more { background: none; border: 0; color: var(--muted); font-size: 11px; text-align: left; cursor: pointer; padding: 0; }
.cal-list { display: none; }
.cal-li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.cal-li:first-child { border-top: 0; }
.cal-li > div > div { margin-bottom: 4px; }
.cal-ld { color: var(--muted); font-size: 12px; }
.cal-tbd { margin-top: 10px; }
.tbd { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
@media (max-width: 640px) { .cal-grid { display: none; } .cal-list { display: block; } }
.videos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .videos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.video { display: grid; gap: 3px; color: var(--text); align-content: start; }
.video:hover { text-decoration: none; }
.thumb { display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--win2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-title { font-size: 12px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub-group { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { padding: 3px 10px; border-radius: 999px; background: var(--win2); border: 1px solid var(--border); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.prices { display: grid; grid-template-columns: 1fr; gap: 8px; }
.price-card { display: grid; gap: 2px; background: var(--win2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; color: var(--text); }
.price-card:hover { border-color: var(--accent); text-decoration: none; }
.p-title { font-size: 13px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-row { display: flex; align-items: center; gap: 10px; }
.p-price { font-size: 18px; font-weight: 700; color: var(--accent); }
.spark-s { margin-left: auto; display: inline-flex; }
.bad { color: var(--bad); }
.tiny { font-size: 11px; }

/* gaming and play */
.trow { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.trow + .trow { border-top: 1px solid var(--border); }
.mini { width: 44px; height: 60px; object-fit: cover; border-radius: 5px; background: var(--border); flex: none; }
.mini.ph { display: inline-block; }
.row.server { gap: 10px; justify-content: flex-start; }
.play-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.play-tools .chips { margin: 0; flex: 1; }
.search-box { display: inline-flex; align-items: center; gap: 6px; background: var(--win2); border: 1px solid var(--border); border-radius: 9px; padding: 0 8px; color: var(--muted); }
.search-box input { border: 0; background: none; min-height: 32px; width: 160px; padding: 0 2px; }
.search-box input:focus { box-shadow: none; }
.cover-cell.game .cover-sub a { color: var(--accent); }

/* weather */
.wx-now { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.wx-icon { color: var(--warn); }
.wx-temp { font-size: 38px; font-weight: 600; line-height: 1.1; }
.stats6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stats4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.mid { font-size: 18px; font-weight: 600; }
@media (max-width: 800px) { .stats6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.forecast { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; text-align: center; }
.fday { background: var(--win2); border-radius: 10px; padding: 8px 4px; display: grid; gap: 2px; justify-items: center; }
.fhi { font-weight: 700; font-size: 16px; }
@media (max-width: 800px) { .forecast { grid-template-columns: 1fr; } .fday { grid-template-columns: 70px 28px 1fr auto auto; align-items: center; justify-items: start; padding: 6px 10px; } }
.radar { width: 100%; height: 480px; border: 0; border-radius: 10px; background: var(--win2); }
@media (max-width: 640px) { .radar { height: 360px; } }

/* infrastructure and smart home */
.worldmap { width: 100%; height: auto; display: block; margin: 8px 0; background: var(--win2); border-radius: 10px; }
.land { fill: var(--border); stroke: var(--bg); stroke-width: 0.4; }
.login-dot { fill: var(--warn); stroke: var(--bg); stroke-width: 1.5; }
.country-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.device { background: var(--win2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 4px; justify-items: start; }
.device.on { border-color: var(--good); }
.dev-icon { color: var(--muted); }
.device.on .dev-icon { color: var(--warn); }
.dev-name { font-weight: 600; }

/* corkboard */
.board-tools { margin-bottom: 10px; align-items: center; }
.board-scroll { overflow-x: auto; padding-bottom: 6px; }
.pn.pinned { cursor: default; }
.pn.settle { transition: left .25s ease, top .25s ease; }
.pn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pn-surface { position: absolute; inset: 15% 8% 19% 8%; overflow: hidden; }
.pn-text { line-height: 1.12; white-space: pre-wrap; overflow-wrap: anywhere; }
.pn-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pn-foot { position: absolute; left: 8%; right: 8%; bottom: 4%; display: flex; justify-content: space-between; gap: 6px; color: #4a4636; font-family: system-ui, sans-serif; }
.pn-author { font-weight: 600; }
.pn-acts { position: absolute; top: 2%; right: 2%; display: none; gap: 2px; z-index: 4; }
.pn:hover .pn-acts, .pn:focus-within .pn-acts { display: flex; }
.pn-acts .icon-btn { color: #3a3524; background: rgba(255, 255, 255, .55); width: 24px; height: 24px; }
.c-yellow { --n1: #ffe34d; --n2: #fff3a0; } .c-blue { --n1: #62c0f0; --n2: #a9dcff; } .c-green { --n1: #7bdc6a; --n2: #b6f0a0; } .c-pink { --n1: #f77eb4; --n2: #fbb0d2; }
.c-purple { --n1: #c768ee; --n2: #e0a6fb; } .c-orange { --n1: #ffab40; --n2: #ffd08a; } .c-teal { --n1: #2ee6c8; --n2: #a6f5e8; } .c-lavender { --n1: #b7a6f2; --n2: #dcd2fb; }
.f-caveat { font-family: 'Caveat', 'Segoe Print', cursive; } .f-patrick { font-family: 'Patrick Hand', 'Segoe Print', cursive; } .f-shadows { font-family: 'Shadows Into Light', 'Segoe Print', cursive; }
.f-indie { font-family: 'Indie Flower', 'Segoe Print', cursive; } .f-marker { font-family: 'Permanent Marker', 'Segoe Print', cursive; }
.modal.wide { max-width: 640px; }
.editor { display: grid; gap: 14px; grid-template-columns: 220px 1fr; align-items: start; }
@media (max-width: 640px) { .editor { grid-template-columns: 1fr; } }
.editor textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--win2); color: var(--text); font: inherit; resize: vertical; }
.pn.preview { position: relative; width: 190px; height: 190px; margin: 6px auto; cursor: default; transform: rotate(-2deg); }
.draw-overlay { position: absolute; inset: 15% 8% 19% 8%; touch-action: none; cursor: crosshair; z-index: 5; outline: 1px dashed rgba(0, 0, 0, .35); }
.swatch.note-sw { background: linear-gradient(180deg, var(--n1), var(--n2)); border-radius: 8px; width: 30px; height: 30px; }
.swatch.pen { width: 22px; height: 22px; }
.fmt { min-width: 34px; min-height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--win2); color: var(--text); font: inherit; cursor: pointer; }
.fmt.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* connection key icons */
.keyico { display: inline-flex; color: var(--muted); }
.keyico.ok { color: var(--good); }
.keyico.bad { color: var(--bad); }


/* ======================= round two: tabs, colors, cards, corkboard ======================= */
/* reddit tabs */
.tabstrip { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -2px 0 8px; overflow-x: auto; scrollbar-width: none; }
.tabstrip::-webkit-scrollbar { display: none; }
.tab-btn { background: var(--win2); border: 1px solid var(--border); border-bottom: 0; border-radius: 9px 9px 0 0; padding: 5px 13px; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.on { background: var(--win); color: var(--accent); border-bottom: 1px solid var(--win); font-weight: 600; }

/* gaming news site names */
.src { min-width: 96px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.src.c0 { color: #a78bfa; } .src.c1 { color: #4a9eff; } .src.c2 { color: #34d399; } .src.c3 { color: #fb923c; }
.src.c4 { color: #f472b6; } .src.c5 { color: #2dd4bf; } .src.c6 { color: #fbbf24; } .src.c7 { color: #f87171; }
[data-mode="light"] .src.c0 { color: #6d3fd1; } [data-mode="light"] .src.c1 { color: #1d4ed8; } [data-mode="light"] .src.c2 { color: #047857; } [data-mode="light"] .src.c3 { color: #c2410c; }
[data-mode="light"] .src.c4 { color: #be185d; } [data-mode="light"] .src.c5 { color: #0f766e; } [data-mode="light"] .src.c6 { color: #a16207; } [data-mode="light"] .src.c7 { color: #b91c1c; }

/* big covers that grow with the screen (Epic free games) */
.covers.fluid { grid-template-columns: repeat(auto-fit, minmax(var(--min, 200px), 1fr)); gap: 16px; }
.covers.fluid .cover { aspect-ratio: 3 / 4; }
.covers.fluid .cover-title { font-size: 14px; font-weight: 600; white-space: normal; }
.covers.fluid .cover-sub { font-size: 12px; white-space: normal; }
@media (max-width: 640px) { .covers.fluid { grid-template-columns: repeat(auto-fit, minmax(var(--min, 200px), 1fr)); } }

/* container cards */
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ccard { background: var(--win2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; display: grid; gap: 7px; align-content: start; }
.ccard.down { opacity: .7; }
.ccard-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.ccard-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar-top { display: flex; justify-content: space-between; margin-bottom: 2px; }
.bar > i.hot { background: var(--bad); }

/* sliders on the Media admin page */
.slider-row { display: grid; grid-template-columns: 90px 1fr 36px; align-items: center; gap: 12px; }
.slider-row input { width: 100%; accent-color: var(--accent); }
.slider-value { text-align: right; }

/* ---------- corkboard: a wooden frame around real-looking cork ---------- */
.cork-frame {
  display: inline-block; padding: 16px; border-radius: 10px; position: relative;
  background:
    repeating-linear-gradient(94deg, rgba(0, 0, 0, .09) 0 2px, rgba(0, 0, 0, 0) 2px 9px),
    repeating-linear-gradient(87deg, rgba(255, 255, 255, .05) 0 1px, rgba(255, 255, 255, 0) 1px 13px),
    linear-gradient(135deg, #a1713f, #7d5029 45%, #94622f);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(0, 0, 0, .35), inset 3px 0 0 rgba(255, 255, 255, .08);
}
.cork {
  position: relative; border-radius: 4px; box-sizing: content-box; touch-action: pan-x pan-y;
  background-color: #bd8d5e;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='b' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.03' numOctaves='3' seed='8'/><feColorMatrix type='matrix' values='0 0 0 0 .62 0 0 0 0 .42 0 0 0 0 .22 0 0 0 .95 -.3'/></filter><filter id='a' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='3'/><feColorMatrix type='matrix' values='0 0 0 0 .30 0 0 0 0 .17 0 0 0 0 .07 0 0 0 1.5 -.45'/></filter><filter id='c' x='0' y='0' width='100%' height='100%'><feTurbulence type='turbulence' baseFrequency='.5' numOctaves='2' seed='5'/><feColorMatrix type='matrix' values='0 0 0 0 .96 0 0 0 0 .80 0 0 0 0 .58 0 0 0 2.4 -1.25'/></filter><rect width='100%' height='100%' fill='%23bd8d5e'/><rect width='100%' height='100%' filter='url(%23b)'/><rect width='100%' height='100%' filter='url(%23a)'/><rect width='100%' height='100%' filter='url(%23c)' opacity='.85'/></svg>");
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, .6), inset 0 0 50px rgba(60, 30, 5, .45), inset 0 -2px 4px rgba(255, 255, 255, .12);
}

/* ---------- post-it notes: soft paper, one clean shadow ---------- */
.pn {
  position: absolute; color: #2b2b2b; border-radius: 2px;
  background: linear-gradient(174deg, var(--n2) 0%, var(--n1) 100%);
  box-shadow: 1px 2px 2px rgba(0, 0, 0, .16), 3px 7px 9px rgba(0, 0, 0, .26);
  user-select: none; -webkit-user-select: none; cursor: grab; transform-origin: 50% 8%;
}
.pn::before { /* the sticky strip at the top and a hint of shading toward the bottom */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 12%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .08) 100%);
}
.pn.pinned { cursor: default; }
.pn.lift { cursor: grabbing; box-shadow: 2px 4px 3px rgba(0, 0, 0, .18), 6px 14px 18px rgba(0, 0, 0, .34); }
.pn.preview { box-shadow: 1px 2px 2px rgba(0, 0, 0, .16), 3px 7px 9px rgba(0, 0, 0, .22); }
.tack { position: absolute; top: -6px; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .4) 40%, rgba(180, 205, 230, .45) 74%); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 0 2px rgba(0, 0, 0, .3); }
.tack::after { content: ""; position: absolute; left: 5px; top: 11px; width: 13px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .3); filter: blur(2px); z-index: -1; }
.tack.red { background: radial-gradient(circle at 34% 30%, #ffb0b0, #dc2f2f 52%, #8a1010); border-color: #7a0f0f; }


/* ======================= round three: match the reference photos ======================= */
/* gaming news: site on the left, title with the time underneath */
.newsrow { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; align-items: start; }
.newsrow + .newsrow { border-top: 1px solid var(--border); }
.newsrow .src { min-width: 0; padding-top: 2px; }
.newstitle { color: var(--text); text-decoration: none; line-height: 1.35; }
.newstitle:hover { color: var(--accent); }
.showmore { width: 100%; margin-top: 8px; }
@media (max-width: 640px) { .newsrow { grid-template-columns: 84px 1fr; gap: 10px; } }

/* reddit: flat underlined tabs, posts with a small picture */
.tabstrip { gap: 2px; margin: -2px 0 4px; border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 7px 14px; margin-bottom: -1px; font-size: 13px; }
.tab-btn.on { background: none; color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 500; }
.rrow { display: grid; grid-template-columns: 1fr 84px; gap: 14px; align-items: center; padding: 11px 0; }
.rrow + .rrow { border-top: 1px solid var(--border); }
.rmain { min-width: 0; display: grid; gap: 3px; }
.rmain .row-title { white-space: normal; line-height: 1.35; }
.rthumb { width: 84px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--win2); }
.rthumb.ph { display: grid; place-items: center; color: var(--muted); }

/* container cards, like the nodes and hosts cards */
.ccards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ccard { gap: 6px; padding: 12px 14px; }
.ccard-name { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-sub { font-size: 12px; }
.ccard-sub.up { color: var(--good); }
.ccard-sub.down { color: var(--muted); }
.crow { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 8px; font-size: 12px; }
.crow .bar { height: 4px; }
.crow .bar > i { background: var(--good); }
.crow .bar > i.hot { background: var(--bad); }
.crow .pct { text-align: right; }


/* ======================= round four ======================= */
/* section titles follow the admin's choice (bold, italics, underline, letters) */
.tab-grid .win-name, .home-grid .win-name { font-weight: var(--t-weight, 500); font-style: var(--t-style, normal); text-decoration: var(--t-deco, none); text-transform: var(--t-case, none); }
.title-demo { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--win2); color: var(--muted); font-size: 13px; }

/* recently added: a slowly drifting strip of small covers */
.recent-strip { overflow: hidden; position: relative; padding: 2px 0 4px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.recent-strip.dragging { cursor: grabbing; }
.recent-strip.static { cursor: default; }
.recent-track { display: flex; gap: 10px; width: max-content; will-change: transform; }
.rcover { flex: none; width: 84px; color: inherit; text-decoration: none; -webkit-user-drag: none; }
.rcover.gap { margin-left: 14px; }
.rposter { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--win2); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.rposter img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.rkind { position: absolute; left: 4px; top: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rtitle { margin-top: 4px; font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) { .rcover { width: 96px; } }

/* game server cards */
.srvcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.srvcard { background: var(--win2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; }
.srvcard.off { opacity: .8; }
.srv-banner { position: relative; aspect-ratio: 16 / 6; display: grid; place-items: center; overflow: hidden; }
.srv-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.srv-game { color: rgba(255, 255, 255, .92); font-weight: 800; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); padding: 0 12px; text-align: center; }
.srv-state { position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-weight: 600; }
.srv-state i { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; }
.srv-state.up i { background: #3ddc84; box-shadow: 0 0 6px #3ddc84; }
.srv-state.down i { background: #ef5350; }
.srv-body { padding: 11px 14px 14px; display: grid; gap: 8px; }
.srv-name { font-weight: 700; font-size: 15px; }
.srv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.srv-stat { background: var(--win); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.srv-val { font-weight: 600; font-size: 15px; }
.srv-addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: var(--win); border: 1px dashed var(--border); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; cursor: pointer; text-align: left; }
.srv-addr:hover { border-color: var(--accent); }
.srv-prev { background: var(--win); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-height: 56px; display: grid; place-items: center; padding: 6px; }
.srv-prev img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; }

/* array health, disk space, backups */
.health { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--win2); }
.health-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--good); box-shadow: 0 0 8px var(--good); }
.health.warn .health-dot { background: var(--warn, #e0a93b); box-shadow: 0 0 8px var(--warn, #e0a93b); }
.health.bad .health-dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.health.bad { border-color: var(--bad); }
.health-issues { margin: 8px 0 0 4px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 10px; }
.temp { background: var(--win2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; display: grid; }
.temp.warn strong { color: var(--warn, #e0a93b); }
.temp.bad strong { color: var(--bad); }
.drow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 0; }
.drow + .drow { border-top: 1px solid var(--border); }
.drow-top { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; }
.drow .bar { height: 7px; align-self: center; }
.drow .bar > i.warm { background: var(--warn, #e0a93b); }
.drow .bar > i.hot { background: var(--bad); }
.drow-pct { font-size: 12px; color: var(--muted); min-width: 74px; text-align: right; }
.drow-pct.warn { color: var(--warn, #e0a93b); } .drow-pct.bad { color: var(--bad); }
.brow { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.brow + .brow { border-top: 1px solid var(--border); }
.brow-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--good); }
.brow.late .brow-dot, .brow.error .brow-dot { background: var(--bad); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.win.alerting { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad), 0 0 18px rgba(239, 83, 80, .25); }

/* weather alerts and sun times */
.wx-alert { border-left: 4px solid var(--warn, #e0a93b); background: var(--win2); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.wx-alert summary { cursor: pointer; }
.wx-alert.sev-severe, .wx-alert.sev-extreme { border-left-color: var(--bad); }
.wx-alert.sev-minor { border-left-color: #6aa9ff; }
.wx-alert p { margin: 6px 0 0; }
.stats6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 800px) { .stats6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* photo notes: a white frame, the picture, and a handwritten caption */


/* ======================= round five: text-only links and long links ======================= */
/* a small card with just a centered title, as wide as the other tiles */
.tiles.text-tiles { margin-top: 10px; }
.tiles.text-tiles:empty { display: none; }
.tile.text-only { justify-content: center; text-align: center; padding: 12px 10px; min-height: 44px; }
.tile.text-only .tile-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; word-break: break-word; }

/* a very long link can no longer stretch the page: rows shrink and the link is cut with an ellipsis */
.win, .win-body, .win-inset, .stack, .app-row { min-width: 0; }
.win-inset { max-width: 100%; }
.app-row > .grow { min-width: 0; flex: 1 1 0; }
.tile-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.app-row .row-actions { flex: none; flex-wrap: nowrap; }
.textonly-mark { border: 1px dashed var(--border); border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }


/* ======================= round six ======================= */
/* Home: Bandwidth and Seerr requests sit side by side, the same size as the other small cards */
.home-grid > .span-bandwidth, .home-grid > .span-requests { grid-column: span 12; }
@media (min-width: 900px) { .home-grid > .span-bandwidth, .home-grid > .span-requests { grid-column: span 6; } }
.span-bandwidth .speeds { gap: 18px; }
.span-bandwidth .speeds .big { font-size: 22px; }
.span-bandwidth .spark { height: 40px; margin: 6px 0 2px; }

/* Media: Music and Photos share a row, Books and Games share a row */
@media (min-width: 900px) { .tab-grid > .s-photos, .tab-grid > .s-games { grid-column: span 6; } }

/* calendar: movies show how they are released right beside the title */
.ev.has-sub { display: flex; align-items: baseline; gap: 6px; }
.ev.has-sub .ev-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.ev.has-sub .ev-s { flex: none; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; opacity: .78; }

/* containers: name on the left, buttons on the right */
.ccard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ccard-head .ccard-name { min-width: 0; flex: 1; }
.ccard-acts { display: flex; gap: 2px; flex: none; margin: -4px -6px -4px 0; }
.ccard-acts .icon-btn { width: 30px; height: 30px; }

/* logs */
.log-row { cursor: pointer; }
.log-row:hover td, .log-row:focus-visible td { background: var(--win2); }
.log-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.log-detail { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-del { width: 38px; text-align: right; }
.log-field { display: grid; gap: 2px; }
.log-val { overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- photo notes: an instant photo ---------- */
/* The note box keeps the same footprint as every other note; the photo card inside is taller than wide, like the real thing. */
.pn.polaroid { background: none; box-shadow: none; border-radius: 0; }
.pn.polaroid::before { display: none; }
.pn.polaroid.lift { box-shadow: none; }
.pola-card {
  position: absolute; top: 0; bottom: 0; left: 8%; right: 8%; box-sizing: border-box; display: flex; flex-direction: column;
  padding: 5.4% 5.4% 0; border-radius: 2px;
  background: linear-gradient(168deg, #fffdf7 0%, #f7f2e5 52%, #eee7d4 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .85), inset -1px -1px 0 rgba(0, 0, 0, .07), inset 0 -3px 5px rgba(120, 100, 60, .1),
    0 1px 1px rgba(0, 0, 0, .22), 0 3px 5px rgba(0, 0, 0, .2), 4px 12px 16px rgba(0, 0, 0, .34);
}
.pn.lift .pola-card { box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .85), inset -1px -1px 0 rgba(0, 0, 0, .07), 0 2px 2px rgba(0, 0, 0, .22), 6px 18px 24px rgba(0, 0, 0, .4); }
.pola-card::after { /* fine paper grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/><feColorMatrix type='matrix' values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .4 0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.pola-photo {
  position: relative; flex: none; aspect-ratio: 1 / 1; overflow: hidden; background: #2b2b2b; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .12), 0 1px 0 rgba(255, 255, 255, .8);
}
.pola-photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; filter: contrast(1.06) saturate(1.08) sepia(.06); }
.pola-photo::after { /* soft vignette and a glossy sheen across the picture */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 38%), radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .3) 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
.pola-cap { flex: 1; display: grid; place-items: center; text-align: center; color: #262b36; line-height: 1; overflow: hidden; padding: 0 4px; }
.pn.polaroid .pn-foot { display: none; }
.pn.polaroid.preview { position: relative; width: 190px; height: 190px; margin: 6px auto; background: none; box-shadow: none; }


/* ======================= round eight: gaming news scrolls instead of stretching ======================= */
.news-scroll { overflow: hidden; }
.news-scroll.open { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.news-scroll.open::-webkit-scrollbar { width: 8px; }
.news-scroll.open::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }


/* ======================= logs: search, flags, devices, sessions ======================= */
.log-search { flex: 1 1 200px; min-width: 160px; }
.log-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.log-flag { margin-left: 6px; }
.log-row.flagged td { background: rgba(239, 83, 80, .08); }
.log-device { color: var(--muted); white-space: nowrap; }
.log-changes { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.sess-row { align-items: center; }
@media (max-width: 800px) { .log-device { display: none; } }


/* sign-in with Face ID; install steps */
.card.login .btn.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 6px; justify-self: center; font-size: 13px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }


/* ======================= request box ======================= */
.reqbox { position: relative; margin-top: 12px; }
.req-input { width: 100%; box-sizing: border-box; background: var(--win2); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; color: var(--text); font: inherit; font-size: 14px; outline: none; -webkit-appearance: none; appearance: none; }
.req-input::placeholder { color: var(--muted); opacity: .8; }
.req-input:focus { border-color: var(--accent); }
.req-input::-webkit-search-cancel-button { display: none; }
.req-panel { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); max-height: 340px; overflow-y: auto; background: var(--win); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); padding: 6px; z-index: 30; overscroll-behavior: contain; }
.req-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.req-row + .req-row { margin-top: 2px; }
.req-row:hover { background: var(--win2); }
.req-poster { width: 38px; height: 57px; border-radius: 5px; object-fit: cover; background: var(--win2); display: block; }
.req-text { min-width: 0; }
.req-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-btn { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.req-btn:disabled { opacity: .6; cursor: default; }
.req-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.req-state.good { color: var(--good); }
.req-note { padding: 12px; color: var(--muted); font-size: 13px; }
.req-note.warn { color: var(--warn); }


/* ======================= phone top bar: tabs or a themed drop-down ======================= */
.navdrop { display: none; position: relative; margin-bottom: 16px; }
.navdrop-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--win); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; }
.navdrop-btn .ico { color: var(--accent); transition: transform .18s ease; }
.navdrop.open .navdrop-btn { border-color: var(--accent); }
.navdrop.open .navdrop-btn .ico { transform: rotate(180deg); }
.navdrop-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; background: var(--win); border: 1px solid var(--border); border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; }
.navdrop-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 11px; color: var(--text); font-size: 16px; text-decoration: none; min-height: 44px; }
.navdrop-item span { flex: 1; }
.navdrop-item:active, .navdrop-item:hover { background: var(--win2); text-decoration: none; }
.navdrop-item.on { background: var(--win2); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
@media (max-width: 640px) {
  html[data-mobilenav="menu"] .nav { display: none; }
  html[data-mobilenav="menu"] .navdrop { display: block; }
}


/* my feeds */
.feed-block { gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--win2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; border-radius: 999px; }
.chip-x:hover { color: var(--bad); }
.feed-row { align-items: center; }


/* ======================= Tortuga look: welcome screen, top bar clock ======================= */
.hero { display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: 2px; }
.hero-img { width: min(220px, 62vw); height: auto; display: block; filter: drop-shadow(0 10px 26px rgba(0, 0, 0, .55)); }
.hero-img.custom { max-height: 120px; width: auto; max-width: 100%; object-fit: contain; filter: none; }
.welcome { margin: 4px 0 0; font-family: 'Pirata One', 'Palatino Linotype', Georgia, serif; font-weight: 400; font-size: 40px; line-height: 1.05; letter-spacing: .02em; color: #f2c96b;
  text-shadow: 0 2px 0 #6b4a12, 0 4px 14px rgba(0, 0, 0, .55); }
.card.login { max-width: 400px; }

.topinfo { display: flex; align-items: center; gap: 16px; color: var(--text); }
.ti-clock { text-align: right; line-height: 1.15; }
.ti-time { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ti-date { font-size: 12px; color: var(--muted); }
.ti-weather { display: inline-flex; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600; }
.ti-weather:hover { text-decoration: none; color: var(--accent); }
.ti-icon { color: var(--accent); display: inline-flex; }
.cog { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); }
.cog:hover { background: var(--win); color: var(--text); text-decoration: none; }
html[data-topinfo="off"] .topinfo { display: none; }
@media (max-width: 800px) { .topinfo { display: none; } }


/* Upcoming on Home: three rows show, the rest scroll inside the card */
.upcoming-scroll.scrolls { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.upcoming-scroll.scrolls::-webkit-scrollbar { width: 8px; }
.upcoming-scroll.scrolls::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.upcoming-scroll.scrolls:not(.at-end) { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent); }


/* the quiet "Wanted: 10" beside a card title */
.win-wanted { margin-left: 10px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); opacity: .7; white-space: nowrap; }
a.win-wanted:hover { opacity: 1; color: var(--text); text-decoration: none; }


/* two small tabs in a card's corner (Epic: Free Now / Coming Up) */
.pilltabs { display: inline-flex; gap: 8px; }
.pilltab { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 4px 13px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; opacity: .75; }
.pilltab:hover { opacity: 1; color: var(--text); }
.pilltab.on { opacity: 1; color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }


/* ======================= one bar across the top ======================= */
.app-header .brand { flex: 0 0 auto; }
.app-header .topinfo { flex: 0 0 auto; }
.app-header .nav a { font-size: 14px; }
@media (max-width: 1180px) { .topinfo { display: none; } }
@media (max-width: 640px) {
  .app-header { flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .app-header .nav { order: 3; flex: 1 0 100%; }
  .nav .admin-link { margin-left: 8px; }
}


/* photos open in a viewer on the page */
button.cover-cell.openable { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: zoom-in; width: 100%; }
button.cover-cell.openable:hover .cover, button.cover-cell.openable:focus-visible .cover { outline: 2px solid var(--accent); }
html.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(4, 7, 16, .94); display: grid; grid-template-rows: 1fr auto; animation: lbfade .16s ease-out; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 20px 64px 8px; touch-action: pan-y; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 18px 60px rgba(0, 0, 0, .6); user-select: none; -webkit-user-select: none; transition: opacity .15s; }
.lightbox.loading .lb-img { opacity: .25; }
.lightbox.broken .lb-img { display: none; }
.lightbox.broken .lb-stage::after { content: "This photo could not be loaded."; color: var(--muted); font-size: 15px; }
.lb-spin { position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: lbspin .8s linear infinite; opacity: 0; pointer-events: none; }
.lightbox.loading .lb-spin { opacity: 1; }
@keyframes lbspin { to { transform: rotate(360deg); } }
.lb-btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(16, 22, 42, .75); color: #fff; cursor: pointer; }
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(40, 54, 96, .9); border-color: var(--accent); outline: none; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 16px 16px; color: #dfe5f5; font-size: 14px; }
.lb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; font-weight: 600; }
.lb-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-link { color: var(--accent); font-size: 13px; }
@media (max-width: 640px) { .lb-stage { padding: 56px 8px 4px; } .lb-prev, .lb-next { display: none; } }
