/* Ratatoskr theme for the bird database: tokens, the Console and Aurora skins, dark mode
   and the shared components. Colours and shapes follow Ratatoskr's ratatoskr.css; a few
   tokens are added where its colours are too light for readable text (WCAG AA) and for
   FileMaker's meaningful colours (red flags, selected rows, find mode). */

/* Self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt), latin and latin-ext. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens: light (also used for printing) ---- */
:root {
  --rata-bg: #f6f8f7;
  --rata-surface: #fff;
  --rata-surface-2: #eef2f1;
  --rata-surface-3: #e6ecea;
  --rata-border: #e2e7e5;
  --rata-border-strong: #cbd4d1;
  --rata-text: #15201e;
  --rata-dim: #566663;
  --rata-faint: #8a9a97;
  --rata-orange: #e8772e;
  --rata-orange-strong: #cf6a1f;
  --rata-teal: #1f6f78;
  --rata-teal-strong: #175a62;
  --rata-rail: #163a3a;
  --rata-teal-tint: rgb(31 111 120 / 12%);
  --rata-orange-tint: rgb(232 119 46 / 14%);
  --rata-green: #3e8e5a;
  --rata-blue: #2a6fb0;
  --rata-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --rata-sans:
    "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Readable text variants of the brand colours and the main-action button. */
  --rata-placeholder: #687774;
  --rata-on-teal: #fff;
  --rata-accent: #b85614;
  --rata-accent-hover: #9c4810;
  --rata-on-accent: #fff;
  --rata-orange-text: #9a4a12;
  --rata-green-text: #2e6b43;
  --rata-green-tint: rgb(62 142 90 / 14%);
  /* FileMaker's meaningful colours. */
  --fm-red: #c81e0e;
  --fm-red-tint: rgb(200 30 14 / 10%);
  --fm-red-band: #ff8a7a;
  --fm-select: rgb(42 111 176 / 18%);
  --fm-find: #fff7d1;
  --fm-find-border: #b3a35a;
  /* The dark header band of the record layouts, in both modes. */
  --band-bg:
    radial-gradient(
      560px circle at 100% 0,
      rgb(232 119 46 / 16%),
      transparent 65%
    ),
    var(--rata-rail);
  --band-text: #e9f0ee;
  --band-dim: rgb(233 240 238 / 74%);
  --band-line: rgb(255 255 255 / 30%);
  --shadow-card: 0 3px 14px -7px rgb(20 45 42 / 20%);
  --shadow-pop: 0 30px 70px -20px rgb(0 0 0 / 55%);
  --shadow-paper: 0 2px 16px rgb(20 45 42 / 18%);
  --radius-control: 6px;
  --radius-button: 6px;
  --radius-card: 8px;
  --radius-dialog: 10px;
  color-scheme: light;
  font-family: var(--rata-sans);
  font-size: 14px;
  color: var(--rata-text);
  background: var(--rata-bg);
}
/* Dark mode applies to the screen only, so printing stays black on white. */
@media screen {
  :root[data-theme="dark"] {
    --rata-bg: #0e1615;
    --rata-surface: #15201f;
    --rata-surface-2: #1b2826;
    --rata-surface-3: #23332f;
    --rata-border: #27332f;
    --rata-border-strong: #3a524d;
    --rata-text: #e9f0ee;
    --rata-dim: #9db0ad;
    --rata-faint: #6c817e;
    --rata-orange: #f08a3e;
    --rata-orange-strong: #e8772e;
    --rata-teal: #43a6ae;
    --rata-teal-strong: #67c3ca;
    --rata-rail: #0f2a2a;
    --rata-teal-tint: rgb(67 166 174 / 16%);
    --rata-orange-tint: rgb(240 138 62 / 16%);
    --rata-green: #5fb07b;
    --rata-blue: #5b9bd6;
    --rata-placeholder: #849895;
    --rata-on-teal: #0e1615;
    --rata-accent: #f08a3e;
    --rata-accent-hover: #f5a263;
    --rata-on-accent: #0e1615;
    --rata-orange-text: #f39a55;
    --rata-green-text: #6cc08a;
    --rata-green-tint: rgb(95 176 123 / 16%);
    --fm-red: #ff7a6b;
    --fm-red-tint: rgb(255 122 107 / 14%);
    --fm-select: rgb(91 155 214 / 28%);
    --fm-find: rgb(240 200 80 / 13%);
    --fm-find-border: #8c7d3e;
    --shadow-card: 0 3px 14px -7px rgb(0 0 0 / 70%);
    --shadow-paper: 0 2px 18px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}
/* Aurora: Plus Jakarta Sans and rounder shapes; Console keeps the defaults above. */
:root[data-skin="aurora"] {
  --rata-sans:
    "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --radius-control: 10px;
  --radius-button: 11px;
  --radius-card: 14px;
  --radius-dialog: 18px;
}

/* ---- Base ---- */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--rata-bg);
  color: var(--rata-text);
  font-family: var(--rata-sans);
}
h1,
h2,
h3,
h4 {
  letter-spacing: -0.01em;
}
button {
  border: 1px solid var(--rata-border-strong);
  background: var(--rata-surface);
  color: var(--rata-dim);
  padding: 7px 13px;
  border-radius: var(--radius-button);
  font: 600 12px/1.15 var(--rata-sans);
  letter-spacing: 0.01em;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: var(--rata-surface-2);
  color: var(--rata-text);
}
button:disabled {
  cursor: default;
  color: var(--rata-faint);
  background: var(--rata-surface-2);
  border-color: var(--rata-border);
}
button:focus-visible {
  outline: 2px solid var(--rata-teal);
  outline-offset: 2px;
}
button.primary {
  background: var(--rata-accent);
  border-color: var(--rata-accent);
  color: var(--rata-on-accent);
}
button.primary:hover:not(:disabled) {
  background: var(--rata-accent-hover);
  border-color: var(--rata-accent-hover);
  color: var(--rata-on-accent);
}
[data-skin="aurora"] button.primary:not(:disabled) {
  box-shadow: 0 8px 18px -9px var(--rata-orange);
}
/* Ratatoskr's form control; layouts override it where FileMaker shows frameless fields. */
:where(
  input:not([type="checkbox"], [type="radio"], [type="hidden"]),
  select,
  textarea
) {
  background: var(--rata-surface);
  border: 1px solid var(--rata-border-strong);
  border-radius: var(--radius-control);
  color: var(--rata-text);
  font: 500 13px/1.3 var(--rata-sans);
  padding: 5px 8px;
}
:where(input, select, textarea):focus {
  outline: none;
  border-color: var(--rata-teal);
  box-shadow: 0 0 0 3px var(--rata-teal-tint);
}
:where(input, textarea)::placeholder {
  color: var(--rata-placeholder);
  opacity: 1;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rata-teal);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--rata-teal);
  outline-offset: 2px;
}

