/* ExtraTab Series 1 web app. Same board world, operate mode: quiet chrome, the panes are the content. */

body.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
body.app::before { mask-image: radial-gradient(90% 60% at 50% 0%, #000, transparent 90%); }

.app-bar {
  position: relative; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 24px;
  height: 60px; padding: 0 16px;
}
.app-bar .wordmark { font-size: 19px; }
.app-bar .mark { width: 28px; height: 28px; }
.app-hints {
  margin: 0 auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-hints span { margin: 0 8px; color: var(--line-3); }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-3);
}

.app-main {
  position: relative; z-index: var(--z-content);
  display: grid; grid-template-rows: auto 1fr; gap: 10px;
  min-height: 0; padding: 0 10px 10px;
}
.app-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }

.spaces { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.spaces::-webkit-scrollbar { display: none; }
.space {
  position: relative; flex: none;
  display: flex; align-items: center;
  border-radius: var(--r-m);
  color: var(--muted);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.space:hover { color: var(--text); }
.space[aria-selected="true"] { background: var(--mask-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.space > button {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 10px;
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 13.5px; font-weight: 500;
}
.space .mark { width: 16px; height: 16px; opacity: 0.55; transition: opacity 0.25s; }
.space[aria-selected="true"] .mark { opacity: 1; }
.space .name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space input {
  width: 160px; height: 36px; padding: 0 12px;
  border: 0; border-radius: var(--r-m); background: transparent; outline: none;
  font-size: 13.5px; font-weight: 500;
}
.space .del {
  display: grid; place-items: center; width: 22px; height: 22px; margin: 0 8px 0 -6px;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.space .del:hover { background: var(--mask-3); color: var(--text); }
.space .del svg { width: 12px; height: 12px; }
.add-space {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--r-m); background: transparent; color: var(--muted); cursor: pointer;
}
.add-space:hover { background: var(--mask-2); color: var(--text); }
.add-space svg { width: 16px; height: 16px; }

/* pane grid */
.grid {
  display: grid; gap: 8px; min-height: 0;
  grid-template-columns: 1fr; grid-template-rows: 1fr;
}
.grid[data-layout="2"] { grid-template-columns: 1fr 1fr; }
.grid[data-layout="3"] { grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; }
.grid[data-layout="3"] > .pn:first-child { grid-row: span 2; }
.grid[data-layout="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.grid[data-max] { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
.grid[data-max] > .pn { grid-row: auto !important; }
.grid[data-max] > .pn:not(.is-max) { display: none; }

.pn {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border-radius: var(--r-m); overflow: hidden;
  background: var(--mask);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.35s var(--ease);
}
.pn.is-active { box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 0 4px var(--cyan-a10); }
.pn-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
}
.pn-head kbd { flex: none; }
.pn.is-active .pn-head kbd { color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan-a40); }
.pn-head .ico { width: 14px; height: 14px; flex: none; color: var(--text); }
.pn-head .ico.fav { border-radius: 3px; }
.pn-head .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.pn-head .host { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pn-head .empty { color: var(--muted); }
.pn-actions { display: flex; gap: 2px; margin-left: auto; flex: none; }
.pn-actions a, .pn-actions button {
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.pn-actions a:hover, .pn-actions button:hover { background: var(--mask-3); color: var(--text); }
.pn-actions svg { width: 15px; height: 15px; }
.pn-body { position: relative; flex: 1; min-height: 0; }

.pn-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity 0.6s var(--ease); }
.pn-body iframe.is-loaded { opacity: 1; }
.pn-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.pn-loading i {
  display: block; width: 96px; height: 3px; border-radius: 3px; overflow: hidden; background: var(--mask-3); position: relative;
}
.pn-loading i::after {
  content: ""; position: absolute; inset: 0; width: 40%; background: var(--cyan); border-radius: 3px; box-shadow: 0 0 8px var(--cyan);
  animation: load 1.2s var(--ease-io) infinite;
}
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.pn-hint {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px 8px 12px; border-radius: 10px;
  background: rgb(8 16 26 / 0.92); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -10px rgb(0 0 0 / 0.8);
  font-size: 12.5px; color: var(--text-2);
  animation: hint-in 0.5s var(--ease) both;
}
@keyframes hint-in { from { opacity: 0; transform: translateY(8px); } }
.pn-hint a { color: var(--cyan-hi); }
.pn-hint button { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.pn-hint button:hover { color: var(--text); background: var(--mask-3); }
.pn-hint svg { width: 12px; height: 12px; }

/* picker */
.picker { position: absolute; inset: 0; overflow: auto; padding: 18px; display: grid; align-content: start; gap: 22px; }
.picker h2 { font-size: 12px; font-family: var(--sans); font-stretch: 100%; font-weight: 500; letter-spacing: 0; color: var(--muted); margin: 0 0 10px; line-height: 1.3; }
.url-form label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.url-row {
  display: flex; gap: 4px; padding: 4px; border-radius: var(--r-m);
  background: #070d15; box-shadow: inset 0 0 0 1px var(--line-2);
}
.url-row:focus-within { box-shadow: inset 0 0 0 1px var(--cyan-a40), 0 0 0 3px var(--cyan-a10); }
.url-row input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 0; background: transparent; outline: none; font-size: 14px; }
.url-row input::placeholder { color: #7d90a0; }
.url-row button {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 9px; background: var(--cyan); color: var(--cyan-ink); cursor: pointer;
}
.url-row button svg { width: 16px; height: 16px; }
.url-err { margin-top: 8px; font-size: 12.5px; color: var(--danger); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: var(--r-m); cursor: pointer; text-align: left;
  background: var(--mask-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s;
}
.pick:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--cyan-a40); }
.pick:active { transform: scale(0.98); }
.pick .tile { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--mask-3); box-shadow: inset 0 0 0 1px var(--line); }
.pick .tile svg { width: 15px; height: 15px; }
.pick b { display: block; font-size: 13px; font-weight: 500; }
.pick small { display: block; font-size: 11.5px; color: var(--muted); }
.locked { display: flex; flex-wrap: wrap; gap: 6px; }
.locked span {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--r-s);
  font-size: 12.5px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2);
}
.locked svg { width: 12px; height: 12px; }
.locked-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.locked-note a { color: var(--cyan-hi); }

/* blocked site */
.blocked { position: absolute; inset: 0; overflow: auto; display: grid; align-content: center; gap: 16px; padding: 24px; max-width: 520px; }
.blocked .pad { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--mask-3); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--cyan); }
.blocked .pad svg { width: 18px; height: 18px; }
.blocked strong { display: block; font-size: 16px; font-weight: 600; }
.blocked p { color: var(--text-2); font-size: 14.5px; max-width: 46ch; }
.blocked .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* notes and timer panes */
.pn-notes { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 18px 20px; font-size: 15px; line-height: 1.7; color: var(--text); }
.pn-notes::placeholder { color: #7d90a0; }
.pn-timer { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 22px; padding: 16px; }
.pn-timer .timer-hex { width: min(46%, 200px); height: auto; aspect-ratio: 1; min-width: 120px; }
.pn-timer .read { font-size: clamp(1.4rem, 2.6vw, 2.4rem); }
.pn-timer .timer-ctl { justify-content: center; }
.pn-timer .btn { --h: 40px; }

.noscript { position: fixed; inset: auto 16px 16px; padding: 12px 16px; border-radius: var(--r-m); background: var(--mask-2); }

@media (max-width: 1000px) { .app-hints { display: none; } .app-bar { justify-content: space-between; } }
@media (max-width: 760px) {
  body.app { height: auto; min-height: 100dvh; overflow: auto; }
  .grid, .grid[data-layout] { grid-template-columns: 1fr !important; grid-template-rows: none !important; grid-auto-rows: clamp(420px, 70dvh, 620px); }
  .grid[data-layout="3"] > .pn:first-child { grid-row: auto; }
  .app-bar .btn { padding: 0 12px; font-size: 13.5px; }
}
