/* Shared by the general pane (taskpane.html), the sign-in dialogs and the launcher.
   Same look as the landing page at infinityvault.space (2026-11-26): navy bar, white cards,
   one blue accent, system font, light and dark. */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-border: #dde2ea;
  --ink: #14181f;
  --muted: #59627a;
  --accent: #2f5ee8;
  --accent-hover: #4a73f0;
  --accent-ink: #ffffff;
  --subtle: #edf0f5;
  --subtle-hover: #e2e7ef;
  --bar: #0d1424;
  --bar-ink: #eef2fb;
  --ok-bg: #e3f5ea;
  --ok-ink: #17663a;
  --off-bg: #e9edf3;
  --off-ink: #4a5468;
  --error: #b42318;
  --code-bg: #0f1522;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --panel: #121826;
    --panel-border: #253047;
    --ink: #e6eaf2;
    --muted: #a3acbd;
    --accent: #5f86ff;
    --accent-hover: #7a9bff;
    --accent-ink: #ffffff;
    --subtle: #1b2335;
    --subtle-hover: #232d44;
    --bar: #070a11;
    --ok-bg: #12321f;
    --ok-ink: #7fdca2;
    --off-bg: #1b2335;
    --off-ink: #a3acbd;
    --error: #ff8a80;
    --code-bg: #0a0e16;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--accent);
}

/* ---- Top bar ---------------------------------------------------------------------------- */
.topbar {
  background: var(--bar);
  color: var(--bar-ink);
}

.topbar-inner {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #c9d3ea;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.status-pill.connected {
  background: rgba(70, 200, 120, 0.16);
  color: #8be3ab;
}

/* ---- Layout ----------------------------------------------------------------------------- */
.shell,
.dialog-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.dialog-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.dialog-shell {
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 28px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  margin-bottom: 8px;
}

h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.lede {
  max-width: 64ch;
}

.lede,
.panel-header p,
.list-item span,
.list-item small,
.message,
#config-line {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
}

.panel + .panel,
.layout,
.layout + .panel,
.manual-token,
.search-row,
.preview {
  margin-top: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.layout > .panel {
  margin-top: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.panel-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- What shows when ---------------------------------------------------------------------
   Signed out, only the sign-in shows. In a plain browser the document actions (insert, open,
   save) are hidden: they need an Office document. */
body:not(.signed-in) [data-auth="in"],
body.browser [data-office-only],
[hidden] {
  display: none !important;
}

/* ---- Controls --------------------------------------------------------------------------- */
.button,
input,
textarea {
  border-radius: 8px;
  font: inherit;
}

.button {
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.3;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button.primary:not(:disabled):hover {
  background: var(--accent-hover);
}

.button.subtle {
  background: var(--subtle);
  color: var(--ink);
  border-color: var(--panel-border);
}

.button.subtle:not(:disabled):hover {
  background: var(--subtle-hover);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.list-item:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: var(--bg);
  padding: 10px 12px;
  color: var(--ink);
}

.manual-token {
  display: grid;
  gap: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* ---- Lists ------------------------------------------------------------------------------ */
.stack {
  display: grid;
  gap: 8px;
}

.empty-state {
  min-height: 96px;
  place-items: center;
  display: grid;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
}

.list-item {
  text-align: left;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  font: inherit;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-item strong {
  font-size: 15px;
}

.list-item span,
.list-item small {
  overflow-wrap: anywhere;
}

/* ---- Record preview --------------------------------------------------------------------- */
.preview {
  display: grid;
  gap: 12px;
}

.image-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--code-bg);
}

.code-block {
  margin: 0;
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 16px;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-block.small {
  min-height: 0;
  font: 12px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--muted);
}

.details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.message {
  min-height: 1.4em;
  margin-top: 12px;
}

.message:empty {
  margin-top: 0;
}

.message.error {
  color: var(--error);
}

.muted {
  color: var(--muted);
}

/* ---- Sign-in to a post-quantum vault (core-sign-in.js) ----------------------------------- */
.core-sign-in {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-width: 560px;
}

.core-sign-in p {
  margin: 0;
}

.core-sign-in label {
  font-weight: 600;
  margin-top: 4px;
}

.core-sign-in .note {
  color: var(--muted);
}

.core-sign-in .actions {
  margin-top: 4px;
}

.core-sign-in .match-code {
  font: 600 30px/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  padding: 10px 14px;
  background: var(--subtle);
  border-radius: 10px;
  justify-self: start;
}

.core-sign-in .links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.core-sign-in a,
.core-sign-in .link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Narrow: Office task panes and phones ------------------------------------------------ */
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .layout > .panel + .panel {
    margin-top: 0;
  }

  .panel-header {
    flex-direction: column;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .shell,
  .topbar-inner {
    width: calc(100vw - 24px);
  }

  .shell {
    padding-top: 18px;
  }

  .panel {
    padding: 16px;
  }
}