/* ---- Test system banner (BIRD_MIRROR=1) ---- */
.mirror-banner {
  margin: 0;
  padding: 8px 18px;
  background: var(--rata-orange-tint);
  border-bottom: 1px solid var(--rata-orange);
  color: var(--rata-orange-text);
  font: 600 12.5px/1.4 var(--rata-sans);
  text-align: center;
}

/* ---- Top bar ---- */
.rata-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  background: var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
}
.rata-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rata-topbar-logo {
  height: 30px;
  width: auto;
  border-radius: 7px;
  display: block;
}
[data-skin="aurora"] .rata-topbar-logo {
  border-radius: 9px;
}
.rata-brand .name {
  font: 700 15px/1 var(--rata-sans);
  color: var(--rata-text);
}
.rata-brand .sep {
  color: var(--rata-faint);
}
.rata-brand .crumb {
  font: 500 13px/1 var(--rata-sans);
  color: var(--rata-dim);
  white-space: nowrap;
}
.rata-topbar .meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.rata-tag {
  font: 500 11px/1 var(--rata-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rata-dim);
  white-space: nowrap;
}
#account-name {
  font: 600 12.5px/1.2 var(--rata-sans);
  color: var(--rata-text);
}
#switch-person {
  padding: 6px 11px;
}
.rata-skinswitch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--rata-surface-2);
}
.rata-skinswitch button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 7px;
  font: 600 11px/1.1 var(--rata-sans);
  color: var(--rata-dim);
}
.rata-skinswitch button:hover:not(:disabled) {
  background: transparent;
  color: var(--rata-text);
}
.rata-skinswitch button.active,
.rata-skinswitch button.active:hover {
  background: var(--rata-surface);
  color: var(--rata-teal-strong);
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* ---- Shell and layout navigation ----
   Console: a dark 76px rail at the left, icon over a small mono label; the rail colour
   runs down the whole shell and the entries stay in view while the page scrolls.
   Aurora: a light horizontal pill bar under the top bar. */
.rata-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: calc(100vh - 54px);
  background: linear-gradient(
    90deg,
    var(--rata-rail) 76px,
    var(--rata-bg) 76px
  );
}
.rata-nav {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
}
.rata-nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 10px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(255 255 255 / 64%);
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.rata-nav button:hover:not(:disabled) {
  background: rgb(255 255 255 / 6%);
  color: rgb(255 255 255 / 90%);
}
.rata-nav button:disabled {
  background: transparent;
  color: rgb(255 255 255 / 28%);
}
.rata-nav button.active,
.rata-nav button.active:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}
.rata-nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--rata-orange);
}
.rata-nav button:focus-visible {
  outline-offset: -3px;
  outline-color: var(--rata-orange);
}
.rata-ico svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rata-nav button.active .rata-ico {
  color: var(--rata-orange);
}
.rata-lab {
  font: 600 8px/1.2 var(--rata-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}
[data-skin="aurora"] .rata-shell {
  display: block;
  background: var(--rata-bg);
}
[data-skin="aurora"] .rata-nav {
  position: static;
  max-height: none;
  overflow: visible;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
}
[data-skin="aurora"] .rata-nav button {
  flex-direction: row;
  gap: 7px;
  width: auto;
  padding: 8px 13px;
  border-radius: 11px;
  color: var(--rata-dim);
}
[data-skin="aurora"] .rata-nav button:hover:not(:disabled) {
  background: var(--rata-surface-2);
  color: var(--rata-text);
}
[data-skin="aurora"] .rata-nav button:disabled {
  color: var(--rata-faint);
}
[data-skin="aurora"] .rata-nav button.active,
[data-skin="aurora"] .rata-nav button.active:hover {
  background: var(--rata-teal-tint);
  color: var(--rata-teal-strong);
}
[data-skin="aurora"] .rata-nav button.active::before {
  display: none;
}
[data-skin="aurora"] .rata-nav button.active .rata-ico {
  color: var(--rata-teal-strong);
}
[data-skin="aurora"] .rata-nav button:focus-visible {
  outline-offset: 1px;
  outline-color: var(--rata-teal);
}
[data-skin="aurora"] .rata-ico svg {
  width: 15px;
  height: 15px;
}
[data-skin="aurora"] .rata-lab {
  font: 600 12.5px/1 var(--rata-sans);
  letter-spacing: 0;
  text-transform: none;
}
/* The compact menu replaces the navigation on phones. */
.layout-compact {
  display: none;
}
.rata-main {
  min-width: 0;
  padding-bottom: 24px;
}
[data-skin="aurora"] .rata-main {
  max-width: 1340px;
  margin-inline: auto;
  padding: 14px 16px 28px;
}

/* ---- Toolbar and find bar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 18px;
  background: var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
}
.toolbar button {
  padding: 7px 11px;
}
.record-navigation,
.request-navigation {
  display: flex;
  align-items: center;
  gap: 4px;
}
.record-navigation button,
.request-navigation button {
  font-size: 18px;
  line-height: 1;
  padding: 2px 9px 4px;
}
#record-count,
#request-count {
  margin-inline: 6px 10px;
  font: 500 11.5px/1.2 var(--rata-mono);
  color: var(--rata-dim);
}
.search {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  font: 600 10px/1 var(--rata-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rata-dim);
}
.search input {
  width: 190px;
  letter-spacing: 0;
  text-transform: none;
}
.find-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 18px;
  background:
    linear-gradient(var(--rata-teal-tint), var(--rata-teal-tint)),
    var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
  font-size: 12.5px;
}
.find-bar[hidden] {
  display: none;
}
.find-bar > strong {
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--rata-surface);
  color: var(--rata-teal-strong);
  font: 600 10px/1 var(--rata-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.find-bar label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--rata-dim);
  font-weight: 600;
}
.find-bar button {
  padding: 6px 10px;
}
.find-bar select {
  padding: 4px 6px;
}
[data-skin="aurora"] :is(.toolbar, .find-bar, .sync-bar) {
  border: 1px solid var(--rata-border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 9px 14px;
}
[data-skin="aurora"] .find-bar {
  margin-top: 10px;
}
/* Find mode marks every field that takes criteria, as FileMaker's magnifier badge does. */
#workspace.finding :is(input, textarea)[data-find]:not([type="checkbox"]) {
  background: var(--fm-find)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.5' fill='none' stroke='%237d8a90' stroke-width='2'/%3E%3Cpath d='M10 10l4.5 4.5' stroke='%237d8a90' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 5px center / 11px;
  border: 1px solid var(--fm-find-border);
  color: var(--rata-text);
  padding-right: 20px;
  min-width: 3em;
}
#workspace.finding .find-row td {
  padding: 4px;
}
#workspace.finding .find-row input {
  width: 100%;
}
.find-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Workspace ---- */
#workspace {
  background: var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
}
[data-skin="aurora"] #workspace {
  margin-top: 14px;
  border: 1px solid var(--rata-border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.muted {
  color: var(--rata-dim);
}
.empty {
  padding: 40px 24px;
  color: var(--rata-dim);
  text-align: center;
}

/* The dark header band of Bird Library and Data entry (FileMaker's dark header). */
.bird-header {
  background: var(--band-bg);
  color: var(--band-text);
  padding: 24px 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  min-height: 155px;
}
.bird-header h1 {
  font-size: 23px;
  font-weight: 500;
  margin: 0 0 14px;
}
.bird-header h1 strong {
  margin-left: 15px;
}
.bird-header > div > div {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 5px;
  margin-bottom: 7px;
  line-height: 1.25;
}
.bird-header strong {
  font-weight: normal;
  overflow-wrap: anywhere;
}
.bird-header :is(span, label) {
  color: var(--band-dim);
}
.status-strip {
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-card);
  background: var(--rata-surface-2);
  margin: 18px 24px 12px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--rata-dim);
  font-size: 13px;
}
.status-strip > strong {
  color: var(--rata-text);
}

