:root {
  color-scheme: light;
  --ink: #14221b;
  --muted: #607168;
  --line: #d9e3de;
  --fill: #f6faf8;
  --brand: #0b6b43;
  --brand-dark: #064f31;
  --brand-soft: #e8f4ef;
  --accent: #d7a64a;
  --ok: #168a54;
  --warn: #9a5b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(11, 107, 67, 0.1) 0%, rgba(237, 243, 240, 0) 180px),
    #edf3f0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 20px 28px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px 16px;
}

.logo {
  width: min(330px, 68vw);
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.codename {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
}

.badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.titleband {
  text-align: center;
  padding: 22px 10px 24px;
}

.titleband.compact {
  padding-top: 16px;
}

.titleband p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--brand-dark);
  font-weight: 760;
}

h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 76px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 18px 44px rgba(10, 52, 35, 0.12);
}

form {
  display: grid;
  gap: 16px;
}

.module-tabs {
  display: flex;
  gap: 8px;
  margin: 2px 0 8px;
}

.module-tabs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 14px;
}

.module-tabs a.active {
  color: white;
  border-color: var(--brand);
  background: var(--brand);
}

.grid {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 14px;
}

.field-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.muted {
  margin: -8px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--fill);
  font: inherit;
  outline: none;
}

input[readonly] {
  color: var(--muted);
  background: #eef4f1;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 107, 67, 0.14);
}

button {
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #0e7a4d 0%, var(--brand-dark) 100%);
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: linear-gradient(180deg, #0c6f46 0%, #043f27 100%);
}

button:disabled {
  background: #9fb8df;
  cursor: wait;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-card {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 13px 14px;
  display: grid;
  align-content: space-between;
}

.resource-card span {
  color: var(--muted);
  font-size: 13px;
}

.resource-card strong {
  color: var(--brand-dark);
  font-size: 25px;
  line-height: 1.15;
  font-weight: 760;
}

.impact {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--brand-soft);
}

.impact.warn {
  color: #8a3f00;
  border-color: #e4bd7f;
  background: #fff5df;
}

.hidden {
  display: none !important;
}

.confirm-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(11, 107, 67, 0.24);
  border-radius: 8px;
  background: #f3fbf7;
  padding: 14px;
}

.confirm-panel h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 18px;
  letter-spacing: 0;
}

.confirm-grid {
  display: grid;
  gap: 8px;
}

.confirm-grid p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.confirm-grid span {
  color: var(--muted);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-picker {
  display: grid;
  gap: 9px;
}

.project-results {
  display: grid;
  gap: 8px;
}

.project-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.project-result {
  width: 100%;
  height: auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

button.project-result:hover {
  background: var(--brand-soft);
}

button.project-chip {
  width: auto;
  min-height: 36px;
  height: auto;
  border: 1px solid rgba(11, 107, 67, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.people-picker {
  display: grid;
  gap: 9px;
}

.people-results,
.people-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.person-result,
button.person-chip {
  width: auto;
  min-height: 34px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: white;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
}

button.person-result:hover,
button.person-chip:hover {
  background: var(--brand-soft);
}

button.person-chip {
  border-color: rgba(11, 107, 67, 0.28);
  background: var(--brand-soft);
}

.task-list-panel {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 20px;
  letter-spacing: 0;
}

button.ghost {
  width: auto;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  background: var(--fill);
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 600;
}

button.ghost:hover {
  background: var(--brand-soft);
}

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

.task-date-group {
  display: grid;
  gap: 10px;
}

.task-date-group + .task-date-group {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.task-date-group h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.task-item {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 13px 14px;
}

.task-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-item header strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.task-item header span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 9px;
  font-size: 12px;
}

.task-meta,
.task-content,
.task-people,
.empty {
  margin: 0;
}

.task-meta,
.task-people,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.task-content {
  color: var(--ink);
  line-height: 1.55;
}

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

.task-numbers span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 5px 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

button.status-button {
  min-height: 36px;
  height: auto;
  border: 1px solid rgba(11, 107, 67, 0.25);
  border-radius: 6px;
  background: white;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
}

button.status-button:hover {
  background: var(--brand-soft);
}

button.status-button:disabled {
  background: var(--brand);
  color: white;
  cursor: default;
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.message.ok {
  color: var(--ok);
}

.message.warn {
  color: var(--warn);
}

.portal-shell {
  width: min(1120px, 100%);
}

.portal-brandbar {
  padding-bottom: 10px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
  padding: 24px 0 18px;
}

.portal-hero h1 {
  display: block;
  font-size: clamp(32px, 5vw, 48px);
}

.portal-hero h1::after {
  left: 0;
  transform: none;
}

.portal-hero p {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.portal-status {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(11, 107, 67, 0.18);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 244, 239, 0.85));
}

.portal-status strong {
  color: var(--brand-dark);
  font-size: 22px;
}

.portal-status span,
.portal-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}

button.portal-module {
  min-height: 94px;
  height: auto;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid rgba(11, 107, 67, 0.2);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #e1f0e9 0%, #cfe5da 100%);
  color: var(--brand-dark);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 22px rgba(10, 52, 35, 0.07);
}

button.portal-module:hover {
  border-color: rgba(11, 107, 67, 0.36);
  background: linear-gradient(180deg, #e8f5ef 0%, #d8eadf 100%);
}

button.portal-module.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #0c7650 0%, var(--brand-dark) 100%);
  color: white;
  box-shadow: 0 14px 30px rgba(6, 79, 49, 0.22);
}

button.portal-module span {
  font-size: 16px;
  font-weight: 760;
}

button.portal-module strong {
  color: inherit;
  opacity: 0.76;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.portal-panel,
.portal-roadmap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(10, 52, 35, 0.1);
}

.portal-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.portal-panel-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 24px;
}

.portal-panel-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-panel-head > span {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 1px solid rgba(215, 166, 74, 0.38);
  border-radius: 999px;
  padding: 7px 11px;
  color: #7a4b04;
  background: #fff6df;
  font-size: 13px;
  white-space: nowrap;
}

.portal-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-feature {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--fill);
  color: var(--ink);
  text-decoration: none;
}

.portal-feature:hover {
  border-color: rgba(11, 107, 67, 0.34);
  background: var(--brand-soft);
}

.portal-feature strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.portal-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.portal-feature-state {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #72500b;
  background: #fff3d1;
  font-size: 12px;
  font-weight: 700;
}

.portal-feature-state.ready {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.portal-feature-state.active {
  color: #1f5573;
  background: #e4f3fb;
}

.portal-roadmap {
  margin-top: 16px;
}

.portal-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-steps li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--fill);
}

.portal-steps strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 15px;
}

.portal-steps span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 680px) {
  .shell {
    padding: 14px;
  }

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

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

  .brandbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 10px;
  }

  .brand-meta {
    width: 100%;
    justify-content: space-between;
  }

  .titleband {
    padding-top: 14px;
  }

  .panel {
    padding: 16px;
  }

  .confirm-actions {
    grid-template-columns: 1fr;
  }

  .task-item header {
    display: grid;
  }

  .status-actions {
    grid-template-columns: 1fr;
  }

  .portal-hero,
  .portal-panel-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .portal-grid,
  .portal-feature-grid,
  .portal-steps {
    grid-template-columns: 1fr;
  }

  button.portal-module {
    min-height: 72px;
  }
}

@media (min-width: 681px) and (max-width: 980px) {
  .portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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