:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --panel: #ffffff;
  --ink: #151918;
  --muted: #606866;
  --teal: #2e7068;
  --line: #d9ddda;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.bar, main, footer {
  width: min(680px, calc(100% - 36px));
  margin: 0 auto;
}

.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  padding: 10px 0 14px;
}

.brand {
  display: block;
  width: 190px;
  height: 118px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

nav a, footer a { color: var(--teal); font-weight: 650; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.header-account-link {
  padding: 7px 11px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  text-decoration: none;
}

.header-link {
  color: var(--teal);
  font-weight: 650;
  text-decoration: none;
}

main { padding: 42px 0 64px; }

.home-main {
  display: flex;
  min-height: 54vh;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

h1 {
  margin: 0 0 12px;
  font-size: 46px;
  line-height: 1.12;
}

h2 { margin-top: 34px; font-size: 21px; }

p, li { color: var(--muted); }

.status {
  border-left: 4px solid var(--teal);
  padding: 14px 16px;
  background: var(--panel);
}

.status[hidden] { display: none; }

.status-error { border-left-color: #b42318; color: #7a271a; }

.status-success { border-left-color: var(--teal); color: #215f57; }

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--teal);
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.primary-link {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.home-actions {
  display: flex;
  width: min(320px, 100%);
  flex-direction: column;
  gap: 10px;
}

.home-actions .button {
  width: 100%;
  margin-top: 0;
  border-radius: 6px;
  text-align: center;
}

.auth-page { max-width: 560px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.auth-form label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}

.auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 50px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.auth-form input:not([type="checkbox"]):focus {
  border-color: var(--teal);
  outline: 2px solid rgba(46, 112, 104, 0.2);
  outline-offset: 1px;
}

.password-visibility {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
}

.password-visibility input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.password-visibility:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 6px;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.text-button {
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.text-button:disabled { cursor: not-allowed; opacity: 0.55; }

.portal-page {
  width: min(680px, calc(100% - 36px));
  min-height: calc(100vh - 230px);
  padding-top: 34px;
}

.auth-shell {
  width: min(480px, 100%);
  margin: 18px auto 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.portal-toolbar,
.section-heading,
.order-card-heading,
.order-meta,
.data-row-heading,
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-toolbar,
.section-heading {
  flex-direction: column;
  align-items: flex-start;
}

.portal-title { margin-bottom: 3px; font-size: 30px; }
.portal-updated { margin: 0; font-size: 13px; }

.portal-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.icon-command {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.icon-command:disabled { cursor: wait; opacity: 0.55; }

.compact-button {
  min-height: 42px;
  margin: 0;
  padding: 8px 12px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 28px 0 22px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
}

.portal-tab {
  flex: 1 1 105px;
  min-height: 44px;
  padding: 9px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.portal-tab.is-active {
  border-bottom-color: var(--teal);
  color: var(--ink);
}

.portal-loading {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  font-weight: 700;
}

.portal-section { padding: 4px 0 30px; }
.section-heading { margin: 8px 0 16px; align-items: flex-start; }
.section-heading h2 { margin: 0; font-size: 23px; }
.section-heading .eyebrow { margin-bottom: 2px; }

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.metric-card {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card span { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.metric-card strong { display: block; margin: 0; font-size: 26px; line-height: 1; }

.order-list,
.data-list {
  display: grid;
  gap: 10px;
}

.order-card,
.data-row,
.support-form,
.profile-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.order-card { padding: 16px; border-left: 5px solid var(--teal); }
.order-card.status-cancelled { border-left-color: #b42318; }
.order-card.status-delivered { border-left-color: #16803c; }

.order-card-heading { align-items: flex-start; }
.order-card-heading > div { display: grid; gap: 2px; }
.order-number { font-size: 16px; }
.order-date { color: var(--muted); font-size: 12px; font-weight: 650; }

.order-status {
  max-width: 210px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #e8f3f0;
  color: #215f57;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-cancelled .order-status { background: #fff0ee; color: #9f241a; }
.status-delivered .order-status { background: #e9f7ed; color: #146c35; }

.order-meta {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.order-meta strong { color: var(--ink); font-size: 15px; }

.order-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 12px 0 6px;
  padding: 0;
  list-style: none;
}

.order-timeline li {
  position: relative;
  min-height: 34px;
  padding: 5px 0 5px 30px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.order-timeline li::before {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 11px;
  height: 11px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  content: "";
  transform: translateX(-50%);
}

.order-timeline li:not(:first-child)::after {
  position: absolute;
  top: -18px;
  right: auto;
  left: 7px;
  width: 2px;
  height: 28px;
  background: var(--line);
  content: "";
}

.order-timeline li.is-complete::before,
.order-timeline li.is-current::before { border-color: var(--teal); background: var(--teal); }
.order-timeline li.is-complete::after,
.order-timeline li.is-current::after { background: var(--teal); }
.order-timeline li.is-current { color: var(--ink); }
.order-timeline li.is-cancelled::before { border-color: #b42318; background: #b42318; }

.activity-list { margin-top: 14px; border-top: 1px solid var(--line); }
.activity-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.activity-row:last-child { border-bottom: 0; }
.activity-row time { flex: 0 0 auto; color: var(--muted); }

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.segmented-control button {
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.segmented-control button.is-active { background: var(--ink); color: #fff; }

.data-row { padding: 14px 16px; }
.data-row p { margin: 7px 0 0; font-size: 13px; }
.data-row-heading { align-items: flex-start; }
.data-row-heading time { color: var(--muted); font-size: 11px; }

.data-badge {
  padding: 3px 7px;
  border-radius: 4px;
  background: #e8f3f0;
  color: #215f57;
  font-size: 11px;
  font-weight: 800;
}

.support-form { display: grid; gap: 8px; padding: 16px; margin-bottom: 24px; }
.support-form label { font-size: 14px; font-weight: 750; }
.support-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}
.support-form textarea:focus { border-color: var(--teal); outline: 2px solid rgba(46, 112, 104, 0.2); }
.form-footer span { color: var(--muted); font-size: 12px; }
.compact-submit { width: auto; min-width: 110px; margin: 0; }
.list-title { margin: 0 0 10px; font-size: 16px; }

.profile-details { margin: 0 0 16px; padding: 0 16px; }
.profile-details div { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.profile-details div:last-child { border-bottom: 0; }
.profile-details dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.profile-details dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }

.empty-state {
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}
.empty-state p { margin: 5px 0 0; font-size: 13px; }

@media (max-width: 700px) {
  h1 { font-size: 32px; }
  .bar { padding-top: 8px; }
  .brand { width: 160px; height: 100px; }
  .portal-page { width: min(100% - 24px, 680px); padding-top: 22px; }
  .auth-shell { padding: 20px; }
  .portal-toolbar { align-items: flex-start; }
  .portal-title { font-size: 25px; }
  .compact-button { padding-inline: 9px; font-size: 13px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 13px; }
  .metric-card span { font-size: 12px; }
  .metric-card strong { font-size: 24px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .view-link { padding-left: 0; }
  .order-card-heading { gap: 9px; }
  .order-status { max-width: 145px; font-size: 10px; }
  .site-nav { gap: 9px; }
}

footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