/* Bird Library tabs: a flat underline in Console, Ratatoskr pills in Aurora. */
.tabs {
  display: flex;
  gap: 2px;
  margin: 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--rata-border);
}
.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  padding: 9px 12px 8px;
  background: transparent;
  color: var(--rata-dim);
  white-space: nowrap;
}
.tabs button:hover:not(:disabled) {
  background: transparent;
  color: var(--rata-text);
}
.tabs button.active {
  color: var(--rata-text);
  border-bottom-color: var(--rata-orange);
}
.tabs button:disabled {
  background: transparent;
  opacity: 0.72;
}
[data-skin="aurora"] .tabs {
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 0;
}
[data-skin="aurora"] .tabs button {
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 11px;
}
[data-skin="aurora"] .tabs button:hover:not(:disabled) {
  background: var(--rata-surface-2);
}
[data-skin="aurora"] .tabs button.active {
  background: var(--rata-teal-tint);
  color: var(--rata-teal-strong);
}
.history-table {
  margin: 0 24px;
  min-height: 340px;
  border: 1px solid var(--rata-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  overflow: hidden;
}
[data-skin="aurora"] .history-table {
  border-top: 1px solid var(--rata-border);
  border-radius: var(--radius-card);
}
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--rata-dim);
}
.table-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.table-scroll {
  overflow: auto;
  max-height: 430px;
}

