/* The web client's window, as the Mac app's: a sidebar of pages, and what's open beside it. The kit (kit.css) styles
   what's inside: lists, rows, buttons and sheets. */
:root {
  --accent: #9e6e06;
  --sidebar: #e8e8eb;
  --window: #f5f5f7;
  --hover: rgba(0, 0, 0, 0.05);
  --selected: rgba(0, 0, 0, 0.09);
  --w-card: rgba(0, 0, 0, 0.05);
  --w-muted: #6e6e73;
  font-size: 13px;
}
@media (prefers-color-scheme: dark) {
  :root { --sidebar: #2c2c2c; --window: #282828; --hover: rgba(255, 255, 255, 0.05); --selected: rgba(255, 255, 255, 0.1); --w-card: rgba(255, 255, 255, 0.07); --w-muted: #98989d; --card: #2c2c2e; }
}
html, body { height: 100%; }
body { padding: 0; max-width: none; margin: 0; background: var(--window); font-size: 13px; overflow: hidden; }
#root { height: 100%; }
a { color: inherit; }

.window { display: grid; grid-template-columns: 240px 1fr; height: 100%; }

/* The sidebar: a section per page, its name opening the page, then its apps and its Services; Settings at the foot. */
.sidebar { background: var(--sidebar); display: flex; flex-direction: column; min-height: 0; }
.nav-pages { flex: 1; overflow-y: auto; padding: 14px 10px; }
.sidebar section + section { margin-top: 14px; }
.nav-head { display: block; padding: 4px 8px 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 6px; }
.nav-head:hover { color: var(--text); }
.nav-head.selected { color: var(--accent); }
.nav-row { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 15px; border: 0; background: none; width: 100%; font-family: inherit; }
.nav-row:hover { background: var(--hover); }
.nav-row.selected { background: var(--selected); font-weight: 600; }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { flex: none; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-settings { margin: 6px 10px 12px; width: auto; }
.nav-symbol { width: 20px; height: 20px; color: var(--muted); flex: none; }

/* A page's Services folder: its services' icons, small, nine to a folder, on frosted glass. */
.folder { --size: 20px; --mini: calc(var(--size) * 0.62 / 3); width: var(--size); height: var(--size); flex: none; display: grid; grid-template-columns: repeat(3, var(--mini)); grid-auto-rows: var(--mini); gap: calc(var(--size) * 0.06); padding: calc(var(--size) * 0.13); border-radius: calc(var(--size) * 0.225); background: rgba(128, 128, 128, 0.22); box-shadow: inset 0 0 0 0.5px rgba(128, 128, 128, 0.3); align-content: start; }
.folder > i { border-radius: calc(var(--mini) * 0.25); background: rgba(128, 128, 128, 0.18); }
.folder .app-icon { --size: var(--mini) !important; font-size: 0; }
/* On a page, icons are as big as its grid's cells leave room for. */
.grid .tile-icon > .app-icon, .grid .tile-icon > .folder { --size: var(--icon, 60px) !important; }

/* What's open: its bar, as a Mac window's toolbar, then the page, list or screen. */
.detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bar { flex: none; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 20px; }
.bar-titles { min-width: 0; }
.back { flex: none; width: 28px; height: 28px; margin-left: -6px; border: 0; border-radius: 7px; background: none; color: var(--text); font-size: 26px; line-height: 24px; cursor: pointer; }
.back:hover { background: var(--hover); }
.bar-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-subtitle { font-size: 11px; color: var(--muted); }
.bar-end { margin-left: auto; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* A page: its large title, then one grid, as the Home Screen's. */
.page, .settings { padding: 4px 20px 96px; max-width: 1100px; }
.settings { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-header { padding: 4px 4px 0; }
.page-header h1 { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.2; }
.page-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.page .page-header + .grid, .page .empty-page + .grid { margin-top: 20px; }
.page-header + .empty-page { margin-top: 20px; }
.grid { display: grid; grid-auto-rows: 82px; gap: 14px; grid-template-columns: repeat(4, 82px); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); min-width: 0; padding-top: 2px; }
.tile-icon { position: relative; display: block; line-height: 0; }
.tile-name { font-size: 11px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ff3b30; color: white; font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.widget { cursor: default; }
.widget.w-linked, a.tile { cursor: pointer; }
.empty-page { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px; border-radius: 12px; background: var(--w-card); text-align: center; }
.empty-page-title { font-weight: 600; font-size: 13px; }
.empty-page-text { color: var(--muted); font-size: 12px; }
.empty-page .button { margin-top: 6px; }

/* Services: a section per app with accounts, then the rest. */
.services-view { padding: 0 20px 48px; max-width: 900px; }
.services-view .list { margin-bottom: 24px; background: var(--w-card); }
.services-view .row, .sheet .row { font-size: 14px; padding: 9px 14px; }
.services-view .row .sub { font-size: 12px; }
.services-view .row .title { font-weight: 400; }
button.row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.row:disabled { opacity: 0.6; }
button.row.still { cursor: default; }
.service-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px; }
.service-title { flex: 1; font-size: 15px; font-weight: 700; }
.more { border: 1.5px solid var(--accent); color: var(--accent); background: none; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; line-height: 1; padding: 0; cursor: pointer; }
.status { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status.ok { background: #34c759; }
.status.off { background: #ff9f0a; }
.row.add { color: var(--accent); }
.plus, .new-item { width: 20px; text-align: center; font-size: 18px; font-weight: 300; color: var(--accent); flex: none; }
.row .check { color: var(--accent); font-weight: 600; }
.row.muted { color: var(--muted); gap: 8px; }
.warn-text { color: #ff9f0a; }
.none { padding: 12px 4px; }
.row .chev { font-size: 18px; }
.row.decline { color: var(--danger); }

/* A small menu, as a ⋯ button's. */
.menu { position: fixed; z-index: 60; min-width: 200px; padding: 5px; border-radius: 10px; background: var(--card); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), 0 0 0 0.5px var(--line); }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text); padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.menu-item:hover { background: var(--accent); color: white; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger); color: white; }

/* Sheets: the kit's, as wide as the Mac app's. */
.sheet { --sheet-bg: var(--window); font-size: 14px; }
.services-sheet { max-width: 460px; height: min(560px, 88vh); }
.services-sheet .services-view { padding: 0; }
.vault-sheet { max-width: 460px; }
.sheet .list { background: var(--w-card); margin-bottom: 12px; }
.sheet .footer { margin: -6px 14px 14px; font-size: 12px; }
.sheet-sub { color: var(--muted); font-size: 12px; text-align: center; margin: 0 0 14px; }
.sheet-text { margin: 4px 4px 16px; color: var(--muted); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fields .row { gap: 12px; }
.field-name { flex: none; width: 110px; color: var(--muted); }
.fields input { flex: 1; min-width: 0; font: inherit; border: 0; outline: none; background: none; color: var(--text); padding: 2px 0; }
.sheet .row .title { font-weight: 400; }
.sheet .vault-who .title { font-weight: 600; }
.vault-error { margin: 0 4px 12px; font-size: 13px; }

/* An app screen fills what's open, under its bar. */
.screen { flex: 1; position: relative; min-height: 0; }
.screen-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.screen-status { position: absolute; inset: 0; display: grid; place-items: center; }

/* Settings. */
.settings .list { background: var(--w-card); }
.profile .row { gap: 14px; padding: 16px; }
.avatar.big { width: 60px; height: 60px; font-size: 22px; }
.profile-name { font-size: 18px; font-weight: 600; }
.profile .sub { font-size: 12px; }
.settings .row { font-size: 14px; }
.setting-icon { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; color: white; background: var(--tile); flex: none; }

/* Before the window: signing in, starting, and a server that doesn't answer. */
.welcome, .unavailable, .starting { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px; text-align: center; }
.welcome h1 { font-size: 28px; font-weight: 600; margin: 10px 0 0; }
.welcome p { font-size: 15px; color: var(--muted); margin: 0 0 16px; max-width: 520px; }
.welcome-mark { width: 112px; height: 112px; border-radius: 25px; background: linear-gradient(color-mix(in srgb, var(--accent) 75%, white), var(--accent)); }
.button.big { font-size: 15px; padding: 9px 22px; }
.welcome-error { max-width: 440px; font-size: 13px; }
.unavailable-title { font-size: 17px; font-weight: 600; }
.unavailable-text { color: var(--muted); font-size: 13px; max-width: 440px; }

/* Narrow, the sidebar folds to its apps' icons, each where it was, as the Mac's does (⌘\). */
@media (max-width: 700px) {
  .window { grid-template-columns: 60px 1fr; }
  .nav-pages { padding: 10px 6px; }
  .nav-row { justify-content: center; padding: 0; }
  .nav-label, .nav-count { display: none; }
  .nav-head { font-size: 9px; text-align: center; padding: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-settings { margin: 6px 6px 12px; }
  .bar { padding: 0 14px; }
  .page, .services-view { padding-left: 14px; padding-right: 14px; }
}
