:root {
  --ink: #17191e; --muted: #6b6f78; --line: #e6e3dc; --bg: #f4f2ed; --card: #fff; --soft: #faf8f4;
  --brand: #f0641e; --brand-d: #d5530f; --ok: #1f8a4c; --okbg: #e8f6ee; --warn: #9a5b00; --warnbg: #fff4dd; --err: #c0392b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; font-size: 18px; letter-spacing: -.01em; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; color: #c9ccd3; white-space: nowrap; }
nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: 0 1px 0 var(--line); margin-bottom: 14px; }
h1 { font-size: 24px; margin: 4px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.small { font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
input, textarea, select { font: inherit; font-size: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: #ece9e2; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.big { padding: 15px 20px; font-size: 17px; width: 100%; }
.btn.link { background: none; padding: 6px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.err { color: var(--err); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* mic */
.mic { width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 50px; cursor: pointer; display: grid; place-items: center; margin: 6px auto 10px; box-shadow: 0 10px 30px rgba(240,100,30,.35); transition: transform .15s; }
.mic:active { transform: scale(.96); }
.mic.rec { background: var(--err); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192,57,43,.5); } 70% { box-shadow: 0 0 0 22px rgba(192,57,43,0); } 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); } }
.hint { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.hint b { color: var(--ink); font-weight: 600; }

/* items editor */
.items { width: 100%; border-collapse: collapse; font-size: 14px; }
.items th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.items td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items input { padding: 8px; font-size: 15px; border-radius: 8px; }
.items .q { width: 78px; } .items .u { width: 64px; } .items .p { width: 96px; }
.items .s { text-align: right; white-space: nowrap; font-weight: 600; width: 90px; }
.items tr.flag input.p { background: var(--warnbg); border-color: #f0c36a; }
.items tr.flag2 input.q { background: var(--warnbg); border-color: #f0c36a; }
.items tr.room td { background: var(--soft); font-weight: 700; padding: 8px; }
.items .x { background: none; border: 0; color: #b3b6bd; font-size: 18px; cursor: pointer; padding: 4px 6px; }
.totals { margin-left: auto; max-width: 320px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .t { font-size: 22px; font-weight: 800; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.warn { background: var(--warnbg); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }

/* rooms & onboarding */
.rooms { margin: 6px 0 12px; }
.roomcard { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.geo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.geo label { margin: 0; font-size: 12px; }
.geo input { padding: 8px; font-size: 15px; margin-top: 2px; }
.keyrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.keyrow input { width: 110px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.chipbtn.on { border-color: var(--brand); background: #fff3ec; color: var(--brand-d); }

/* list */
.est { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.est:last-child { border-bottom: 0; }
.est .t { font-weight: 600; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; background: #eceae4; color: var(--muted); white-space: nowrap; }
.chip.viewed { background: #e7effd; color: #2456c7; }
.chip.accepted { background: var(--okbg); color: var(--ok); }
.chip.pro { background: var(--ink); color: #fff; }
.ev { padding: 10px 12px; background: #fff7f1; border-radius: 12px; margin-bottom: 8px; font-size: 14px; }
.ev.old { background: var(--soft); color: var(--muted); }
.empty { text-align: center; padding: 26px 10px; }
.empty .big { font-size: 46px; }

/* share */
.share { display: grid; gap: 8px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 14px; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { border: 2px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; }
.plan.best { border-color: var(--brand); }
.plan .price { font-size: 28px; font-weight: 800; margin: 6px 0; }
.plan ul { padding-left: 18px; margin: 8px 0 14px; font-size: 14px; }
.meter { height: 8px; background: #eceae4; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.meter i { display: block; height: 100%; background: var(--brand); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 50; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.auth { max-width: 420px; margin: 20px auto; }
.tabs { display: flex; background: #ece9e2; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 12px; font-weight: 400; }
.check input { width: auto; margin-top: 2px; }

@media (max-width: 600px) {
  .wrap { padding: 12px; }
  .card { padding: 14px; border-radius: 16px; }
  .grid2, .grid3, .plans { grid-template-columns: 1fr; }
  .geo { grid-template-columns: 1fr 1fr; }
  .items thead { display: none; }
  .items tr.it { display: grid; grid-template-columns: 1fr 70px 56px 86px 30px; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .items tr.it td { border: 0; padding: 0; }
  .items tr.it td.nm { grid-column: 1 / -1; }
  .items tr.it td.s { grid-column: 1 / 2; grid-row: 2; text-align: left; align-self: center; }
  .items .q, .items .u, .items .p { width: 100%; }
  .items tr.room { display: block; }
  .items tr.room td { display: block; }
}