/* ---- Tables: Ratatoskr's mono uppercase headings, subtle zebra and teal hover ---- */
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12.5px;
}
th {
  font: 600 10px/1.25 var(--rata-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--rata-dim);
  white-space: nowrap;
}
thead th {
  background: var(--rata-surface);
}
/* Row headings (the field names of the change history) keep their case. */
tbody th {
  font: 600 12.5px/1.3 var(--rata-sans);
  letter-spacing: 0;
  text-transform: none;
}
th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rata-border);
  vertical-align: top;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:nth-child(odd) {
  background: var(--rata-surface-2);
}
tbody tr:nth-child(even) {
  background: transparent;
}
tbody tr:hover {
  background: var(--rata-teal-tint);
}
td {
  white-space: nowrap;
}
.note-cell {
  white-space: pre-wrap;
  min-width: 150px;
  max-width: 300px;
  overflow-wrap: anywhere;
}
.row-actions {
  white-space: nowrap;
}
.row-actions button {
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--rata-teal-strong);
  font-size: 12px;
}
.row-actions button:hover:not(:disabled) {
  background: var(--rata-teal-tint);
  color: var(--rata-teal-strong);
}
.row-actions button:first-child {
  font-size: 18px;
}
.row-actions .delete-action,
.row-actions .delete-action:hover:not(:disabled) {
  color: var(--fm-red);
}
.deleted td {
  color: var(--rata-dim);
}
.library-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 24px 24px;
  font-size: 12px;
  color: var(--rata-dim);
}

