:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --teal: #0f8f83;
  --teal-dark: #087067;
  --gold: #d89b28;
  --red: #c94f4f;
  --blue: #2d6cdf;
  --shadow: 0 18px 45px rgba(35, 45, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f6;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: #172330;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  font-weight: 800;
}

.brand span,
.sidebar-card p,
.eyebrow,
.metric-strip span,
.score-ring span {
  color: #7b8796;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #b8c2cf;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #d5dde7;
  text-decoration: none;
  font-weight: 700;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-card {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card p {
  margin: 6px 0 0;
  color: #b7c0cd;
  line-height: 1.45;
  text-transform: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #4ed6a3;
  box-shadow: 0 0 0 5px rgba(78, 214, 163, 0.14);
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.title-credit {
  display: inline;
  color: #49576a;
  font-size: clamp(0.88rem, 1.4vw, 1.05rem);
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.title-credit a {
  color: var(--teal-dark);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.jp-flag {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 1px solid #d6dce5;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #bc002d 0 32%, transparent 33%),
    #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.14);
  vertical-align: -0.14em;
}

.topbar-subtitle {
  max-width: 680px;
  margin: 14px 0 0;
  color: #4b596b;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.topbar-actions,
.form-actions,
.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.advisor-panel,
.summary-panel,
.task-board,
.insight-panel,
dialog form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.advisor-panel,
.summary-panel,
.task-board,
.insight-panel {
  padding: 22px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5f4f2;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 143, 131, 0.14);
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.primary-button {
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.icon-button {
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.summary-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.summary-panel p {
  color: #4c596a;
  line-height: 1.65;
}

.score-ring {
  position: relative;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
}

.score-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke: #e4e8ef;
  stroke-width: 12;
}

#scoreCircle {
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 124;
  transition: stroke-dashoffset 0.35s ease;
}

.score-ring div {
  position: relative;
  display: grid;
  justify-items: center;
}

.score-ring strong {
  font-size: 2.2rem;
}

.impact-list {
  display: grid;
  gap: 10px;
}

.impact-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  background: var(--soft);
}

.impact-item span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
}

.impact-item strong {
  display: block;
  margin-bottom: 3px;
}

.impact-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.metric-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-strip div {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-strip strong {
  font-size: 2rem;
}

.task-board,
.insight-panel {
  min-width: 0;
}

.progress-rail {
  overflow: hidden;
  width: min(260px, 42vw);
  height: 10px;
  border-radius: 999px;
  background: #e6ebf1;
}

.progress-rail span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.25s ease;
}

.task-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.task-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 360px;
  padding: 12px;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  background: #f7f9fc;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #475467;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.task-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
}

.task-card strong {
  line-height: 1.35;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3f7;
  color: #475467;
  font-size: 0.78rem;
  font-weight: 800;
}

.priority-high {
  background: #fff0eb;
  color: #b44927;
}

.priority-medium {
  background: #fff7df;
  color: #986f14;
}

.priority-low {
  background: #eaf4ff;
  color: #245ca8;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.task-actions button {
  flex: 1;
  min-height: 34px;
  border: 1px solid #d6dde8;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding-left: 22px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}

.timeline-item strong {
  font-size: 0.95rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

dialog {
  width: min(480px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(20, 28, 39, 0.52);
}

dialog form {
  padding: 20px;
}

[data-icon] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

[data-icon="dashboard"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 13h7V4H4v9Zm0 7h7v-5H4v5Zm9 0h7v-9h-7v9Zm0-16v5h7V4h-7Z'/%3E%3C/svg%3E");
}

[data-icon="tasks"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 16.2-3.5-3.5L4 14.2 9 19l11-11-1.5-1.5L9 16.2ZM5 6h11v2H5V6Zm0 4h8v2H5v-2Z'/%3E%3C/svg%3E");
}

[data-icon="chart"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19V5h2v14H5Zm6 0V9h2v10h-2Zm6 0V3h2v16h-2Z'/%3E%3C/svg%3E");
}

[data-icon="spark"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 1.7 6.3L20 10l-6.3 1.7L12 18l-1.7-6.3L4 10l6.3-1.7L12 2Zm6 13 1 3.5 3 1-3 1-1 3.5-1-3.5-3-1 3-1 1-3.5ZM5 14l.8 2.2L8 17l-2.2.8L5 20l-.8-2.2L2 17l2.2-.8L5 14Z'/%3E%3C/svg%3E");
}

[data-icon="reset"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5a7 7 0 1 1-6.3 4H3l4-4 4 4H8a5 5 0 1 0 4-2V5Z'/%3E%3C/svg%3E");
}

[data-icon="plus"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5Z'/%3E%3C/svg%3E");
}

[data-icon="close"] {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6.4 5 5.6 5.6L17.6 5 19 6.4 13.4 12l5.6 5.6-1.4 1.4-5.6-5.6L6.4 19 5 17.6l5.6-5.6L5 6.4 6.4 5Z'/%3E%3C/svg%3E");
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 14px 18px;
  }

  .nav-list {
    grid-template-columns: repeat(3, auto);
    align-content: center;
  }

  .sidebar-card {
    display: none;
  }

  .hero-band,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  main {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .section-heading,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .form-actions {
    flex-direction: row;
  }

  .input-grid,
  .metric-strip,
  .task-columns {
    grid-template-columns: 1fr;
  }

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

  .nav-list {
    overflow-x: auto;
  }

  .nav-list a {
    white-space: nowrap;
  }
}
