:root {
  --ink: #17211d;
  --paper: #f4f1e8;
  --card: rgba(255, 255, 255, .72);
  --line: rgba(23, 33, 29, .13);
  --accent: #ff5a36;
  --green: #1a7554;
  --lime: #c9ef75;
  --muted: #6f7772;
  --shadow: 0 18px 50px rgba(44, 52, 45, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 239, 117, .55), transparent 34rem),
    radial-gradient(circle at 0% 45%, rgba(255, 90, 54, .10), transparent 25rem),
    var(--paper);
}
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.shell { width: min(100%, 760px); margin: auto; padding: max(18px, env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom)); }
.hero { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 2px 28px; }
.eyebrow, .section-label { font-size: 10px; letter-spacing: .17em; font-weight: 800; color: var(--green); }
.hero h1 { margin: 10px 0 0; font-family: "Unbounded", sans-serif; font-size: clamp(30px, 8.5vw, 56px); line-height: .98; letter-spacing: -.055em; }
.hero h1 span { color: var(--accent); }
.live-dot { display: flex; gap: 7px; align-items: center; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .12em; background: rgba(255,255,255,.5); }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: #32ac6d; box-shadow: 0 0 0 4px rgba(50,172,109,.13); }
.cabinet-card, .safety-card, .operation, .report, .admin-panel { border: 1px solid var(--line); border-radius: 24px; background: var(--card); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.cabinet-card { padding: 20px; margin-bottom: 14px; }
.cabinet-top, .section-heading { display: flex; align-items: center; justify-content: space-between; }
.cabinet-card h2 { margin: 16px 0 4px; font-size: 24px; letter-spacing: -.04em; }
.muted { margin: 0; color: var(--muted); font-size: 13px; }
.icon-button { border: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: white; cursor: pointer; font-size: 18px; }
.token-line { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.token-line b { color: var(--green); font-size: 9px; letter-spacing: .1em; }
.safety-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 18px 20px; }
.safety-copy h2 { margin: 7px 0 3px; font-size: 18px; letter-spacing: -.035em; }
.safety-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.toggle-button { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 108px; padding: 8px 10px; border: 0; border-radius: 999px; color: white; background: var(--green); cursor: pointer; transition: background .18s ease, opacity .18s ease; }
.toggle-button i { position: relative; width: 28px; height: 16px; border-radius: 999px; background: rgba(255,255,255,.32); }
.toggle-button i::after { content: ""; position: absolute; width: 12px; height: 12px; top: 2px; right: 2px; border-radius: 50%; background: white; transition: transform .18s ease; }
.toggle-button span { font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.toggle-button.is-off { background: #b4402a; }
.toggle-button.is-off i::after { transform: translateX(-12px); }
.toggle-button:disabled { opacity: .55; cursor: wait; }
.operation { position: relative; overflow: hidden; padding: 24px; color: white; background: var(--ink); }
.operation::after { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; top: -95px; border: 38px solid rgba(201,239,117,.15); border-radius: 50%; }
.operation .section-label { color: var(--lime); }
.operation h2 { margin: 12px 0 7px; font-size: 24px; letter-spacing: -.04em; }
.operation p { max-width: 480px; margin: 0 0 22px; color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.55; }
.primary-button, .stop-button, .download-button { position: relative; z-index: 1; width: 100%; min-height: 54px; border: 0; border-radius: 16px; cursor: pointer; font-weight: 800; }
.primary-button { display: flex; justify-content: space-between; align-items: center; padding: 0 18px; background: var(--lime); color: var(--ink); }
.primary-button i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: white; font-style: normal; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.stop-button { margin-top: 9px; background: rgba(255,255,255,.09); color: #ffad9b; border: 1px solid rgba(255,255,255,.12); }
.timer { position: absolute; right: 24px; top: 25px; color: var(--lime); font-family: "Unbounded"; font-size: 13px; }
.report { margin-top: 14px; padding: 22px 18px; }
.section-heading h2 { margin: 7px 0 0; font-size: 18px; letter-spacing: -.03em; }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 800; cursor: pointer; }
.empty-state { margin-top: 18px; padding: 25px 18px; border-radius: 16px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: 13px; }
.report-overview { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding: 15px 6px; border-radius: 17px; background: var(--ink); color: white; }
.report-overview div { padding: 0 10px; border-right: 1px solid rgba(255,255,255,.12); }
.report-overview div:last-child { border-right: 0; }
.report-overview strong { display: block; font-family: "Unbounded"; color: var(--lime); font-size: 18px; letter-spacing: -.05em; }
.report-overview span { color: rgba(255,255,255,.55); font-size: 9px; }
.result-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 15px; }
.result-nav button { min-height: 72px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); text-align: left; background: rgba(255,255,255,.46); cursor: pointer; transition: .16s ease; }
.result-nav button span { font-size: 10px; font-weight: 800; }
.result-nav button strong { font-family: "Unbounded"; font-size: 18px; }
.result-nav button.active { color: white; background: var(--accent); border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 9px 22px rgba(255,90,54,.22); }
.result-detail { margin-top: 10px; padding: 19px 14px 14px; border-radius: 18px; background: rgba(23,33,29,.045); border: 1px solid var(--line); animation: reveal .24s ease both; }
.result-detail h3 { margin: 8px 0 0; font-family: "Unbounded"; font-size: 17px; letter-spacing: -.04em; }
.result-detail > p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.result-detail .primary-button { margin-top: 8px; }
.full-report { margin-top: 12px; }
.top-list { display: grid; gap: 7px; margin: 13px 0; }
.top-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center; padding: 10px; border-radius: 13px; background: white; }
.top-item > b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--lime); font-size: 10px; }
.top-item div { min-width: 0; }
.top-item strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.top-item small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.top-item em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
.metric { min-height: 105px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; border: 0; border-radius: 17px; color: var(--ink); text-align: left; background: rgba(23,33,29,.055); }
.metric-main { background: var(--accent); color: white; }
.metric span { font-size: 11px; font-weight: 700; opacity: .72; }
.metric strong { font-family: "Unbounded"; font-size: 26px; letter-spacing: -.05em; }
.metric small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.metric-action { cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,90,54,.18); transition: transform .16s ease, background .16s ease; }
.metric-action:active { transform: scale(.98); background: rgba(255,90,54,.08); }
.warnings { margin-top: 12px; padding: 13px; border-radius: 14px; background: #fff2cb; color: #6f5411; font-size: 11px; line-height: 1.5; }
.download-row { display: grid; gap: 8px; margin-top: 12px; }
.download-button { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; background: var(--ink); color: white; }
.download-button.secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.download-button span { font-size: 20px; }
.admin-panel { margin-top: 14px; padding: 20px; }
.queue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.queue-card { padding: 12px 9px; border-radius: 14px; background: rgba(23,33,29,.055); text-align: center; }
.queue-card b { display: block; margin-bottom: 4px; font-size: 18px; }
.queue-card span { color: var(--muted); font-size: 9px; }
dialog { width: min(calc(100% - 28px), 520px); padding: 0; border: 0; border-radius: 26px; color: var(--ink); background: #fffdf7; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(9,18,14,.56); backdrop-filter: blur(7px); }
dialog form { position: relative; padding: 28px 20px 20px; }
dialog h2 { margin: 10px 0 8px; font-family: "Unbounded"; font-size: 22px; }
dialog p { color: var(--muted); font-size: 12px; line-height: 1.55; }
dialog label { display: block; margin: 22px 0 8px; font-size: 11px; font-weight: 800; }
dialog textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 15px; padding: 13px; color: var(--ink); background: #f5f3ec; outline: none; font-size: 11px; }
dialog textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,54,.10); }
.dialog-close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; font-size: 22px; background: #eeeae0; }
.form-error { color: #a52d18; background: #ffe4dd; border-radius: 10px; padding: 10px; }
.category-count { display: flex; gap: 14px; align-items: center; margin: 22px 0; padding: 18px; border-radius: 18px; background: var(--ink); color: white; }
.category-count strong { font-family: "Unbounded"; color: var(--lime); font-size: 38px; letter-spacing: -.06em; }
.category-count span { color: rgba(255,255,255,.65); font-size: 11px; line-height: 1.45; }
.result-detail .download-button { margin: 18px 0 9px; }
.result-detail .form-error { margin-top: 12px; }
.category-empty { margin: 15px 0 4px; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.45); text-align: center; font-size: 12px; font-weight: 700; }
.is-loading { opacity: .55; pointer-events: none; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 500px); padding: 13px 16px; border-radius: 14px; background: var(--ink); color: white; box-shadow: var(--shadow); text-align: center; font-size: 12px; font-weight: 700; }
.skeleton { height: 22px; margin-top: 18px; border-radius: 9px; background: linear-gradient(90deg, #ebe8df 25%, #f8f6f0 45%, #ebe8df 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.skeleton.wide { width: 72%; }
.reveal { opacity: 0; transform: translateY(10px); animation: reveal .5s ease forwards; }
.delay-1 { animation-delay: .07s; }.delay-2 { animation-delay: .14s; }.delay-3 { animation-delay: .21s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@media (min-width: 620px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .download-row { grid-template-columns: repeat(3, 1fr); } .download-button { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; } }

/* Mini App navigation and focused screens */
.screen { display: none; }
.screen.active { display: block; animation: reveal .28s ease both; }
.screen .reveal { opacity: 1; transform: none; animation: none; }
.hero { align-items: center; padding: 7px 2px 16px; }
.hero h1 { max-width: 390px; margin-top: 6px; font-size: clamp(23px, 6.4vw, 40px); line-height: 1.04; }
.hero h1 br { display: none; }
.live-dot { max-width: 105px; margin: 0; padding: 7px 9px; font-size: 8px; line-height: 1.2; letter-spacing: .06em; }
.compact-card { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; }
.compact-card h2 { margin: 7px 0 2px; font-size: 18px; }
.api-status { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; color: var(--green); font-size: 10px; font-weight: 800; }
.api-status svg { width: 14px; height: 14px; stroke-width: 2.4; }
.icon-button { display: grid; place-items: center; }
.icon-button svg { width: 17px; height: 17px; }
.operation { padding: 20px; }
.operation h2 { margin: 9px 0 5px; font-size: 21px; }
.operation p { margin-bottom: 17px; }
.primary-button svg, .download-button svg { position: relative; z-index: 1; width: 20px; height: 20px; }
.timer { right: 20px; top: 20px; }
.report { padding: 19px 16px; }
.report .section-heading { gap: 12px; }
.report .section-heading h2 { font-size: 16px; }
.result-nav { grid-template-columns: 1fr; gap: 8px; }
.result-nav button { position: relative; min-height: 76px; display: grid; grid-template-columns: 40px 1fr auto 20px; grid-template-rows: 1fr 1fr; column-gap: 11px; align-items: center; padding: 12px 13px; }
.result-nav button .metric-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--green); background: rgba(26,117,84,.1); }
.result-nav button > span:not(.metric-icon) { align-self: end; font-size: 12px; }
.result-nav button strong { grid-column: 3; grid-row: 1 / 3; font-size: 22px; }
.result-nav button small { align-self: start; color: var(--muted); font-size: 9px; }
.result-nav button i { grid-column: 4; grid-row: 1 / 3; color: var(--muted); }
.result-nav button i svg { width: 17px; height: 17px; }
.warnings { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.warnings > div { display: flex; align-items: center; gap: 8px; }
.warnings svg { flex: 0 0 auto; width: 17px; height: 17px; }
.full-report { margin-top: 12px; }
.bottom-nav { position: fixed; z-index: 15; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 28px), 520px); display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; border: 1px solid rgba(23,33,29,.12); border-radius: 22px; background: rgba(255,253,247,.9); backdrop-filter: blur(20px); box-shadow: 0 18px 50px rgba(22,35,28,.2); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 7px; border: 0; border-radius: 15px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.bottom-nav button svg { width: 19px; height: 19px; }
.bottom-nav button.active { color: white; background: var(--ink); }
.toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
.page-header { padding: 13px 3px 20px; }
.page-header h1 { margin: 8px 0 6px; font-family: "Unbounded", sans-serif; font-size: clamp(30px, 8vw, 46px); letter-spacing: -.055em; }
.page-header > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.guide-card, .criteria-card, .profile-card, .last-result { margin-bottom: 12px; padding: 19px; border: 1px solid var(--line); border-radius: 21px; background: var(--card); box-shadow: var(--shadow); }
.guide-card { position: relative; padding-left: 72px; }
.guide-card .step { position: absolute; left: 18px; top: 19px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--accent); font-family: "Unbounded"; font-size: 11px; }
.guide-card h2, .criteria-card h2, .profile-card h2 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.03em; }
.guide-card p, .criteria-card dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.criteria-card h2 { margin-top: 8px; }
.criteria-card dl { margin: 15px 0 0; }
.criteria-card dl div { padding: 12px 0; border-top: 1px solid var(--line); }
.criteria-card dt { margin-bottom: 4px; font-size: 12px; font-weight: 800; }
.profile-card .download-button { margin-top: 16px; }
.profile-card.small { padding: 17px 19px; }
.profile-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 13px; font-size: 12px; }
.profile-row span { color: var(--muted); }
.profile-row strong { text-align: right; }
.safety-card { border-radius: 21px; box-shadow: var(--shadow); }
.back-button { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.6); font-size: 11px; font-weight: 800; cursor: pointer; }
.back-button svg { width: 16px; height: 16px; }
.category-header { padding-bottom: 14px; }
.category-header h1 { font-size: clamp(28px, 7vw, 42px); }
.action-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; padding: 16px 8px; border-radius: 20px; color: white; background: var(--ink); }
.action-stats.simple { grid-template-columns: 1fr; }
.action-stats div { padding: 0 10px; border-right: 1px solid rgba(255,255,255,.12); }
.action-stats div:last-child { border: 0; }
.action-stats strong { display: block; color: var(--lime); font-family: "Unbounded"; font-size: clamp(20px, 6vw, 31px); letter-spacing: -.05em; }
.action-stats span { color: rgba(255,255,255,.58); font-size: 9px; }
.last-result { display: flex; align-items: center; gap: 11px; padding: 14px 16px; color: #16583f; background: #e6f5d1; box-shadow: none; }
.last-result > svg { flex: 0 0 auto; width: 23px; height: 23px; }
.last-result strong, .last-result span { display: block; font-size: 11px; }
.last-result span { margin-top: 3px; opacity: .72; }
#screen-category .primary-button, #screen-category .download-button { margin-top: 10px; }
.gate-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; }
.gate-screen h1 { margin: 11px 0 7px; font-family: "Unbounded"; font-size: 32px; letter-spacing: -.05em; }
.gate-screen > p:not(.eyebrow) { max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.gate-icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 24px; color: white; background: var(--ink); }
.gate-icon svg { width: 32px; height: 32px; }
.user-id { min-width: 230px; margin-top: 13px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.user-id span, .user-id strong { display: block; }
.user-id span { color: var(--muted); font-size: 9px; }
.user-id strong { margin-top: 4px; font-family: "Unbounded"; font-size: 18px; }
.loader { width: 38px; height: 38px; border: 4px solid rgba(26,117,84,.17); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.warning-list { display: grid; gap: 9px; margin-top: 16px; }
.warning-list p { margin: 0; padding: 12px; border-radius: 12px; color: #6f5411; background: #fff2cb; }
.queue-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 620px) { .result-nav { grid-template-columns: repeat(2, 1fr); } }