/* ---- Sync bar, notices and rejected changes ---- */
.sync-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--rata-surface);
  border-bottom: 1px solid var(--rata-border);
}
[data-skin="aurora"] .sync-bar {
  margin-top: 14px;
}
#sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--rata-surface-2);
  color: var(--rata-dim);
  font: 600 11.5px/1.25 var(--rata-mono);
}
#sync-status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
#sync-status.synced {
  background: var(--rata-green-tint);
  color: var(--rata-green-text);
}
#sync-status.pending {
  background: var(--rata-orange-tint);
  color: var(--rata-orange-text);
}
#storage-status {
  margin-right: auto;
  font: 500 11px/1.2 var(--rata-mono);
  color: var(--rata-dim);
}
#offline-button.active {
  background: var(--rata-orange-tint);
  border-color: var(--rata-orange);
  color: var(--rata-orange-text);
}
#sync-button {
  background: var(--rata-teal);
  border-color: var(--rata-teal);
  color: var(--rata-on-teal);
}
#sync-button:hover:not(:disabled) {
  background: var(--rata-teal-strong);
  border-color: var(--rata-teal-strong);
  color: var(--rata-on-teal);
}
#sync-button:disabled {
  background: var(--rata-surface-2);
  border-color: var(--rata-border);
  color: var(--rata-faint);
}
#notice {
  margin: 0;
  padding: 11px 18px;
  background: var(--rata-orange-tint);
  border-left: 3px solid var(--rata-orange);
  color: var(--rata-text);
  font-size: 13px;
}
#rejected-changes {
  margin: 0;
  padding: 6px 18px;
  list-style: none;
  background: var(--fm-red-tint);
  border-left: 3px solid var(--fm-red);
  color: var(--rata-text);
  font-size: 13px;
}
[data-skin="aurora"] :is(#notice, #rejected-changes) {
  margin-top: 12px;
  border-radius: 12px;
}
#rejected-changes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
#rejected-changes span {
  flex: 1;
}

