@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Oswald:wght@500;600&display=swap");

:root {
  --bg: #f1ede2;
  --panel: #fffdf8;
  --panel-strong: #fffaf0;
  --text: #171512;
  --muted: #4f473e;
  --line: #c9c0b1;
  --brand: #005a4f;
  --brand-strong: #00463e;
  --accent: #b34700;
  --danger: #b0281a;
  --ok: #0b6a3a;
  --radius: 18px;
  --shadow: 0 16px 38px rgba(36, 27, 10, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Atkinson Hyperlegible", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, #fdf7e5 0%, transparent 46%),
    radial-gradient(circle at 95% 18%, #ffe8d2 0%, transparent 42%),
    var(--bg);
  line-height: 1.45;
}

.site-dev-notice {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 18, 16, 0.72);
  transition: opacity 180ms ease;
}

.site-dev-notice.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.site-dev-notice-card {
  width: min(700px, 96vw);
  border-radius: 16px;
  border: 2px solid #d7cbb9;
  background: #fffdf8;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  padding: 1rem 1.1rem;
}

.site-dev-notice-card h2 {
  margin-bottom: 0.4rem;
}

.site-dev-notice-card p {
  margin: 0.35rem 0;
}

body.theme-dark .site-dev-notice {
  background: rgba(2, 6, 5, 0.78);
}

body.theme-dark .site-dev-notice-card {
  background: #1c2926;
  border-color: #6f857f;
  color: #f6f5ef;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  opacity: 0.26;
  filter: blur(28px);
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #f2c58f;
  top: -40px;
  right: -80px;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: #98d7bf;
  bottom: 15%;
  left: -80px;
}

.shell {
  width: min(1100px, 95vw);
  margin: 0 auto;
  padding: 1rem 0 1.3rem;
}

.brand-block {
  background: linear-gradient(138deg, #fffefb 0%, #f8f0e2 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.85rem;
  animation: rise 260ms ease-out both;
}

.brand-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  align-items: start;
}

.brand-headliner {
  width: min(100%, 420px);
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.inline-definition-group p {
  margin-bottom: 0;
}

.term-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0.1rem;
  font: inherit;
  font-weight: 700;
  color: var(--brand-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16rem;
  cursor: pointer;
}

.term-btn:hover,
.term-btn:focus-visible {
  color: var(--brand);
  outline: none;
}

.term-btn.is-open {
  color: var(--accent);
}

.inline-definitions {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.inline-definition {
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  padding: 0 0.75rem;
  border-left: 4px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  transition:
    max-height 220ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    padding 220ms ease,
    border-color 220ms ease;
}

.inline-definition.is-open {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  padding: 0.5rem 0.75rem;
  border-color: #2f6c63;
}

.brand-tool-row {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 0.5rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: "Oswald", "Trebuchet MS", sans-serif;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0.3rem 0 0.45rem;
  font-size: clamp(1.5rem, 2.7vw, 2rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

h3 {
  margin: 0;
  font-size: 1.17rem;
}

p {
  margin: 0.4rem 0;
}

.helper {
  color: var(--muted);
  font-size: 0.96rem;
}

.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.tab-btn {
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 16px;
  font-size: 1.03rem;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
}

.tab-btn.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: rise 240ms ease-out both;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-bottom: 0.95rem;
}

.shadow-panel {
  border: 2px solid var(--brand);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f4eb 100%);
}

.shadow-top {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1.7fr 2fr;
  align-items: center;
}

.shadow-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
}

.shadow-log {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.42rem;
}

.shadow-log-item {
  border: 1px solid #cdbfa9;
  border-radius: 10px;
  background: #fff;
  padding: 0.46rem 0.56rem;
  font-size: 0.91rem;
}

.shadow-log-item strong {
  display: inline-block;
  margin-right: 0.25rem;
}

.warning-panel {
  border: 2px solid var(--danger);
  background: #fff4ef;
}

.sage-export-panel {
  margin: 0.8rem 0 1rem;
  padding: 0.9rem;
  border: 2px solid #d0c4b3;
  background: #fffcf5;
  box-shadow: none;
}

.sage-quality-report {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.sage-mapping {
  margin: 0.6rem 0;
  padding: 0.55rem;
  border: 1px solid #d8ccb8;
  border-radius: 10px;
  background: #fff;
}

.quality-summary {
  border: 1px solid #cfbea6;
  border-radius: 10px;
  background: #fff;
  padding: 0.5rem 0.6rem;
  font-size: 0.93rem;
}

.quality-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.quality-item {
  border-radius: 10px;
  padding: 0.42rem 0.58rem;
  border: 1px solid #cfbea6;
  background: #fff;
  font-size: 0.9rem;
}

.quality-item.error {
  border-color: #b0281a;
  background: #fff1ee;
}

.quality-item.warning {
  border-color: #8a5a00;
  background: #fff8e8;
}

.stack > * + * {
  margin-top: 1rem;
}

.field-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.choice-btn {
  min-height: 64px;
  border-radius: 16px;
  border: 2px solid #595043;
  background: #fff;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 130ms ease;
}

.choice-btn.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

textarea,
input,
select {
  width: 100%;
  min-height: 54px;
  border: 2px solid #666050;
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 1.04rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
}

.primary-btn,
.secondary-btn {
  min-height: 64px;
  border-radius: 16px;
  border: 2px solid var(--brand);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
}

.primary-btn:hover {
  background: var(--brand-strong);
}

.secondary-btn {
  color: var(--brand-strong);
  background: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.stat-card {
  background: var(--panel-strong);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
}

.stat-card strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.1;
}

.stat-card span {
  font-size: 0.94rem;
  color: var(--muted);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0 1rem;
}

.filter-row label {
  font-size: 0.94rem;
  color: var(--muted);
}

.card-list {
  display: grid;
  gap: 0.72rem;
}

.item-card {
  border: 2px solid #cec4b6;
  border-radius: 14px;
  background: #fff;
  padding: 0.85rem;
  animation: rise 220ms ease-out both;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin: 0.45rem 0;
}

.tag {
  border-radius: 999px;
  border: 1px solid #7a7266;
  padding: 0.19rem 0.62rem;
  font-size: 0.86rem;
  font-weight: 700;
  background: #fff;
}

.tag.status-urgent {
  background: #ffebea;
  border-color: #8c1e12;
  color: #8c1e12;
}

.tag.status-termine {
  background: #ecf9f2;
  border-color: #0d6b3b;
  color: #0d6b3b;
}

.card-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.card-controls label {
  font-size: 0.86rem;
  color: var(--muted);
}

.quick-link {
  color: var(--brand-strong);
  font-weight: 700;
}

.dispatch-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.dispatch-col {
  border: 2px solid #d4cab7;
  border-radius: 16px;
  background: #fffaf1;
  padding: 0.75rem;
  min-height: 420px;
}

.dispatch-col h3 {
  margin-bottom: 0.6rem;
}

.dispatch-card {
  border: 2px solid #cdbfa9;
  background: #fff;
  border-radius: 12px;
  padding: 0.6rem;
  margin-bottom: 0.55rem;
}

.dispatch-card p {
  margin: 0.3rem 0;
}

.dispatch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.mini-btn {
  min-height: 42px;
  border-radius: 12px;
  border: 2px solid #6e6659;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

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

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 840px) {
  .brand-tool-row {
    grid-template-columns: 1fr;
  }

  .brand-headliner {
    width: min(100%, 320px);
  }

  .shadow-top {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell {
    width: min(96vw, 1100px);
  }

  .panel {
    padding: 1rem;
  }
}
