:root {
  --ink: #13233f; --navy: #0f2547; --navy-2: #132d55; --teal: #0e7c86; --teal-2: #2ec4b6; --amber: #f0b44c;
  --bg: #f5f7fa; --card: #fff; --line: #e3e7ee; --muted: #66758c; --red: #c2413b; --green: #1f8a5b;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,33,63,.06), 0 6px 24px rgba(16,33,63,.06);
  --serif: 'Source Serif 4', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; color: var(--navy); font-weight: 600; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.row { display: flex; align-items: center; }
.gap { gap: 12px; flex-wrap: wrap; }
.gap-s { gap: 8px; }
.mt { margin-top: 1.4em; }
.pad { padding: 12px 16px; }
[hidden] { display: none !important; }
.mobile-only { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem var(--sans); padding: 10px 18px; border-radius: 9px; border: 1.5px solid transparent; cursor: pointer; transition: .15s; text-decoration: none !important; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0b6971; }
.btn-outline { border-color: var(--teal); color: var(--teal); background: #fff; }
.btn-outline:hover:not(:disabled) { background: #eaf6f7; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-outline { border-color: #e7b5b2; color: var(--red); background: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.link { background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; padding: 0; font-weight: 600; }
.icon-btn { background: none; border: 0; cursor: pointer; color: inherit; font-size: 1.3rem; padding: 6px; position: relative; }
.menu-btn { display: none; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none !important; }
.logo-mark svg { width: 34px; height: 34px; display: block; }
.logo-text { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.logo-text b { color: var(--teal); font-weight: 700; }

/* public site */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .row { height: 68px; gap: 24px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--ink); font-weight: 500; }
.site-actions { display: flex; gap: 10px; }
.hero { background: radial-gradient(1200px 500px at 80% -10%, #dff3f4 0, transparent 60%), linear-gradient(#fff, var(--bg)); padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.02em; }
.hero h1 em { color: var(--teal); font-style: italic; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 700; color: var(--teal); margin-bottom: .6em; }
.lead { font-size: 1.12rem; color: #3c4a61; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgba(15,37,71,.25)); }
.section { padding: 64px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-table { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pt-row { display: grid; grid-template-columns: 1fr 170px 120px 110px; gap: 16px; padding: 18px 22px; align-items: center; border-top: 1px solid var(--line); }
.pt-head { background: var(--navy); color: #fff; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
.pt-name { font-weight: 500; }
.pt-turn { color: var(--muted); font-size: .92rem; }
.pt-price b { font-size: 1.3rem; color: var(--navy); font-family: var(--serif); }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; position: relative; }
.steps li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.steps li:not(:last-child)::after { content: '→'; position: absolute; right: -16px; top: 30px; color: var(--teal); font-weight: 700; font-size: 1.2rem; }
.step-num { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cards { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.team { display: flex; gap: 16px; }
.avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--serif); }
.confid { display: flex; gap: 24px; align-items: flex-start; }
.shield { color: var(--teal); flex: none; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: #3c4a61; }
.site-footer { background: var(--navy); color: #cfd7e4; padding: 40px 0; }
.site-footer .logo { color: #fff; }
.site-footer .muted { color: #9fb0c8; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #fff; }
.copy { grid-column: 1 / -1; border-top: 1px solid #ffffff22; padding-top: 16px; margin: 0; }
.legal h2 { margin-top: 1.6em; font-size: 1.15rem; }
.legal li { margin-bottom: .4em; }

/* auth */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(900px 400px at 50% -10%, #dff3f4, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-logo { margin-bottom: 18px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .8rem; color: var(--muted); }
input, select, textarea { font: inherit; color: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; width: 100%; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #0e7c8620; }
input:disabled { background: #f1f3f6; color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex: none; margin-top: 3px; accent-color: var(--teal); }
input[type=file] { padding: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; margin: 6px 0; }
.attest { background: #fff8e8; border: 1px solid #f3dca8; border-radius: 10px; padding: 14px; }
.form-error { color: var(--red); font-size: .9rem; min-height: 0; }
.form-error:empty { display: none; }
.form-links { display: flex; justify-content: space-between; font-size: .9rem; flex-wrap: wrap; gap: 8px; }
.notice { background: #eef6f7; border-radius: 9px; padding: 10px 14px; margin: 0; }
.file-box { display: flex; flex-direction: column; gap: 6px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 12px; background: #fafbfc; }
.progress { height: 6px; background: #e8edf3; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--teal); transition: width .2s; }

/* app shell */
.app-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.app-header .row { height: 62px; gap: 20px; }
.app-header .logo { color: #fff; }
.app-header .logo-text b { color: var(--teal-2); }
.app-nav { display: flex; gap: 4px; margin-left: 12px; }
.app-nav a { color: #c9d4e6; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.app-nav a:hover { background: #ffffff14; text-decoration: none; color: #fff; }
.app-nav a.active { background: #ffffff1f; color: #fff; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-right .btn-ghost { color: #fff; border-color: #ffffff40; }
.header-right .btn-ghost:hover { background: #ffffff14; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #eef1f5; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-pill { background: var(--amber); color: var(--navy); }
.badge { position: absolute; top: 0; right: -2px; background: var(--amber); color: var(--navy); font-size: .68rem; font-weight: 800; border-radius: 99px; padding: 1px 6px; }
.notif-panel { position: absolute; right: 20px; top: 60px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.notif-head { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.notif-item { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.notif-item small { color: var(--muted); }
.notif-item.unread { background: #eef7f8; border-left: 3px solid var(--teal); }
.notif-item:hover { text-decoration: none; background: #f6f8fb; }
.app-main { padding: 28px 20px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.price-tag { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--navy); }
.back { display: inline-block; margin-bottom: 12px; font-size: .9rem; }

/* status pills */
.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.st-sub { background: #e8eefc; color: #2c4fb3; }
.st-rej { background: #fbe9e8; color: var(--red); }
.st-pay { background: #fff2d8; color: #9a6400; }
.st-paid { background: #e2f5ec; color: var(--green); }
.st-prog { background: #e6f4f5; color: var(--teal); }
.st-del { background: #e9f7ef; color: #16794b; }
.st-amd { background: #f3e9fb; color: #7a3fb0; }
.st-closed { background: #eceff3; color: #56637a; }

/* lists */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; color: var(--ink); box-shadow: var(--shadow); }
.req-row:hover { text-decoration: none; border-color: var(--teal); }
.req-row-right { display: flex; align-items: center; gap: 10px; }
.dot-badge { background: var(--amber); color: var(--navy); border-radius: 99px; font-size: .72rem; font-weight: 800; padding: 2px 8px; margin-left: 6px; }
.empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.svc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .15s; }
.svc-card:hover { border-color: var(--teal); transform: translateY(-2px); text-decoration: none; }
.svc-card p { color: var(--muted); font-size: .92rem; flex: 1; }
.svc-meta { display: flex; justify-content: space-between; align-items: baseline; }
.svc-meta b { font-family: var(--serif); font-size: 1.25rem; color: var(--navy); }
.confirm-card { text-align: center; max-width: 560px; margin: 30px auto; padding: 40px; }
.confirm-card .row { justify-content: center; }
.big-check { width: 64px; height: 64px; border-radius: 50%; background: #e2f5ec; color: var(--green); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 16px; }

/* request page */
.req-grid { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.req-side { position: sticky; top: 80px; }
.timeline { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; }
.tl-step { flex: 1; min-width: 92px; text-align: center; font-size: .78rem; font-weight: 600; padding: 8px 6px; border-radius: 8px; background: #eceff3; color: var(--muted); }
.tl-step.done { background: #d9efe5; color: var(--green); }
.tl-step.current { background: var(--teal); color: #fff; }
.tl-step.rej { background: #fbe9e8; color: var(--red); }
.dl { display: grid; grid-template-columns: 210px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { font-weight: 600; color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; white-space: pre-wrap; }
.note { background: #f3e9fb; border-radius: 9px; padding: 12px 14px; margin: 12px 0; }
.note p { margin: 6px 0 0; white-space: pre-wrap; }
.history summary { cursor: pointer; color: var(--teal); font-weight: 600; margin-top: 12px; }
.history ul { padding-left: 18px; font-size: .9rem; }
.files { list-style: none; padding: 0; margin: 0; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.file-row:first-child { border-top: 0; }
.uploader { margin-top: 16px; background: #fafbfc; border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px; }
.uploader input[type=file] { flex: 1; min-width: 200px; }
.upload-item { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: center; font-size: .88rem; margin-top: 8px; }
.upload-item.ok span::after { content: ' ✓'; color: var(--green); }
.upload-item.fail span { color: var(--red); }
.alert-pay { border-left: 4px solid var(--amber); }
.alert-del { border-left: 4px solid var(--green); }
.alert-rej { border-left: 4px solid var(--red); }
.admin-act { border-left: 4px solid var(--teal); }
.notice-list { padding-left: 18px; }
.reminder { background: #fff2d8; color: #8a5a00; padding: 8px 12px; border-radius: 8px; font-weight: 600; margin-bottom: 10px; }
.msg-card { display: flex; flex-direction: column; }
.msgs { max-height: 440px; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: .92rem; }
.msg.mine { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: #eef1f5; border-bottom-left-radius: 4px; }
.msg-meta { font-size: .72rem; opacity: .75; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* admin */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: left; cursor: pointer; font: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--ink); }
.stat b { font-family: var(--serif); font-size: 2rem; color: var(--navy); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.stat.on { border-color: var(--teal); box-shadow: 0 0 0 2px #0e7c8633; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font: 600 .86rem var(--sans); cursor: pointer; color: var(--ink); }
.tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f4f9fa; }
.search { max-width: 460px; margin-bottom: 16px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* modal & toast */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,22,44,.5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-body { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(460px, calc(100vw - 24px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .92rem; transition: .4s; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(10px); }
.spinner-wrap { display: grid; place-items: center; padding: 40px; }
.spinner { width: 34px; height: 34px; border: 3px solid #d7dee8; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
#boot { min-height: 100vh; display: grid; place-items: center; }

/* responsive */
@media (max-width: 960px) {
  .hero-grid, .two-col, .req-grid, .settings-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 480px; }
  .req-side { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li::after { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; margin-left: auto; }
  .site-nav, .app-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 10px 20px 16px; gap: 4px; margin: 0; }
  .site-nav { background: #fff; border-bottom: 1px solid var(--line); }
  .app-nav { background: var(--navy-2); }
  .site-nav.open, .app-nav.open { display: flex; }
  .app-nav .mobile-only { display: block; }
  .site-actions .btn-ghost { display: none; }
  .header-right { margin-left: 0; }
  .header-right .btn-ghost { display: none; }
  .site-header .row, .app-header .row { gap: 10px; }
  .pt-row { grid-template-columns: 1fr auto; }
  .pt-head { display: none; }
  .pt-name { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dd { margin-bottom: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .upload-item { grid-template-columns: 1fr; }
}
.page-head > div:first-child { flex: 1; min-width: 260px; }