/* ---- Forms and FileMaker field groups as cards ---- */
.form-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin: 22px 30px;
}
.form-title h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.form-title span {
  color: var(--rata-dim);
  font-size: 12px;
}
.entry-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 24px;
  margin: 0 30px;
  align-items: start;
}
fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 12px 12px 6px;
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-card);
  background: var(--rata-surface);
}
legend {
  padding: 0 6px;
  font: 600 10px/1 var(--rata-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rata-dim);
}
.form-row {
  display: grid;
  grid-template-columns: 95px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--rata-dim);
  font-size: 12.5px;
}
.form-row input {
  width: 100%;
  min-width: 0;
}
textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  line-height: 1.5;
}
.notes-field > label {
  display: none;
}
.notes-field textarea {
  min-height: 260px;
}
.field-help {
  font-size: 11px;
  line-height: 1.5;
  color: var(--rata-dim);
  margin-bottom: 0;
}
.form-actions {
  margin: 4px 30px 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#form-error {
  color: var(--fm-red);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---- Dialogs ---- */
dialog {
  width: 520px;
  max-width: min(520px, calc(100vw - 30px));
  padding: 26px;
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-dialog);
  background: var(--rata-surface);
  color: var(--rata-text);
  box-shadow: var(--shadow-pop);
}
dialog::backdrop {
  background: rgb(14 22 21 / 55%);
}
dialog h1 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 0;
}
dialog p {
  font-size: 13px;
  line-height: 1.6;
}
/* The account chooser and the portal's sign-in page are Ratatoskr's login: a dark splash
   with a subtle grid and the brand glows, and a centred card. */
