@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/inter.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/spacegrotesk.woff2) format('woff2'); }
:root {
  --bg: #1E1F26; --surface: #26272F; --raised: #30313A; --text: #EEEDF3; --muted: #A6A4B5;
  --border: rgba(255,255,255,0.08); --accent: #8F62F8; --accent-2: #9B74F9; --accent-soft: rgba(143,98,248,0.16);
  --warn: #F2B84B; --danger: #FF6B7A; --ok: #5DD39E;
  --on-accent: #FBFAFF; --hair: rgba(255,255,255,0.06); --ring: rgba(238,237,243,0.20); --zebra: #292A32; --head: #2A2B33; --head-solid: #2A2B33;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; --title: 'Space Grotesk', 'Inter', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
body { overscroll-behavior: none; }
#root { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2 { font-family: var(--title); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 17px; margin-bottom: 4px; }
.muted { color: var(--muted); margin: 4px 0; }
.small { font-size: 13px; }
.big { font-size: 20px; font-weight: 600; margin: 2px 0 0; }

.view { min-height: 100%; padding: 0 0 calc(env(safe-area-inset-bottom) + 24px); }
.view.center { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 56px) 20px calc(env(safe-area-inset-bottom) + 32px); }
.brand { text-align: center; margin-bottom: 26px; }
.brand-mark { width: 84px; height: 84px; border-radius: 22px; display: block; margin: 0 auto 16px; box-shadow: 0 0 0 1px var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
input { display: block; width: 100%; height: 48px; margin-top: 6px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px;
  font: 16px var(--ui); background: var(--raised); color: var(--text); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 4px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; border: 0;
  font: 600 16px var(--ui); cursor: pointer; margin-top: 8px; text-decoration: none; transition: transform .12s, background-color .15s; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:active { background: var(--accent-2); }
.btn.secondary { background: var(--raised); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.small { width: auto; height: 38px; padding: 0 14px; font-size: 14px; margin: 0; }
.btn:disabled { opacity: .55; }
.msg { color: var(--danger); min-height: 20px; font-size: 14px; margin: 10px 0 0; }
.msg.ok { color: var(--ok); }

/* header bar (Games style) */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: rgba(30,31,38,0.96); border-bottom: 1px solid var(--border); }
.bar-title { display: flex; align-items: center; gap: 10px; font: 600 20px var(--title); letter-spacing: -0.01em; }
.center-title { flex: 1; justify-content: center; }
.bar-mark { width: 30px; height: 30px; border-radius: 9px; }
.bar-actions { display: flex; gap: 8px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: inline-flex;
  align-items: center; justify-content: center; color: var(--text); cursor: pointer; padding: 0; text-decoration: none; flex: none; }
.iconbtn.ghost { visibility: hidden; }
.content { max-width: 560px; margin: 0 auto; padding: 16px 16px 0; }
.content.wide { max-width: 900px; }
.hello { font: 600 22px/32px var(--title); margin: 8px 0 16px; letter-spacing: -0.01em; }

/* icons (CSS masks) */
.i { width: 20px; height: 20px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; flex: none; }
.i.sm { width: 13px; height: 13px; vertical-align: -2px; }
.i-user { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E"); }
.i-admin { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
.i-back { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E"); }
.i-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-face { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2M9 9v1M15 9v1M12 9v4h-1M9 16c1.8 1.3 4.2 1.3 6 0'/%3E%3C/svg%3E"); }
.i-link { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.i-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.i-lock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }

/* tiles: name only, all the same height, one 16px grid */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 120px; padding: 16px 8px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); text-align: center; transition: transform .14s ease, border-color .15s; }
.tile:active { transform: scale(0.96); }
@media (hover: hover) { .tile:hover { border-color: rgba(143,98,248,0.40); } }
.tile img { width: 64px; height: 64px; border-radius: 16px; display: block; background: var(--raised); object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--border), 0 2px 8px rgba(10,10,16,0.25); }
.tile-name { font-size: 14px; font-weight: 600; line-height: 20px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tile-sub { display: none; }
.empty { text-align: center; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.offer p { margin: 2px 0 0; }

/* account */
.keys { list-style: none; padding: 0; margin: 8px 0 0; }
.keys li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.keys li button { height: 34px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--raised); color: var(--danger); font: 600 13px var(--ui); cursor: pointer; }

/* admin grid: one 8pt grid. Rows 56px, header 48px, 8 equal app columns (32px at 390 wide), centred round toggles. */
.intro { margin: 0 0 16px; line-height: 1.5; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 336px; table-layout: fixed; }
.grid th, .grid td { padding: 0; height: 55px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--hair); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid thead th { height: 48px; background: var(--head); font: 500 12px var(--ui); color: var(--muted); }
.grid tbody tr:nth-child(even) td { background: var(--zebra); }
.grid th.app img { width: 22px; height: 22px; border-radius: 6px; display: block; margin: 0 auto; box-shadow: 0 0 0 1px var(--border); }
.grid th.u, .grid td.u { position: sticky; left: 0; z-index: 1; width: 112px; text-align: left; padding: 0 4px 0 12px; }
.grid td.u { background: var(--surface); }
.grid th.u { background: var(--head-solid); }
.uname { position: relative; display: block; width: 100%; height: 55px; background: none; border: 0; color: var(--text); text-align: left;
  padding: 10px 12px 0 0; cursor: pointer; font: 600 14px/18px var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uname small { display: block; font: 400 12px/16px var(--ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uname small.warn { color: var(--warn); }
.uname small.off { color: var(--danger); }
.uname::after { content: '›'; position: absolute; right: 0; top: 50%; transform: translateY(-55%); color: var(--muted); opacity: .6; font: 400 18px var(--ui); }
tr.disabled td:not(.u) .cell { opacity: .35; }
tr.disabled .uname { color: var(--muted); }
.cell { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: center; height: 55px; }
/* the whole upper part of the cell is the button; the circle is drawn inside it */
.chk { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 36px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--on-accent); }
.chk::before { content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ring); background: transparent; transition: background-color .15s, box-shadow .15s; }
.chk .i { position: relative; width: 14px; height: 14px; opacity: 0; }
.chk.on::before { background: var(--accent); box-shadow: none; }
.chk.on .i { opacity: 1; }
.chk.temp::before { background: var(--warn); box-shadow: none; }
.chk.temp { color: #2A2110; }
.chk.temp .i { opacity: 1; }
.chk.locked { cursor: default; color: var(--accent-2); }
.chk.locked::before { background: var(--accent-soft); box-shadow: none; }
.chk.locked .i { opacity: 1; width: 12px; height: 12px; }
.chk:disabled { cursor: default; }
@media (hover: hover) { .chk:not(:disabled):not(.on):not(.temp):hover::before { box-shadow: inset 0 0 0 1.5px var(--accent); } }
.chk:focus-visible { outline: none; }
.chk:focus-visible::before { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1.5px var(--accent); }
.exp { display: block; width: 100%; height: 16px; border: 0; background: none; color: var(--muted); font: 500 10px/16px var(--ui); padding: 0; cursor: pointer;
  white-space: nowrap; overflow: hidden; letter-spacing: -0.01em; opacity: .8; }
.exp.temp { color: var(--warn); opacity: 1; }
.exp.expired { color: var(--danger); opacity: 1; }
.exp-ph { display: block; height: 16px; }
.cell > .i-link { position: absolute; top: 4px; right: 50%; margin-right: -16px; width: 9px; height: 9px; }
.legend { margin: 16px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); vertical-align: -1px; }
.dot.temp { background: var(--warn); }
@media (min-width: 520px) {
  .grid th.u, .grid td.u { width: 200px; }
  .chk::before { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
  .grid th.app img { width: 24px; height: 24px; }
}

/* bottom sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(20,21,27,0.78); display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: calc(100% - env(safe-area-inset-top) - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 24px); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--raised); margin: 0 auto 16px; }
.sheet h2 { font-size: 20px; margin-bottom: 2px; }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--border); background: var(--raised); color: var(--text); font: 500 14px var(--ui); cursor: pointer; }
.chip.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--on-accent); }
.facts { list-style: none; padding: 0; margin: 16px 0; font-size: 14px; }
.facts li { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--hair); }
.facts li:last-child { border-bottom: 1px solid var(--hair); }
.facts li span:first-child { color: var(--muted); }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linkbox input { margin: 0; font-size: 13px; height: 42px; }
.linkbox .btn { width: auto; margin: 0; height: 42px; padding: 0 14px; font-size: 14px; flex: none; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 6px 0 4px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 0; }
.checks input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
/* Beheer: duidelijke knop bovenaan, chevron bij de naam, bevestiging in de pagina */
.addbtn { margin: 0 0 16px; height: 48px; }
.addbtn .i { width: 18px; height: 18px; }
.sheet-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--raised); color: var(--text); font: 400 24px/36px var(--ui); cursor: pointer; padding: 0; }
.sheet h2 { padding-right: 40px; }
.confirm { margin-top: 8px; padding: 16px; border-radius: 12px; border: 1px solid rgba(255,107,122,0.45); background: rgba(255,107,122,0.08); }
.confirm p { margin: 0 0 8px; font-size: 14px; }
.confirm .btn { margin-top: 8px; }
.btn.solid-danger { background: var(--danger); color: #1E1F26; }
.linkbox { flex-wrap: wrap; }
.linkbox input { font-size: 16px; flex: 1 1 100%; }
.linkbox .btn { flex: 1 1 0; }
.sheet .btn { margin-top: 8px; }
/* user sheet: delete set apart at the bottom */
.danger-zone { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hair); }
.btn.delete { background: rgba(255,107,122,0.14); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255,107,122,0.30); }
.btn.delete:active { background: rgba(255,107,122,0.22); }

/* Apps binnen het portaal (thuisscherm-app) */
#shell { position: fixed; inset: 0; z-index: 40; background: #1E1F26; display: flex; flex-direction: column; }
#shell[hidden] { display: none; }
.shell-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: env(safe-area-inset-top) 8px 0; box-sizing: content-box;
  background: #1E1F26; border-bottom: 1px solid var(--border); }
.shell-home { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px; color: var(--text); text-decoration: none; font: 600 14px var(--ui); background: var(--surface); }
.shell-home .i { width: 16px; height: 16px; }
.shell-home img { width: 20px; height: 20px; border-radius: 6px; }
.shell-title { flex: 1; text-align: center; font: 600 15px var(--ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.shell-btn .i { width: 16px; height: 16px; }
.shell-frames { flex: 1; position: relative; min-height: 0; }
.shell-frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.shell-frames iframe[hidden] { display: none; }
.shell-foot { flex: none; height: env(safe-area-inset-bottom); background: #fff; }
.i-reload { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E"); }
.keys li { flex-wrap: wrap; }
.keys li .confirm { flex: 1 1 100%; }
