:root {
  color-scheme: light;
  --ink: #20242a;
  --subtle: #5f6772;
  --paper: #ffffff;
  --canvas: #f3f1ec;
  --line: #e3ded4;
  --amber: #f5a623;
  --amber-soft: #fff2d4;
  --amber-deep: #754000;
  --green: #147654;
  --green-soft: #e5f5ee;
  --red: #9f2f2b;
  --red-soft: #fbe9e7;
  --blue: #225f9c;
  --blue-soft: #e8f2fb;
  --shadow: 0 18px 56px rgb(32 36 42 / 10%);
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgb(245 166 35 / 12%), transparent 28rem),
    var(--canvas);
}

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

button,
a,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.demo-banner {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  color: #231700;
  background: var(--amber);
  border-bottom: 1px solid rgb(32 36 42 / 15%);
  font-size: 13px;
  line-height: 1.45;
}

.demo-banner strong {
  flex: 0 0 auto;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(320px, 760px);
  gap: clamp(28px, 6vw, 86px);
  align-items: start;
  justify-content: center;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 52px 28px 80px;
}

.guide-panel {
  position: sticky;
  top: 88px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-weight: 900;
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 12px;
}

.brand--large .brand-mark {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 15px;
  font-size: 20px;
}

.brand--large b {
  font-size: 22px;
}

.brand--large small {
  font-size: 14px;
}

.guide-block {
  margin-top: 42px;
}

.guide-block--muted {
  padding-left: 18px;
  border-left: 3px solid var(--line);
  color: var(--subtle);
  font-size: 14px;
  line-height: 1.7;
}

.guide-block--muted p {
  margin: 8px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 15px;
}

.route-list span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.app-frame {
  min-height: 760px;
  overflow: hidden;
  background: #f8f7f4;
  border: 1px solid rgb(32 36 42 / 10%);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
}

.role-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--canvas);
  border-radius: 12px;
}

.role-button {
  min-width: 54px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--subtle);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.role-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgb(32 36 42 / 10%);
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  color: var(--subtle);
  background: #fffaf0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.session-bar .text-button {
  padding: 6px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#app {
  min-height: 620px;
  padding-bottom: calc(82px + var(--safe-bottom));
}

.page {
  width: 100%;
  padding: 24px 22px 30px;
}

.auth-page {
  max-width: 650px;
  margin: 0 auto;
}

.auth-hero {
  text-align: left;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  width: 100%;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.choice-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  cursor: pointer;
}

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

.page-heading h1,
.hero h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.page-heading p,
.hero p {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: 15px;
  line-height: 1.65;
}