#account-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#account-dialog,
.rata-splash {
  background-color: var(--rata-rail);
  background-image:
    radial-gradient(
      420px circle at 86% 10%,
      rgb(232 119 46 / 22%),
      transparent 70%
    ),
    radial-gradient(
      480px circle at 10% 90%,
      rgb(67 166 174 / 18%),
      transparent 70%
    ),
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    100% 124px,
    177px 100%;
}
#account-dialog::backdrop {
  background: var(--rata-rail);
}
.rata-auth-card {
  width: min(384px, calc(100% - 24px));
  margin: 7vh auto 32px;
  padding: 30px 30px 26px;
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-dialog);
  background: var(--rata-surface);
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.rata-auth-logo {
  display: block;
  height: 54px;
  width: auto;
  margin: 0 auto 14px;
  border-radius: 10px;
}
[data-skin="aurora"] .rata-auth-logo {
  border-radius: 14px;
}
.rata-auth-title {
  font: 700 20px/1 var(--rata-sans);
  letter-spacing: 0.06em;
  color: var(--rata-text);
}
.rata-auth-sub {
  margin: 7px 0 18px;
  font: 500 10px/1.4 var(--rata-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rata-dim);
}
.rata-auth-card h1 {
  margin: 22px 0 6px;
  font: 600 10px/1 var(--rata-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rata-dim);
  text-align: left;
}
.rata-auth-card p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--rata-dim);
  text-align: left;
}
#account-message:empty {
  display: none;
}
#account-options {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
#account-options button {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  text-align: left;
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-control);
  background: var(--rata-surface-2);
  color: var(--rata-text);
  font: 600 13px/1.2 var(--rata-sans);
}
#account-options button:hover:not(:disabled) {
  border-color: var(--rata-teal);
  background: var(--rata-teal-tint);
  color: var(--rata-text);
}
#account-options button:disabled {
  color: var(--rata-faint);
}
#account-options span {
  color: var(--rata-dim);
  font: 500 10.5px/1.3 var(--rata-mono);
  letter-spacing: 0.03em;
}
#cancel-account {
  width: 100%;
  padding: 10px 0;
}
.history-dialog {
  width: 900px;
  max-width: calc(100vw - 30px);
  max-height: 85vh;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.history-note {
  font-weight: 700;
}
.audit-entry {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--rata-border);
  border-radius: var(--radius-card);
  background: var(--rata-surface);
}
.audit-entry h2 {
  font-size: 14.5px;
  margin: 0;
}
.audit-entry h2 span {
  font-weight: 500;
  margin-left: 12px;
  text-transform: capitalize;
  color: var(--rata-dim);
}
.audit-outcome {
  font-weight: 700;
}
.audit-times {
  color: var(--rata-dim);
  font: 500 11px/1.5 var(--rata-mono);
}
.audit-entry table {
  table-layout: fixed;
}
.audit-entry th,
.audit-entry td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Narrower screens ---- */
@media (max-width: 1000px) {
  .rata-tag {
    display: none;
  }
}
@media (max-width: 850px) {
  .bird-header {
    padding: 20px 22px;
    gap: 16px;
    grid-template-columns: 1.4fr 1fr;
  }
  .bird-header > div:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }
  .entry-columns {
    gap: 16px;
    margin-inline: 20px;
    grid-template-columns: 1fr 1fr;
  }
  .notes-field {
    grid-column: 1 / -1;
  }
  .notes-field textarea {
    min-height: 150px;
  }
  .search {
    margin-left: 0;
  }
}
/* Phones: the compact layout menu replaces the navigation in both skins. */
@media (max-width: 700px) {
  /* Two rows: brand and dark-mode toggle, then the person and the skin switch. */
  .rata-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .rata-topbar .meta {
    display: contents;
  }
  .rata-brand {
    order: -2;
    flex: 1 0 calc(100% - 48px);
  }
  .theme-toggle {
    order: -1;
  }
  #account-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rata-shell,
  [data-skin="aurora"] .rata-shell {
    display: block;
    background: var(--rata-bg);
  }
  .rata-nav,
  [data-skin="aurora"] .rata-nav {
    display: none;
  }
  .layout-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--rata-surface);
    border-bottom: 1px solid var(--rata-border);
    font: 600 10px/1 var(--rata-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rata-dim);
  }
  .layout-compact select {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    letter-spacing: 0;
    text-transform: none;
  }
  [data-skin="aurora"] .rata-main {
    padding: 10px 8px 20px;
  }
  [data-skin="aurora"] .layout-compact {
    margin-bottom: 10px;
    border: 1px solid var(--rata-border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
  }
}
@media (max-width: 550px) {
  .toolbar {
    padding: 10px 12px;
    gap: 6px;
  }
  .toolbar button {
    padding: 6px 8px;
  }
  #record-count {
    margin-right: 0;
  }
  .find-bar {
    padding: 8px 12px;
    gap: 6px 8px;
  }
  .search {
    width: 100%;
  }
  .search input {
    flex: 1;
    font-size: 16px;
  }
  .bird-header {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .bird-header > div:last-child {
    display: block;
  }
  .bird-header h1 {
    font-size: 22px;
  }
  .bird-header > div > div {
    margin-bottom: 6px;
  }
  .status-strip {
    margin: 12px;
    gap: 8px 16px;
    font-size: 12px;
  }
  .tabs {
    margin-inline: 12px;
  }
  .history-table {
    margin-inline: 12px;
    min-height: 260px;
  }
  .library-footer {
    padding: 15px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sync-bar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .entry-columns {
    grid-template-columns: 1fr;
    margin-inline: 14px;
    gap: 0;
  }
  .notes-field {
    grid-column: auto;
  }
  .form-title {
    margin: 18px;
    display: block;
  }
  .form-title h2 {
    margin-bottom: 8px;
  }
  .form-row {
    grid-template-columns: 110px 1fr;
  }
  .form-row input {
    font-size: 16px;
  }
  .form-actions {
    margin-inline: 14px;
  }
  .audit-entry {
    padding: 10px;
  }
}

/* ---- Print: no rail space, cards or shadows; the printable layouts hide the chrome ---- */
@media print {
  html,
  body {
    background: #fff;
    color: #000;
  }
  .mirror-banner {
    display: none;
  }
  .rata-shell,
  [data-skin="aurora"] .rata-shell {
    display: block;
    min-height: 0;
    background: none;
  }
  .rata-main,
  [data-skin="aurora"] .rata-main {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  #workspace,
  [data-skin="aurora"] #workspace {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    overflow: visible;
  }
}
