:root {
  color-scheme: light;
  --navy: #10213e;
  --navy-2: #19345f;
  --blue: #255f9f;
  --sky: #eaf2fb;
  --gold: #c69a22;
  --ink: #172238;
  --muted: #5e6c82;
  --line: #d6deea;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --success: #18794e;
  --success-bg: #e9f8f0;
  --warning: #9a6700;
  --warning-bg: #fff7d6;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --shadow: 0 12px 30px rgba(16, 33, 62, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #edf3fa 0, var(--canvas) 300px),
    var(--canvas);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #79b8ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: 0.5rem;
  background: var(--navy);
  color: white;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  border-bottom: 4px solid var(--gold);
  background: var(--navy);
  color: white;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 170px;
  padding-block: 2rem;
}

.mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #f2cb52;
  font-size: 1.8rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.25;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  line-height: 1.4;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.12rem;
  line-height: 1.45;
}

.subtitle {
  margin-bottom: 0;
  color: #cbd7e8;
}

.eyebrow {
  margin-bottom: 0.3rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main.shell {
  padding-block: 2rem 4rem;
}

.notice,
.panel,
.summary,
.category-section {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
}

.notice h2 {
  font-size: 1rem;
}

.notice p {
  margin-bottom: 0.25rem;
}

.notice-security {
  border-left: 5px solid var(--blue);
}

.notice-warning {
  border-left: 5px solid var(--warning);
  background: var(--warning-bg);
}

.notice-error {
  border-left: 5px solid var(--danger);
  background: var(--danger-bg);
}

.panel {
  margin-block: 1.5rem;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

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

label > span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid #b9c5d6;
  border-radius: 0.6rem;
  background: white;
  padding: 0.6rem 0.75rem;
}

input:invalid {
  border-color: var(--danger);
}

.help {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.summary > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem;
  text-align: center;
}

.summary > div + div {
  border-left: 1px solid var(--line);
}

.summary strong {
  color: var(--navy);
  font-size: 1.5rem;
}

.summary-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard {
  display: grid;
  gap: 1.4rem;
}

.category-section {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.category-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.category-heading::before {
  width: 0.28rem;
  height: 1.7rem;
  border-radius: 1rem;
  background: var(--gold);
  content: "";
}

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

.item-card {
  display: flex;
  flex-direction: column;
  min-height: 235px;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
  padding: 1rem;
}

.item-card[data-tone="success"] {
  border-color: #9bd8b9;
  background: linear-gradient(145deg, var(--success-bg), white 58%);
}

.item-card[data-tone="warning"] {
  border-color: #ead289;
  background: linear-gradient(145deg, var(--warning-bg), white 58%);
}

.item-card[data-tone="danger"] {
  border-color: #f0b2aa;
  background: linear-gradient(145deg, var(--danger-bg), white 58%);
}

.item-card[data-tone="neutral"] {
  background: #f8fafc;
}

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.requirement {
  margin-bottom: 0.65rem;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.notes {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 0.8rem;
  margin-top: auto;
  border-top: 1px dashed var(--line);
  padding-top: 0.85rem;
  font-size: 0.82rem;
}

.status-row dt {
  color: var(--muted);
}

.status-row dd {
  margin: 0;
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  background: var(--sky);
  color: var(--navy-2);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.button,
.icon-button {
  border: 0;
  border-radius: 0.65rem;
  font-weight: 800;
}

.button {
  min-height: 2.65rem;
  padding: 0.65rem 1rem;
}

.button-primary {
  background: var(--navy);
  color: white;
}

.button-primary:hover {
  background: var(--navy-2);
}

.button-secondary {
  background: var(--success);
  color: white;
}

.button-secondary:hover {
  background: #12613e;
}

.button-ghost {
  border: 1px solid var(--line);
  background: white;
}

.edit-button {
  width: 100%;
  margin-top: 0.9rem;
}

.icon-button {
  width: 2.6rem;
  height: 2.6rem;
  background: #eef2f7;
  font-size: 1.4rem;
}

dialog {
  width: min(680px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  border: 0;
  border-radius: 1rem;
  padding: 0;
  box-shadow: 0 30px 90px rgba(10, 25, 50, 0.35);
}

dialog::backdrop {
  background: rgba(10, 23, 43, 0.7);
}

dialog form {
  padding: clamp(1rem, 4vw, 1.6rem);
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.requirement-list {
  display: grid;
  gap: 0.7rem;
  margin-block: 1rem;
}

.requirement-list div {
  border-left: 3px solid var(--gold);
  padding-left: 0.8rem;
}

.requirement-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.requirement-list dd {
  margin: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.form-error {
  margin-top: 0.8rem;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 750;
}

.noscript {
  margin: 1rem;
  border: 2px solid var(--danger);
  background: white;
  padding: 1rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .control-grid,
  .form-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .summary > div {
    justify-content: space-between;
  }

  .summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
