/* Reckon shared shell: header (+ phone menu) (shell.js).
   Tokens from app.css only (--ink, --paper, --accent, --border, --sans ...).
   No hard-coded colours, so a later visual pass is a token change. */

.rk-shell {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 4px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}
.rk-brand {
  font-family: var(--font); font-weight: 750; font-stretch: 90%; font-size: 19px; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
}
.rk-mark { width: 26px; height: 26px; flex: none; }
.rk-nav { display: none; align-items: center; gap: 4px; margin-left: 8px; }
.rk-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px;
  font: 600 14px/1 var(--sans); color: var(--ink-2); text-decoration: none;
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
}
.rk-link:hover { color: var(--ink); }
.rk-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.rk-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rk-chip {
  display: none; font: 600 12px/1 var(--sans); color: var(--ink-2); border: 1px solid var(--border);
  padding: 6px 10px; background: var(--surface-2); white-space: nowrap;
}
.rk-signin {
  min-height: 44px; padding: 0 16px; font: 700 14px/1 var(--sans);
  background: var(--brand); color: var(--brand-fg); border: 1px solid var(--brand); cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
}
.rk-signin:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.rk-signin-note { display: none; font-size: 12px; color: var(--ink-3); max-width: 220px; line-height: 1.3; }
.rk-acct-btn {
  min-height: 44px; max-width: 150px; padding: 0 12px; font: 600 13px/1 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.rk-panel {
  position: fixed; z-index: 60; right: 12px; top: 56px; width: min(320px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); padding: 14px;
  font-family: var(--sans); box-shadow: var(--sh-lg);
}
.rk-panel[hidden] { display: none; }
.rk-panel p { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.rk-panel .rk-panel-email { font-weight: 700; color: var(--ink); }
.rk-panel a, .rk-panel button {
  display: flex; align-items: center; min-height: 44px; width: 100%; box-sizing: border-box; padding: 0 4px;
  font: 600 14px/1 var(--sans); color: var(--ink); background: none; border: 0; text-align: left;
  text-decoration: none; cursor: pointer; border-top: 1px solid var(--border);
}

/* Phone menu: opened by the header's Menu button; hidden from 720px up. */
.rk-menu-btn {
  min-height: 44px; padding: 0 14px; font: 600 14px/1 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.rk-menu {
  position: fixed; z-index: 60; left: 12px; right: 12px; top: 56px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-lg); font-family: var(--sans);
}
.rk-menu[hidden] { display: none; }
.rk-menu-link {
  display: flex; align-items: center; min-height: 48px; padding: 0 16px; box-sizing: border-box; width: 100%;
  font: 600 15px/1 var(--sans); color: var(--ink); background: none; border: 0; text-align: left;
  text-decoration: none; cursor: pointer; border-top: 1px solid var(--border);
}
.rk-menu-link:first-child { border-top: 0; }
.rk-menu-link[aria-current="page"] { color: var(--brand); }

.rk-shell :focus-visible, .rk-menu :focus-visible, .rk-menu-btn:focus-visible, .rk-panel :focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}

@media (min-width: 720px) {
  .rk-nav { display: flex; }
  .rk-chip { display: inline-block; }
  .rk-signin-note { display: block; }
  .rk-menu, .rk-menu-btn { display: none !important; }
  .rk-shell { padding: 4px 24px; }
}

/* The report app keeps its own account menu (checkout, delete) but the shell
   owns the Sign in button, so the old one is hidden to avoid two of them. */
body.has-rk-shell #auth_btn { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .rk-shell *, .rk-menu * { transition: none !important; }
}
