/* Soroudi Dashboard — the hub.
   Deliberately one small stylesheet. This app has one screen and no state; the
   moment it needs a build step it has stopped being a launcher. */

/* Light is the bare :root so an un-stamped document (the "system" setting, which
   stamps nothing) still gets a complete palette. Dark is redefined twice: once
   under prefers-color-scheme guarded against an explicit light choice, and once
   under the stamp, so the toggle wins in both directions. Tokens only -- no
   component may take a colour from inside a media or [data-theme] block, or it
   renders one theme's text on the other theme's ground. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: #d8dee9;
  --text: #16203a;
  --muted: #5d6a86;
  --sky: #155eef;
  --amber: #b57400;
  --shadow: 0 1px 2px rgba(16, 28, 56, .06), 0 10px 30px rgba(16, 28, 56, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071a3d;
    --surface: #0f2650;
    --surface-2: #143065;
    --border: #22407a;
    --text: #e8eefb;
    --muted: #9fb0d0;
    --sky: #42a5ff;
    --amber: #e8a200;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .38);
  }
}
:root[data-theme="dark"] {
  --bg: #071a3d;
  --surface: #0f2650;
  --surface-2: #143065;
  --border: #22407a;
  --text: #e8eefb;
  --muted: #9fb0d0;
  --sky: #42a5ff;
  --amber: #e8a200;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Standalone mode has no browser chrome, so the notch and home indicator sit
     on the content unless the insets are honoured. */
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}
.wrap { max-width: 760px; margin: 0 auto; }

.head { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.mark { flex: 0 0 auto; }
h1 { font-size: 25px; line-height: 1.15; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.sub { color: var(--muted); font-size: 14.5px; margin: 3px 0 0; }

/* auto-fit, so a third dashboard needs no change here. minmax keeps a tile
   readable rather than letting two squeeze onto a 360px phone. */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 14px; }

.tile {
  display: grid;
  grid-template-areas: "icon name" "icon note" "icon host";
  grid-template-columns: 44px 1fr;
  gap: 2px 14px;
  align-content: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  /* The accent is a left rail rather than a fill: it identifies the dashboard
     without competing with the text for the same square inch. */
  border-left: 4px solid var(--rail, var(--muted));
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile[data-accent="sky"] { --rail: var(--sky); }
.tile[data-accent="amber"] { --rail: var(--amber); }
.tile-icon { grid-area: icon; font-size: 27px; line-height: 1; }
.tile-name { grid-area: name; font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.tile-note { grid-area: note; color: var(--muted); font-size: 14px; }
.tile-host { grid-area: host; color: var(--muted); font-size: 12.5px; opacity: .8; margin-top: 6px;
  font-variant-numeric: tabular-nums; }

@media (hover: hover) {
  .tile:hover { transform: translateY(-2px); border-color: var(--rail, var(--border)); }
}
.tile:focus-visible { outline: 2px solid var(--rail, var(--sky)); outline-offset: 3px; }
.tile:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

.foot { color: var(--muted); font-size: 13px; margin: 26px 0 0; }

/* Offline. The hub is a list of links, so it is entirely usable with no
   network -- but the links are not, and saying so beats letting someone tap
   into a spinner. */
.offline {
  display: none;
  margin: 0 0 18px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
}
body.is-offline .offline { display: block; }
