/* Quiet Director Colour System & Core Layout for WARH + MARH */
:root {
  --ground: #FFFFFF;
  --ink: #1D2B3A;
  --sky: #8ED1E9;
  --leaf: #CAF296;
  --deep-sky: #1F7FA3;
  --deep-leaf: #5E8F24;
  --muted: #536471;
  --line: #E2E8F0;
  --soft-sky: #F0F9FD;
  --soft-leaf: #F4FDF0;
  --urgent-bg: #FFF5F5;
  --urgent-border: #E53E3E;
  --urgent-ink: #9B2C2C;
  --font-sans: 'Plus Jakarta Sans', 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Spectral', Georgia, Cambria, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  transition: all 0.18s ease-in-out;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--deep-sky);
  outline-offset: 3px;
}

/* Header & Brand Identity (Option 1A Emblem + Mirrored 'a' Wordmark) */
header {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(29, 43, 58, 0.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-wordmark {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
}

.flipped-a {
  display: inline-block;
  transform: scaleX(-1);
  margin-right: 1px;
}

.normal-part {
  border-bottom: 2.5px solid var(--deep-leaf);
  padding-bottom: 1px;
}

.y-part {
  margin-left: 1px;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-center-label {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

#account-header {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Primary & Secondary Buttons */
.primary {
  background: var(--ink);
  color: #FFFFFF;
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary:hover:not(:disabled) {
  background: #2C3E50;
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary {
  background: var(--soft-sky);
  color: var(--deep-sky);
  border: 1px solid rgba(142, 209, 233, 0.5);
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 22px;
  font-weight: 600;
}

.secondary:hover {
  background: #E1F3FA;
}

.plain {
  border: 0;
  background: transparent;
  color: var(--deep-sky);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
}

.plain:hover {
  text-decoration: underline;
}

/* Two-Beat Headlines */
h1 {
  font-family: var(--font-sans);
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 12px 0 16px;
  color: var(--ink);
  font-weight: 700;
}

h1 em, h2 em, .two-beat em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--deep-sky);
}

h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 10px 0;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  margin: 8px 0;
  font-weight: 650;
}

.eyebrow {
  text-transform: uppercase;
  color: var(--deep-leaf);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.sub {
  color: var(--muted);
  max-width: 600px;
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* App Main Container */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px;
  min-height: calc(100vh - 200px);
}

/* Cards & Surfaces */
.card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(29, 43, 58, 0.04);
}

/* Navigation */
#app-nav {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

#app-nav button {
  border: 0;
  background: transparent;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 550;
}

#app-nav button.active {
  background: var(--soft-sky);
  color: var(--deep-sky);
  font-weight: 650;
}

/* Modals */
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 620px;
  width: calc(100% - 32px);
  padding: 32px;
  color: var(--ink);
  background: #FFFFFF;
  box-shadow: 0 20px 60px rgba(29, 43, 58, 0.2);
}

dialog::backdrop {
  background: rgba(29, 43, 58, 0.6);
  backdrop-filter: blur(2px);
}

#close-modal {
  margin-top: 20px;
  width: 100%;
}

/* Save Status Floating Pill */
#save-status {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#save-status:empty {
  display: none;
}

/* Footer */
footer {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 14px 18px;
  }
  .header-center-label {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px;
  }
}
