/* Vengeance — login card, dot-grid dashboard, drawers. Uses the tokens in style.css. */

/* ---------- Login ---------- */
.vg-login { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto;
  background-color: var(--bg); background-image: var(--dots); background-size: 22px 22px; }
.vg-card { width: 100%; max-width: 380px; padding: 26px 24px 20px; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.vg-word { font: 400 18px/1 var(--display); letter-spacing: 0.18em; color: var(--amber); }
.vg-title { font: 400 38px/1 var(--display); letter-spacing: 0.03em; text-wrap: balance; }
.vg-sub { color: var(--muted); font-size: 13.5px; }
.vg-card form { display: flex; flex-direction: column; gap: 12px; }
.vg-card .field input { min-height: 42px; font-size: 16px; }
.vg-google { min-height: 42px; }
.vg-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font: 12px var(--mono); }
.vg-or::before, .vg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vg-err { color: var(--bad); font-size: 13.5px; }
.vg-submit { min-height: 44px; font-size: 14px; }
.vg-switch { background: none; border: 0; padding: 6px 0 0; color: var(--muted); font-size: 13px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.vg-switch:hover { color: var(--text); }
.vg-user { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vg-user-name { font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* ---------- Dashboard: an open dot-grid canvas ---------- */
html.desk-page, .desk-page body { height: 100%; }
.desk-page body { overflow: hidden; }
.desk { position: relative; height: 100%; min-height: 420px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.desk-bar { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1560px; margin: 0 auto; padding: 34px var(--gut) 0; pointer-events: none; }
.desk-bar > * { pointer-events: auto; }
.desk-hint { position: absolute; left: 22px; bottom: 18px; z-index: 5; font: 12px var(--mono); color: var(--faint); pointer-events: none; }
.ico { position: absolute; left: 0; top: 0; width: 110px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent; border-radius: 14px; cursor: default; touch-action: none;
  transition: transform 0.45s var(--spring), background 0.2s, border-color 0.2s; }
.ico-tile { width: 72px; height: 72px; border-radius: 17px; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 3px; color: var(--amber);
  transition: transform 0.4s var(--spring), border-color 0.2s, background 0.2s; }
.ico-tile svg { width: 42px; height: 42px; }
.ico-label { font: 500 13px var(--sans); color: var(--text); padding: 2px 8px; border-radius: 6px; transition: background 0.2s, color 0.2s; }
.ico:hover .ico-tile { border-color: #4a4c56; }
.ico.sel { background: var(--amber-wash); border-color: rgba(255, 160, 31, 0.35); }
.ico.sel .ico-tile { border-color: var(--amber); background: #26221a; }
.ico.sel .ico-label { background: var(--amber); color: var(--on-amber); }
.ico:active .ico-tile { transform: scale(0.94); transition-duration: 0.06s; }
.ico.drag { transition: none; z-index: 4; cursor: grabbing; }
.ico.drag .ico-tile { transform: scale(1.06); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.5); }
.ico.opening .ico-tile { transform: scale(1.25); transition: transform 0.18s var(--glide); }
.ico.opening { opacity: 0.6; transition: opacity 0.18s; }

/* ---------- Invite page ---------- */
.invite-page main { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.invite-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.invite-box .vg-card h1 { font-size: 34px; overflow-wrap: anywhere; }
.invite-box .who { font: 12.5px var(--mono); color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Drawers (People, Activity) ---------- */
.scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.5); animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(460px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -24px 0 50px rgba(0, 0, 0, 0.45); animation: drawerIn 0.4s var(--glide); }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } }
.drawer > header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { flex: 1; font: 400 26px/1 var(--display); letter-spacing: 0.04em; }
.drawer > header .private { font: 11px var(--mono); color: var(--amber); border: 1px solid rgba(255, 160, 31, 0.4); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.drawer-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 4px 16px 24px; }
.dsec { padding: 16px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.dsec:last-child { border-bottom: 0; }
.dsec h3 { font: 600 13px var(--sans); color: var(--text); }
.dsec p { font-size: 12.5px; color: var(--muted); }
.dsec .field input, .dsec select { min-height: 38px; font-size: 14px; }
.dsec select { width: 100%; padding: 5px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line-soft); border-radius: 7px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--muted); transition: background 0.2s, border-color 0.2s, color 0.2s; }
.seg input:checked + span { color: var(--amber); border-color: rgba(255, 160, 31, 0.6); background: var(--amber-wash); }
.seg input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.inv-out { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed rgba(255, 160, 31, 0.5); border-radius: 10px; background: var(--amber-wash); }
.inv-out .row { display: flex; gap: 8px; }
.inv-out input { flex: 1; min-width: 0; min-height: 38px; padding: 5px 8px; font: 12px var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line-soft); }
.prow:first-child { border-top: 0; }
.prow .nm { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.prow .em { font: 12px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.prow .acts { display: flex; gap: 6px; align-items: center; }
.prow select { width: auto; min-height: 32px; font-size: 12.5px; }
.empty-note { font-size: 13px; color: var(--muted); padding: 6px 0; }
.btn.danger:hover { color: var(--bad); border-color: rgba(255, 92, 92, 0.5); }
.btn.armed { color: var(--bad); border-color: rgba(255, 92, 92, 0.6); background: rgba(255, 92, 92, 0.1); }

.log-tools { display: flex; gap: 8px; padding: 12px 0 4px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.log-tools select { flex: 1; min-height: 36px; padding: 5px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line-soft); border-radius: 7px; font-size: 13px; }
.ev { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 10px; padding: 10px 0; border-top: 1px dashed var(--line-soft); }
.ev .dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.ev[data-kind="edit"] .dot { background: var(--amber); }
.ev[data-kind="add"] .dot, .ev[data-kind="restore"] .dot, .ev[data-kind="create"] .dot { background: var(--good); }
.ev[data-kind="delete"] .dot, .ev[data-kind="clear"] .dot { background: var(--bad); }
.ev[data-kind="people"] .dot, .ev[data-kind="open"] .dot, .ev[data-kind="export"] .dot { background: var(--info); }
.ev .top { font: 12px var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ev .top b { color: var(--text); font-weight: 500; }
.ev .sum { grid-column: 2; font-size: 13.5px; overflow-wrap: anywhere; }

/* ---------- Dashboard tile: the way back to all tools, top left on every budget screen ---------- */
.home { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: 22px; padding-right: 22px; border-right: 1px solid var(--line); border-radius: 13px 0 0 13px; }
.home .tile {
  display: grid; place-items: center; flex: none; width: 50px; height: 50px; margin-bottom: 4px; border-radius: 13px;
  background: var(--amber); color: var(--on-amber); box-shadow: 0 4px 0 var(--amber-deep);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), filter 0.2s;
}
.home .dg { width: 24px; height: 24px; }
.home .dg circle { transform-box: fill-box; transform-origin: center; transition: transform 0.45s var(--spring); }
.home b { display: block; font: 400 24px/1 var(--display); letter-spacing: 0.05em; color: var(--text); }
.home small { display: block; margin-top: 3px; font: 500 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.home:hover .tile { filter: brightness(1.08); }
.home:hover .dg circle:nth-child(5) { transform: scale(1.45); }
.home:active .tile { transform: translateY(3px); box-shadow: 0 1px 0 var(--amber-deep); transition-duration: 0.07s; }
/* On the dashboard itself the tile is the site mark, not a link. */
.home.here { margin-right: 0; padding-right: 0; border-right: 0; }
.home.here .tile, .home.here:hover .tile { filter: none; }
.home.here:hover .dg circle:nth-child(5) { transform: none; }
.home.mini { gap: 0; margin-right: 2px; padding-right: 12px; }
.home.mini .tile { width: 36px; height: 36px; margin-bottom: 3px; border-radius: 10px; box-shadow: 0 3px 0 var(--amber-deep); }
.home.mini .dg { width: 18px; height: 18px; }
.home.mini:active .tile { transform: translateY(2px); }
@media (max-width: 860px) {
  .home { margin-right: 14px; padding-right: 14px; }
  .home .home-txt { display: none; }
  .home.here .home-txt { display: block; }
  .home .tile { width: 44px; height: 44px; }
  .home.mini { padding-right: 8px; margin-right: 0; }
  .home.mini .tile { width: 34px; height: 34px; }
}

.site .site-only { display: inline-flex !important; align-items: center; }
.site.owner .owner-only { display: inline-flex !important; }
.site .lhead-actions .vg-user { order: 0; }
@media (max-width: 860px) {
  .site.owner .ebar .owner-only.only-wide { display: none !important; }
  .site.owner .owner-narrow { display: flex !important; }
  .vg-user-name { max-width: 130px; }
}
.no-create #newBtn, .no-create .brow-acts { display: none !important; }
