:root {
  --navy: #0b3d62;
  --navy-deep: #062d49;
  --cream: #fbf0cf;
  --cream-light: #fffaf0;
  --gold: #f4c13d;
  --burgundy: #7a1d13;
  --green: #69bd50;
  --teal: #2e9291;
  --violet: #a66bb1;
  --coral: #df5429;
  --ink: #12394c;
  --white: #ffffff;
  --shadow: 0 20px 55px rgba(11, 61, 98, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(244, 193, 61, .28), transparent 24rem),
    radial-gradient(circle at 4% 85%, rgba(46, 146, 145, .16), transparent 22rem),
    var(--cream-light);
  font-family: "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
}

button, input, textarea { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.2rem clamp(1.25rem, 5vw, 5rem);
  color: var(--white);
  background:
    linear-gradient(105deg, rgba(6, 45, 73, .98), rgba(11, 61, 98, .95)),
    var(--navy);
  border-bottom: 8px solid var(--gold);
}

.eyebrow, .section-kicker {
  margin: 0 0 .45rem;
  font-weight: 800;
  letter-spacing: .09em;
  font-size: .78rem;
}

.topbar .eyebrow { color: #f9e86b; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.3rem);
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: -.025em;
}

.subtitle {
  margin: .8rem 0 0;
  color: #dfeef3;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.time-badge {
  width: 90px;
  aspect-ratio: 1;
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  flex: 0 0 auto;
}

.time-badge span { font-size: 2.35rem; font-weight: 900; line-height: .9; }
.time-badge small { margin-top: .35rem; color: #f9e86b; font-weight: 900; letter-spacing: .12em; }

main {
  width: min(1500px, 94vw);
  margin: 2rem auto 3rem;
}

.mission {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 1.8rem;
  background: var(--cream);
  border-left: 8px solid var(--burgundy);
  box-shadow: 0 10px 35px rgba(11, 61, 98, .08);
}

.mission h2, .evidence-panel h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.45rem;
}

.mission ol {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  margin: .9rem 0 0;
  padding-left: 1.4rem;
}

.privacy-note {
  display: grid;
  max-width: 290px;
  gap: .25rem;
  padding: 1rem 1.2rem;
  color: var(--white);
  background: var(--burgundy);
  border-radius: 14px;
}

.privacy-note strong { color: #ffe47a; text-transform: uppercase; letter-spacing: .05em; }

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(340px, .65fr);
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

.design-panel, .evidence-panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(11, 61, 98, .13);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.design-panel { padding: clamp(1rem, 3vw, 2rem); }

.family-name-label, .explanation-label {
  display: grid;
  gap: .35rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: var(--navy);
}

.family-name-label { margin-bottom: .45rem; }

input, textarea {
  width: 100%;
  border: 2px solid rgba(11, 61, 98, .2);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255,255,255,.93);
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

input:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(244, 193, 61, .25);
}

#family-name { padding: .85rem 1rem; font-size: 1.1rem; }

.shield-shell {
  position: relative;
  width: min(720px, 100%);
  aspect-ratio: .93;
  margin: 1.5rem auto 0;
  padding: 9px;
  background: var(--gold);
  clip-path: polygon(50% 0, 96% 13%, 90% 63%, 50% 100%, 10% 63%, 4% 13%);
  filter: drop-shadow(0 18px 18px rgba(11, 61, 98, .2));
}

.shield {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  clip-path: polygon(50% 0, 96% 13%, 90% 63%, 50% 100%, 10% 63%, 4% 13%);
  overflow: hidden;
  background: var(--navy);
}

.quadrant {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
  padding: clamp(1.35rem, 3vw, 2.4rem);
  color: var(--navy-deep);
  border: 2px solid rgba(255,255,255,.75);
}

