:root {
  --bg: #edf0e8;
  --surface: #ffffff;
  --surface-soft: #f5f6f1;
  --ink: #152420;
  --muted: #66736b;
  --faint: #8d9891;
  --line: #d6dccf;
  --primary: #153e37;
  --primary-2: #2c5c52;
  --primary-soft: #dce8e1;
  --gold: #b8902e;
  --gold-soft: #f5e9c8;
  --danger: #b84832;
  --danger-soft: #f7e1da;
  --success: #347452;
  --success-soft: #dcecdf;
  --shadow: 0 12px 34px rgba(21, 36, 32, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.mobile-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(21, 36, 32, .12);
}

.topbar {
  padding: 18px 18px 16px;
  background: var(--primary);
  color: #fff;
}

.topbar-line, .row, .between {
  display: flex;
  align-items: center;
  gap: 12px;
}

.between { justify-content: space-between; }
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-style: italic; font-weight: 700; }
.topbar-sub { margin-top: 12px; color: rgba(255,255,255,.76); font-size: 13px; }
.avatar { width: 40px; height: 40px; border-radius: 8px; background: var(--gold); color: #30240b; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.avatar.service { background: #fff; color: var(--primary); }

.content { flex: 1; padding: 18px 16px 94px; }
.section { margin-bottom: 22px; }
.section-title { margin: 0 0 10px; font-size: 17px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 750; }
h1, h2, h3, p { overflow-wrap: anywhere; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
}

.card.highlight { background: var(--primary); color: #fff; border-color: var(--primary); }
.card.highlight .muted { color: rgba(255,255,255,.72); }
.card.gold { background: var(--gold-soft); border-color: #e4cf92; }
.card.success { background: var(--success-soft); border-color: #bfdac7; }
.card.danger { background: var(--danger-soft); border-color: #ecc4b8; }
.plan-title { font-family: Georgia, "Times New Roman", serif; font-size: 27px; margin: 2px 0 5px; }
.price { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; }
.metric { font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 700; line-height: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 9px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; }
.badge.success { background: var(--success-soft); color: #245a3e; }
.badge.gold { background: var(--gold-soft); color: #6d5214; }
.badge.danger { background: var(--danger-soft); color: #7b2c1d; }
.highlight .badge { background: rgba(255,255,255,.14); color: #fff; }

.divider { height: 1px; background: var(--line); margin: 13px 0; }
.highlight .divider { background: rgba(255,255,255,.18); }
.list { display: grid; gap: 9px; }
.list-item { display: flex; gap: 11px; align-items: flex-start; }
.check { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 900; flex: 0 0 auto; }
.highlight .check { background: rgba(255,255,255,.15); color: #fff; }

.btn {
  border: 0;
  border-radius: 7px;
  padding: 11px 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  min-height: 42px;
}
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.gold { background: var(--gold); color: #30240b; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 8px 11px; min-height: 34px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.highlight .btn.secondary { background: #fff; color: var(--primary); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.nav {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav.four { grid-template-columns: repeat(4, 1fr); }
.nav button { border: 0; background: transparent; padding: 8px 2px; color: var(--faint); font-size: 10px; font-weight: 750; cursor: pointer; }
.nav button::before { content: ""; display: block; width: 22px; height: 3px; margin: 0 auto 6px; border-radius: 3px; background: transparent; }
.nav button.active { color: var(--primary); }
.nav button.active::before { background: var(--gold); }

.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.service-card { display: flex; min-height: 145px; flex-direction: column; justify-content: space-between; }
.service-card h3 { margin: 4px 0 5px; font-size: 15px; }
.service-card p { margin: 0; font-size: 12px; color: var(--muted); }
.service-card .btn { margin-top: 14px; }

.storage-box { display: grid; grid-template-columns: 92px 1fr; gap: 15px; align-items: center; }
.box-visual { height: 92px; border: 3px solid var(--primary); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }
.access-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; font-size: 18px; font-weight: 800; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--line); }
.timeline-item { position: relative; margin-bottom: 15px; }
.timeline-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--primary); border-radius: 50%; }

.profile-note { border-left: 3px solid var(--gold); padding: 8px 10px; background: var(--gold-soft); margin-bottom: 7px; font-size: 13px; }
.task-list label { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.task-list label:last-child { border-bottom: 0; }
.task-list input { width: 18px; height: 18px; accent-color: var(--primary); }

.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; font-size: 11px; color: var(--muted); }
.progress-track { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 5px; background: var(--line); }
.progress-track.large { height: 9px; margin-bottom: 18px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .25s ease; }
.task-workflow { display: grid; gap: 9px; }
.task-workflow-row { width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr) 30px; gap: 11px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.task-workflow-row img { width: 76px; height: 62px; border-radius: 5px; object-fit: cover; }
.task-workflow-main { min-width: 0; display: grid; gap: 4px; }
.task-workflow-main strong { font-size: 13px; }
.task-workflow-main small { color: var(--muted); font-size: 10px; }
.task-state { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 850; }
.task-state.success { background: var(--success-soft); color: var(--success); }
.task-state.danger { background: var(--danger-soft); color: var(--danger); }
.task-state.gold { background: var(--gold-soft); color: #6d5214; }
.guide-image-wrap { position: relative; margin: 12px 0; }
.guide-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.guide-image-wrap > span { position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 4px; background: rgba(21, 36, 32, .82); color: #fff; font-size: 10px; font-weight: 800; }
.guide-goal { border-left: 4px solid var(--primary); }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: guide-step; display: grid; gap: 8px; }
.guide-steps li { counter-increment: guide-step; position: relative; min-height: 34px; padding: 9px 10px 9px 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 12px; line-height: 1.45; }
.guide-steps li::before { content: counter(guide-step); position: absolute; left: 9px; top: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 10px; font-weight: 850; }
.deviation { padding: 12px; border-radius: 7px; border: 1px solid #e3c777; background: var(--gold-soft); color: #5d4614; font-size: 12px; line-height: 1.5; }
.photo-empty { display: grid; gap: 4px; padding: 18px; margin-bottom: 9px; border: 1px dashed var(--line); border-radius: 7px; background: var(--surface-soft); text-align: center; }
.photo-empty span { color: var(--muted); font-size: 11px; }
.photo-proof { display: grid; grid-template-columns: 92px 1fr; gap: 11px; align-items: center; margin-bottom: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.photo-proof img { width: 92px; height: 74px; border-radius: 5px; object-fit: cover; }
.camera-button { margin-top: 8px; }
.camera-only-note { margin: 7px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.live-camera { position: relative; overflow: hidden; aspect-ratio: 3 / 4; margin: 12px 0; border-radius: 8px; background: #101513; }
.live-camera video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; background: rgba(16, 21, 19, .7); }
.camera-actions { display: grid; grid-template-columns: 1fr 74px 1fr; align-items: center; gap: 12px; margin-top: 16px; }
.camera-actions .btn { grid-column: 1; }
.camera-shutter { grid-column: 2; width: 68px; height: 68px; padding: 5px; border: 3px solid var(--primary); border-radius: 50%; background: transparent; cursor: pointer; }
.camera-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--primary); }
.camera-shutter:disabled { opacity: .35; cursor: wait; }
.ai-panel { margin-top: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); font-size: 12px; }
.ai-panel.passed { border-color: #b8d7c2; background: var(--success-soft); }
.ai-panel.rework { border-color: #e7b9ac; background: var(--danger-soft); }
.ai-panel p { margin: 8px 0; color: var(--muted); line-height: 1.45; }
.ai-panel ul { margin: 8px 0; padding-left: 18px; }
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.quality-grid span { padding: 7px; border-radius: 5px; background: rgba(255,255,255,.6); font-size: 10px; }
.quality-grid b { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; }
.ai-disclaimer { margin-top: 10px; padding: 8px; border-left: 3px solid var(--gold); background: rgba(255,255,255,.55); color: var(--muted); font-size: 10px; line-height: 1.45; }
.table-proof { width: 72px; height: 54px; border-radius: 4px; object-fit: cover; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(9, 20, 17, .56); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: min(100%, 480px); max-height: 88vh; overflow: auto; background: var(--bg); padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; }
.modal h2 { margin: 2px 0 8px; font-size: 21px; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }

.toast { position: fixed; z-index: 70; left: 50%; bottom: 86px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); background: var(--ink); color: #fff; border-radius: 7px; padding: 10px 14px; font-size: 12px; box-shadow: var(--shadow); }

.manager-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.manager-side { background: var(--primary); color: #fff; padding: 22px 16px; }
.manager-side nav { display: grid; gap: 6px; margin-top: 28px; }
.manager-side button { text-align: left; padding: 11px; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.72); cursor: pointer; font-weight: 700; }
.manager-side button.active { background: rgba(255,255,255,.14); color: #fff; }
.manager-main { padding: 28px; max-width: 1200px; width: 100%; }
.manager-title { margin: 0 0 4px; font-size: 28px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.data-table th, .data-table td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.data-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-soft); }

.portal-shell { width: min(100% - 32px, 900px); margin: 0 auto; padding: 24px 0 50px; }
.portal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 50px; }
.demo-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.portal-intro { max-width: 620px; margin-bottom: 28px; }
.portal-intro h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 7vw, 58px); line-height: 1.03; margin: 0 0 14px; letter-spacing: 0; }
.portal-intro p:last-child { color: var(--muted); line-height: 1.6; }
.portal-grid { display: grid; gap: 10px; }
.app-choice { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.app-choice:hover { border-color: var(--primary-2); }
.app-choice h2 { margin: 0 0 4px; font-size: 18px; }
.app-choice p { margin: 0; color: var(--muted); font-size: 13px; }
.choice-index { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); font-weight: 800; }

@media (max-width: 800px) {
  .manager-shell { display: block; }
  .manager-side { padding: 14px 16px; }
  .manager-side nav { grid-template-columns: repeat(5, minmax(80px, 1fr)); margin-top: 14px; overflow-x: auto; }
  .manager-side button { text-align: center; white-space: nowrap; font-size: 11px; }
  .manager-main { padding: 20px 14px 40px; overflow-x: auto; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .service-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .storage-box { grid-template-columns: 76px 1fr; }
  .box-visual { height: 76px; }
}
