:root {
  --ink: #13201b;
  --muted: #5a6862;
  --line: #dbe4df;
  --panel: #ffffff;
  --paper: #f5f3ec;
  --soft: #e8efe9;
  --accent: #0e7c66;
  --accent-dark: #095849;
  --gold: #c4892f;
  --clay: #b65f45;
  --field: #fbfcfa;
  --shadow: 0 22px 60px rgba(33, 48, 42, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(196, 137, 47, 0.16), transparent 34rem),
    linear-gradient(135deg, #f8f6ef 0%, #edf4ef 48%, #f6f0e9 100%);
}

button,
input,
select,
textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem;
  background: rgba(19, 32, 27, 0.94);
  color: #f7fbf8;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  min-width: 0;
}

.brand-block {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 0.5rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  line-height: 1;
}

.hero-panel h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); }

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow { color: #bddbd1; }

.section-nav {
  display: grid;
  gap: 0.35rem;
}

.section-nav a {
  color: #eef8f3;
  text-decoration: none;
  padding: 0.7rem 0.8rem;
  border-radius: 0.45rem;
  overflow-wrap: anywhere;
  transition: background 180ms ease, transform 180ms ease;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(0.15rem);
  outline: none;
}

.status-card {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
}

.status-card p {
  margin: 0.45rem 0 0;
  color: #d8e8e1;
}

.status-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #63d5a7;
}

main {
  padding: clamp(1rem, 3vw, 2rem);
  min-width: 0;
}

.hero-panel,
.panel {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto 1rem;
  border: 1px solid rgba(19, 32, 27, 0.08);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2.2rem);
  overflow: hidden;
  position: relative;
}

.hero-panel > * { min-width: 0; }

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 18rem;
  height: 18rem;
  border: 2.4rem solid rgba(14, 124, 102, 0.08);
  border-radius: 50%;
}

.hero-copy {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  z-index: 1;
  flex-wrap: wrap;
}

button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.45rem;
  padding: 0 1rem;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(14, 124, 102, 0.22);
}

button.secondary {
  color: var(--ink);
  background: #f2eadb;
  box-shadow: none;
}

.form-stack {
  display: grid;
  gap: 1.15rem;
}

.panel { padding: clamp(1rem, 2.4vw, 1.45rem); }

.panel-heading { margin-bottom: 1.1rem; }

.section-copy {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.review-period {
  display: grid;
  grid-template-columns: repeat(2, minmax(10rem, 14rem));
  gap: 0.9rem;
  margin-top: 1rem;
}

.grid,
.compound-row {
  display: grid;
  gap: 0.9rem;
}

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

.compound-row {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--field);
}

.compound-row.four { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }

.wide-field {
  grid-column: 1 / -1;
}

.field-list {
  display: grid;
  gap: 0.85rem;
}

.field-list.compact { gap: 0.8rem; }

.field-list > label {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(251, 252, 250, 0.72);
}

.decision-list {
  display: grid;
  gap: 0.65rem;
}

.decision-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(251, 252, 250, 0.72);
}

label {
  display: grid;
  gap: 0.4rem;
  color: #22332d;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.32;
}

.compound-row label {
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd8d1;
  border-radius: 0.4rem;
  background: white;
  color: var(--ink);
  min-height: 2.35rem;
  padding: 0.52rem 0.68rem;
  font-weight: 500;
}

textarea {
  min-height: 4.25rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.14);
  outline: none;
}

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 0.28rem solid var(--gold);
  background: #fff8e9;
  border-radius: 0.35rem;
}

.notice p {
  margin: 0.45rem 0 0;
  color: #5a4930;
}

.reflection-grid {
  display: grid;
  grid-template-columns: minmax(9rem, 0.55fr) repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}

.reflection-header {
  padding: 0.75rem;
  border-radius: 0.4rem;
  background: var(--soft);
  font-weight: 800;
}

.reflection-topic {
  display: flex;
  align-items: center;
  min-height: 5.5rem;
  padding: 0.85rem;
  border-radius: 0.4rem;
  background: #f5f8f5;
  color: var(--accent-dark);
  font-weight: 800;
}

.reflection-grid label { min-width: 0; }

.reflection-grid textarea { min-height: 5.5rem; }

.okr-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.okr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #fbfcfa;
}

.okr-name { font-weight: 750; }

.okr-target {
  color: var(--accent-dark);
  font-weight: 800;
}

.objectives-link {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: #eef6f2;
}

.objectives-link a {
  color: var(--accent-dark);
  font-weight: 800;
}

.original-text {
  max-height: 32rem;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #101a16;
  color: #eef7f2;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .app-shell { display: block; }

  .sidebar {
    position: static;
    height: auto;
    width: auto;
    max-width: 100%;
  }

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

  .hero-panel {
    flex-direction: column;
    margin-top: 0;
  }

  .hero-panel,
  .panel {
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
  }

  .grid.two,
  .okr-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section-nav,
  .review-period,
  .decision-row,
  .compound-row,
  .compound-row.four,
  .reflection-grid { grid-template-columns: 1fr; }

  .reflection-header { display: none; }

  .hero-actions { flex-direction: column; }

  button { width: 100%; }
}

@media print {
  body { background: white; }

  .sidebar,
  .hero-actions,
  .toast { display: none; }

  .app-shell { display: block; }

  main { padding: 0; }

  .hero-panel,
  .panel {
    box-shadow: none;
    border-color: #bbb;
    break-inside: avoid;
  }
}