.care { background: #f09a77; padding-left: clamp(2.4rem, 6vw, 4.6rem); padding-top: clamp(2.7rem, 7vw, 5rem); }
.role { background: #83cba2; padding-right: clamp(2.4rem, 6vw, 4.6rem); padding-top: clamp(2.7rem, 7vw, 5rem); }
.responsibility { background: #e9c65b; padding-left: clamp(2.7rem, 7vw, 5.2rem); padding-bottom: clamp(3.4rem, 8vw, 6rem); }
.cooperation { background: #78b9c4; padding-right: clamp(2.7rem, 7vw, 5.2rem); padding-bottom: clamp(3.4rem, 8vw, 6rem); }

.quadrant-number { font-weight: 900; font-size: .75rem; opacity: .75; }
.quadrant-title { font-weight: 950; font-size: clamp(1rem, 2vw, 1.45rem); letter-spacing: .045em; }
.quadrant-prompt { min-height: 2.2em; font-size: clamp(.72rem, 1.2vw, .9rem); line-height: 1.15; }

.quadrant textarea {
  min-height: 84px;
  resize: none;
  padding: .6rem;
  font-size: clamp(.72rem, 1.3vw, .95rem);
  line-height: 1.3;
  background: rgba(255,255,255,.83);
}

.shield-emblem {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  border: 5px solid var(--gold);
  font-size: 2rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(11,61,98,.28);
  pointer-events: none;
}

.evidence-panel {
  position: sticky;
  top: 1.2rem;
  padding: 1.5rem;
}

.progress-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.progress-ring {
  --progress: 0deg;
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), #dce6e8 0);
  position: relative;
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--white);
}

.progress-ring span { position: relative; z-index: 1; font-weight: 900; color: var(--navy); }

.explanation-label small {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #506d7b;
}

.explanation {
  min-height: 140px;
  resize: vertical;
  padding: .8rem;
  margin-top: .6rem;
  line-height: 1.45;
}

.concept-help {
  margin: 1rem 0;
  border: 1px solid rgba(11,61,98,.16);
  border-radius: 14px;
  background: #f4faf9;
}

.concept-help summary { cursor: pointer; padding: .85rem 1rem; font-weight: 800; color: var(--navy); }
.concept-help dl { margin: 0; padding: 0 1rem 1rem; }
.concept-help dl div { display: grid; grid-template-columns: 105px 1fr; gap: .6rem; margin-top: .5rem; }
.concept-help dt { font-weight: 850; color: var(--burgundy); }
.concept-help dd { margin: 0; }

.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  color: var(--white);
  background: var(--navy);
  border-radius: 16px;
}

.timer-card .section-kicker { color: #f9e86b; }
#timer-display { font-size: 2rem; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; gap: .45rem; }

.button {
  border: 0;
  border-radius: 12px;
  padding: .8rem 1rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}

.button:hover { transform: translateY(-2px); }
.button:focus-visible { outline: 4px solid rgba(244,193,61,.5); outline-offset: 2px; }
.primary { color: var(--navy-deep); background: var(--gold); box-shadow: 0 8px 20px rgba(244,193,61,.25); }
.secondary { color: var(--white); background: var(--teal); }
.ghost { color: var(--navy); background: #e9f1f3; }
.timer-card .ghost { color: var(--white); background: rgba(255,255,255,.15); }
.danger { color: var(--burgundy); }

.action-stack { display: grid; gap: .65rem; }
.storage-note { margin: 1rem 0 0; color: #5b7682; font-size: .78rem; line-height: 1.35; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1.25rem, 5vw, 5rem);
  color: #dfeef3;
  background: var(--navy-deep);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .05em;
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .evidence-panel { position: static; }
  .mission { grid-template-columns: 1fr; }
  .privacy-note { max-width: none; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; padding: 1.4rem 1rem; }
  .time-badge { width: 68px; }
  .time-badge span { font-size: 1.7rem; }
  main { width: min(96vw, 1500px); margin-top: 1rem; }
  .mission { padding: 1rem; }
  .mission ol { display: block; }
  .mission li + li { margin-top: .4rem; }
  .design-panel { padding: .7rem; }
  .quadrant { padding: 1.05rem; }
  .care, .role { padding-top: 2.2rem; }
  .care, .responsibility { padding-left: 1.8rem; }
  .role, .cooperation { padding-right: 1.8rem; }
  .responsibility, .cooperation { padding-bottom: 2.5rem; }
  .quadrant-prompt { display: none; }
  .quadrant textarea { min-height: 66px; padding: .4rem; }
  .shield-emblem { width: 54px; border-width: 3px; font-size: 1.45rem; }
  .timer-card { align-items: flex-start; }
  footer { flex-direction: column; }
}

@media print {
  body { background: white; }
  .topbar { padding: 1rem 1.5rem; }
  .mission, .timer-card, .action-stack, .concept-help, .storage-note, footer { display: none !important; }
  main { width: 100%; margin: 1rem 0; }
  .workspace { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1rem; }
  .design-panel, .evidence-panel { box-shadow: none; border: 1px solid #aaa; }
  .evidence-panel { position: static; }
  .shield-shell { max-width: 620px; }
  textarea, input { border-color: #777; }
}
