:root {
  color-scheme: light;
  --navy-950: #0c182b;
  --navy-900: #101f39;
  --navy-800: #183152;
  --navy-700: #23466f;
  --blue-600: #2f67c9;
  --blue-500: #4c83df;
  --blue-100: #e8f0ff;
  --cream-50: #fffdf8;
  --cream-100: #f8f3e9;
  --cream-200: #ede5d7;
  --ink-900: #17253b;
  --ink-700: #3f506a;
  --ink-500: #718099;
  --line: #d9e0ea;
  --line-strong: #c5d0de;
  --success: #21745d;
  --success-soft: #e3f3ed;
  --warning: #9b621d;
  --shadow-sm: 0 8px 24px rgb(16 31 57 / 7%);
  --shadow-lg: 0 24px 70px rgb(16 31 57 / 18%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --content-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream-100);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 9% 0%, rgb(223 232 246 / 65%), transparent 27rem),
    var(--cream-100);
  line-height: 1.5;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
dialog:focus-visible {
  outline: 3px solid rgb(76 131 223 / 45%);
  outline-offset: 3px;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--cream-50);
  background: var(--navy-900);
  border-radius: var(--radius-sm);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--content-width));
  min-height: 78px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy-900);
  font-weight: 760;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-name {
  font-size: 1.14rem;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 26px;
  overflow: hidden;
  background: var(--navy-900);
  border-radius: 8px 8px 8px 3px;
  transform: rotate(-8deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark__dot,
.brand-mark__line {
  position: absolute;
  display: block;
  content: "";
}

.brand-mark::before {
  top: 6px;
  left: 6px;
  width: 7px;
  height: 7px;
  background: var(--cream-50);
  border-radius: 50%;
}

.brand-mark::after {
  right: 5px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  background: var(--blue-500);
  border-radius: 50%;
}

.brand-mark__dot {
  top: 11px;
  left: 9px;
  width: 10px;
  height: 2px;
  background: var(--cream-50);
  transform: rotate(38deg);
  transform-origin: left center;
}

.brand-mark__line {
  top: 14px;
  left: 11px;
  width: 9px;
  height: 2px;
  background: var(--blue-500);
  transform: rotate(-44deg);
  transform-origin: left center;
}

.header-actions,
.hero-actions,
.status-row,
.download-actions,
.form-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.2;
  transition: border-color 160ms ease, background-color 160ms ease,
    color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: var(--cream-50);
  background: var(--blue-600);
  box-shadow: 0 8px 18px rgb(47 103 201 / 22%);
}

.button-primary:hover {
  background: #285bb3;
  box-shadow: 0 10px 22px rgb(47 103 201 / 30%);
}

.button-outline {
  color: var(--cream-50);
  background: transparent;
  border-color: rgb(255 253 248 / 38%);
}

.button-outline:hover {
  background: rgb(255 253 248 / 12%);
  border-color: rgb(255 253 248 / 68%);
}

.button-quiet {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--navy-800);
  background: transparent;
  border-color: var(--line-strong);
}

.button-quiet:hover {
  color: var(--blue-600);
  background: var(--blue-100);
  border-color: #adc3e8;
}

.button-small {
  min-height: 33px;
  padding: 6px 11px;
  font-size: 0.76rem;
}

.button-plus {
  margin-right: 7px;
  font-size: 1.16rem;
  font-weight: 400;
  line-height: 0;
}

main {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
  padding: 14px 0 72px;
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 294px;
  padding: 42px 46px 40px;
  overflow: hidden;
  color: var(--cream-50);
  background: linear-gradient(116deg, var(--navy-950), var(--navy-900) 58%, #183a62);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 48%, rgb(76 131 223 / 12%) 48%, transparent 71%),
    linear-gradient(165deg, transparent 57%, rgb(255 253 248 / 5%) 57%, transparent 73%);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-600);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #9fc1f7;
}

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