.hero {
  padding: 26px;
  background: linear-gradient(135deg, #fff6df 0%, #ffe5a8 100%);
  border: 1px solid #eccb82;
  border-radius: var(--radius-lg);
}

.hero .tag {
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.section {
  margin-top: 24px;
}

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

.section-heading h2,
.card h2,
.card h3 {
  margin: 0;
}

.section-heading h2,
.card h2 {
  font-size: 19px;
}

.section-heading a,
.text-button {
  color: var(--amber-deep);
  font-size: 14px;
  font-weight: 750;
}

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

.card {
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.card--soft {
  background: #fbfaf7;
}

.card--warning {
  background: var(--amber-soft);
  border-color: #e8c574;
}

.card--danger {
  background: var(--red-soft);
  border-color: #e9bbb7;
}

.card--success {
  background: var(--green-soft);
  border-color: #afdac8;
}

.order-card {
  display: grid;
  gap: 14px;
}

.order-card__top,
.daily-card__top,
.assignment-head,
.line-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-card h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.4;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin: 0;
  color: var(--subtle);
  font-size: 14px;
  line-height: 1.55;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--amber-deep);
  background: var(--amber-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill--green {
  color: #0b5b3f;
  background: var(--green-soft);
}

.status-pill--red {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill--blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--amber);
  border: 1px solid #ca8512;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.button:hover {
  filter: brightness(0.98);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.55;
}

.button--secondary {
  background: var(--paper);
  border-color: #bdb6aa;
}

.button--quiet {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--subtle);
  background: transparent;
  border-color: var(--line);
}

.button--danger {
  color: var(--red);
  background: var(--paper);
  border-color: #d8a09c;
}

.button--block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row > * {
  flex: 1 1 150px;
}

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

.metric {
  min-width: 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

.metric strong {
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.2;
}

.money-equation {
  margin: 13px 0 0;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.6;
}

.money-equation strong {
  color: var(--green);
}

.rating-stars {
  color: #bb7200;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.transaction-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(210px, 0.75fr);
  gap: 12px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 0;
}

.detail-list div {
  min-width: 0;
}

.detail-list dt {
  color: var(--subtle);
  font-size: 12px;
}

.detail-list dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.mock-photo {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  color: #3f2c0a;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 20%), transparent 45%),
    repeating-linear-gradient(135deg, #e9b64f 0 18px, #d89b28 18px 36px);
  border-radius: 12px;
  text-align: center;
}

.mock-photo span {
  padding: 8px 12px;
  background: rgb(255 255 255 / 84%);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.daily-list,
.assignment-list,
.stack {
  display: grid;
  gap: 12px;
}

.assignment {
  padding: 16px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.assignment-head {
  margin-bottom: 12px;
}

.assignment-head p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 13px;
}

.daily-card {
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.daily-card h4 {
  margin: 0;
  font-size: 15px;
}

.daily-card p {
  margin: 7px 0 0;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.55;
}

.daily-card .button-row,
.daily-card .field,
.daily-card > .button {
  margin-top: 12px;
}

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

.field {
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #afa89d;
  border-radius: 10px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.55;
}

.field small,
.help-text {
  display: block;
  margin-top: 6px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.55;
}

.field input[readonly] {
  color: var(--subtle);
  background: #f1efe9;
}

.field-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.photo-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fbfaf7;
  border: 1px dashed #afa89d;
  border-radius: 12px;
}

.photo-state {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
}

.quote-box {
  position: sticky;
  bottom: calc(70px + var(--safe-bottom));
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: center;
  margin-top: 20px;
  padding: 16px;
  background: #fff8e9;
  border: 1px solid #e4bd67;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgb(32 36 42 / 12%);
}

.quote-box p,
.quote-box strong {
  margin: 0;
}

.quote-box p {
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.55;
}

.quote-box strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
}

.notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: var(--subtle);
  background: #f1efe9;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}

.notice--warning {
  color: #603c00;
  background: var(--amber-soft);
}

.notice--danger {
  color: #76231f;
  background: var(--red-soft);
}

.back-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -8px 0 12px;
  padding: 6px 0;
  color: var(--amber-deep);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.empty-state {
  padding: 28px 18px;
  color: var(--subtle);
  background: var(--paper);
  border: 1px dashed #bdb6aa;
  border-radius: 14px;
  text-align: center;
  line-height: 1.65;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.bottom-nav {
  position: sticky;
  z-index: 20;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: calc(66px + var(--safe-bottom));
  padding: 7px 10px var(--safe-bottom);
  background: rgb(255 255 255 / 96%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-nav--single {
  grid-template-columns: 1fr;
}

.nav-button {
  min-height: 52px;
  padding: 6px 10px;
  color: var(--subtle);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.nav-button[aria-current="page"] {
  color: var(--ink);
  background: var(--amber-soft);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: calc(20px + var(--safe-bottom));
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 11px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 22%);
  font-size: 14px;
  line-height: 1.5;
}

.no-script {
  margin: 24px;
  padding: 14px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 10px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden,
[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .site-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .guide-panel {
    display: none;
  }

  .app-frame {
    min-height: calc(100vh - 61px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

@media (max-width: 620px) {
  .demo-banner {
    justify-content: flex-start;
    padding: 8px 12px;
    font-size: 12px;
  }

  .demo-banner span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .app-header {
    display: block;
    padding: 14px 16px 12px;
  }

  .app-header .brand {
    margin-bottom: 11px;
  }

  .role-switch {
    width: 100%;
  }

  .role-button {
    flex: 1;
  }

  .page {
    padding: 20px 16px 26px;
  }

  .hero {
    padding: 21px 18px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .button {
    width: 100%;
    margin-top: 14px;
  }

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

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

  .field--full {
    grid-column: auto;
  }

  .quote-box {
    grid-template-columns: 1fr;
    bottom: calc(68px + var(--safe-bottom));
  }

  .quote-box .button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-header {
    padding-right: 12px;
    padding-left: 12px;
  }

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

  .button-row > * {
    flex-basis: 100%;
  }
}

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