h1,
h2,
h3 {
  color: var(--ink-900);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h1 {
  max-width: 610px;
  margin-bottom: 17px;
  color: var(--cream-50);
  font-size: clamp(2.25rem, 5vw, 4rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

h3 {
  margin-bottom: 7px;
  font-size: 1.03rem;
}

.hero-lede {
  max-width: 510px;
  margin-bottom: 0;
  color: #c8d5e7;
  font-size: 1rem;
}

.hero-actions {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.hero-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgb(159 193 247 / 28%);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.hero-orbit--one {
  right: -72px;
  bottom: -166px;
  width: 440px;
  height: 440px;
}

.hero-orbit--two {
  right: 62px;
  bottom: -94px;
  width: 270px;
  height: 270px;
  border-color: rgb(255 253 248 / 18%);
}

.status-row {
  justify-content: space-between;
  min-height: 54px;
  padding: 0 8px;
}

.configuration-status,
.notification {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--warning);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(155 98 29 / 10%);
}

.notification {
  padding: 8px 12px;
  color: #9b3d39;
  background: #fff0ed;
  border-radius: var(--radius-sm);
}

.workspace-card,
.detail-card {
  background: rgb(255 253 248 / 88%);
  border: 1px solid rgb(197 208 222 / 72%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.workspace-card {
  padding: 31px 34px 36px;
}

.workspace-header,
.section-heading--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.workspace-caption {
  max-width: 330px;
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 0.86rem;
  text-align: right;
}

.workspace-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 15px;
  margin-top: 29px;
  padding: 16px;
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
}

.field,
.form-field {
  display: grid;
  gap: 7px;
}

.field-label,
.form-field label,
.form-label {
  color: var(--ink-700);
  font-size: 0.77rem;
  font-weight: 750;
}

.search-input-wrap {
  position: relative;
  display: block;
}

.search-input-wrap input {
  padding-left: 39px;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 14px;
  height: 14px;
  border: 1.7px solid var(--ink-500);
  border-radius: 50%;
  transform: translateY(-58%);
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 1.7px;
  background: var(--ink-500);
  content: "";
  transform: rotate(45deg);
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink-900);
  background: var(--cream-50);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease,
    background-color 160ms ease;
}

input,
select {
  min-height: 44px;
  padding: 9px 13px;
}

textarea {
  min-height: 112px;
  padding: 11px 13px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa6b7;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9fb1c8;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgb(76 131 223 / 12%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-height: 16px;
  margin: 26px 0 24px;
}

.commitments {
  display: grid;
  gap: 10px;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 17px;
  max-width: 630px;
  margin: 12px auto 0;
  padding: 28px 30px;
  color: var(--ink-700);
  background: linear-gradient(125deg, #f0f5ff, #f9f5ec);
  border: 1px dashed #bac9dc;
  border-radius: var(--radius-md);
  text-align: left;
}

.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 0.87rem;
}

.empty-state__mark {
  display: grid;
  flex: 0 0 44px;
  gap: 4px;
  align-content: center;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: var(--navy-900);
  border-radius: 13px 13px 13px 4px;
  transform: rotate(-5deg);
}

.empty-state__mark span {
  display: block;
  height: 3px;
  background: #b7cff6;
  border-radius: 999px;
}

.empty-state__mark span:nth-child(2) {
  width: 78%;
  background: var(--cream-50);
}

.empty-state__mark span:nth-child(3) {
  width: 54%;
  background: var(--blue-500);
}

.detail-panel {
  margin-top: 24px;
}

.detail-content {
  min-height: 70px;
  margin-bottom: 16px;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.detail-card {
  padding: 28px;
}

.section-heading {
  margin-bottom: 23px;
}

.section-heading--row {
  align-items: center;
  margin-bottom: 24px;
}

.section-heading--row .section-heading {
  margin-bottom: 0;
}

.event-form {
  display: grid;
  gap: 18px;
}

.field-help {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.74rem;
}

.criterion-results {
  min-height: 35px;
  padding: 10px;
  background: var(--cream-100);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.form-actions {
  justify-content: flex-end;
  margin-top: 1px;
}

.download-actions {
  flex-shrink: 0;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 220px;
  margin: 0;
  padding: 8px 0 8px 29px;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline:empty::after {
  align-self: center;
  max-width: 220px;
  color: var(--ink-500);
  content: "Select a commitment to view its history.";
  font-size: 0.84rem;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.45rem;
  line-height: 1;
}

.icon-button:hover {
  color: var(--navy-900);
  background: var(--blue-100);
  border-color: #adc3e8;
}

.footer {
  display: flex;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
  padding: 0 0 30px;
  color: var(--ink-500);
  font-size: 0.77rem;
}

.footer-brand {
  color: var(--navy-800);
  font-weight: 750;
}

dialog {
  width: min(calc(100% - 32px), 720px);
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink-900);
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgb(12 24 43 / 60%);
  backdrop-filter: blur(3px);
}

#draft-form {
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 32px;
}

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

.dialog-policy {
  margin-bottom: 25px;
  padding: 13px 15px;
  color: var(--navy-800);
  background: var(--blue-100);
  border-left: 3px solid var(--blue-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
}

.draft-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 15px;
}

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

.optional {
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 500;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .topbar,
  main,
  .footer {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .topbar {
    min-height: 70px;
  }

  .identity {
    display: none;
  }

  main {
    padding-top: 10px;
  }

  .hero {
    display: block;
    min-height: auto;
    padding: 34px 27px 29px;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3.5rem);
  }

  .hero-actions {
    margin-top: 30px;
  }

  .workspace-card {
    padding: 25px 20px 27px;
  }

  .workspace-header,
  .section-heading--row {
    display: block;
  }

  .workspace-caption {
    margin-top: 12px;
    text-align: left;
  }

  .workspace-controls {
    grid-template-columns: 1fr;
  }

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

  .detail-card {
    padding: 23px 20px;
  }

  .section-heading--row .download-actions {
    margin-top: 17px;
  }

  #draft-form {
    padding: 25px 20px;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 12px;
  }

  .header-actions {
    gap: 5px;
  }

  .button-quiet {
    padding-inline: 11px;
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

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

  .status-row {
    display: block;
    padding: 12px 4px;
  }

  .notification {
    margin-top: 9px;
  }

  .empty-state {
    display: block;
    padding: 23px;
  }

  .empty-state__mark {
    margin-bottom: 17px;
  }

  .draft-fields {
    grid-template-columns: 1fr;
  }

  .form-field--wide {
    grid-column: auto;
  }

  .footer {
    display: grid;
    gap: 5px;
  }
}

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