:root {
  --brand: #9f2f25;
  --brand-dark: #742018;
  --brand-soft: #f4e5df;
  --ink: #28221f;
  --muted: #756c68;
  --line: #e8dfda;
  --paper: #fffaf6;
  --surface: #ffffff;
  --canvas: #f6f0eb;
  --jade: #3e6c59;
  --warning: #9b5b12;
  --warning-soft: #fff3dd;
  --danger: #a52a2a;
  --shadow: 0 12px 36px rgba(74, 41, 27, .10);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 8% 0%, #f5ddd2 0, transparent 32%), linear-gradient(180deg, #fbf6f1 0%, var(--canvas) 48%); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid rgba(159, 47, 37, .24); outline-offset: 2px; }

.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; background: rgba(255,255,255,.38); position: relative; box-shadow: 0 0 0 1px rgba(98,64,48,.05); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(255,250,246,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(232,223,218,.82); }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; text-align: left; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px 14px 14px 5px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #c74b3c, var(--brand-dark)); font-family: "STKaiti", "KaiTi", serif; font-size: 22px; box-shadow: 0 7px 18px rgba(127,35,27,.23); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 16px; letter-spacing: .03em; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.78); display: grid; place-items: center; }

main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
.view { animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.hero { position: relative; overflow: hidden; padding: 22px 20px; border-radius: 26px; color: white; background: linear-gradient(135deg, #8f2a22 0%, #b94636 57%, #d7774e 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 180px; height: 180px; border: 28px solid rgba(255,255,255,.08); border-radius: 50%; right: -78px; top: -75px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .12em; opacity: .9; }
.hero h1 { margin: 11px 0 7px; font-family: "STKaiti", "KaiTi", serif; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: .04em; }
.hero p { margin: 0; max-width: 330px; color: rgba(255,255,255,.84); font-size: 13px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-button { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.14); color: white; border-radius: 12px; padding: 10px 13px; font-size: 13px; }
.hero-button.primary { background: white; color: var(--brand-dark); border-color: white; font-weight: 700; }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.link-button, .text-button { border: 0; background: transparent; color: var(--brand); font-size: 13px; font-weight: 650; padding: 5px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { padding: 14px 10px; background: rgba(255,255,255,.88); border: 1px solid rgba(232,223,218,.9); border-radius: 16px; text-align: center; }
.stat strong { display: block; color: var(--brand-dark); font-size: 22px; }
.stat span { color: var(--muted); font-size: 11px; }
.notice { display: flex; gap: 10px; margin-top: 14px; padding: 13px 14px; border: 1px solid #f1d7a7; background: var(--warning-soft); border-radius: 15px; color: #70440e; font-size: 12px; line-height: 1.55; }
.notice strong { display: block; margin-bottom: 2px; color: #5d390e; }
.notice svg { width: 19px; height: 19px; flex: 0 0 auto; margin-top: 2px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.78); border-radius: 999px; color: var(--muted); font-size: 12px; }
.chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

.card-list { display: grid; gap: 11px; }
.product-card, .solution-card { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.92); border-radius: 18px; padding: 15px; text-align: left; box-shadow: 0 5px 18px rgba(75,45,31,.045); }
.product-card { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; }
.product-thumb { position: relative; width: 72px; height: 72px; border-radius: 15px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 1px solid #f0e6df; }
.product-thumb img, .detail-product-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-code { position: absolute; left: 4px; bottom: 4px; padding: 2px 5px; border-radius: 6px; background: rgba(70,33,24,.84); color: white; font-size: 8px; font-weight: 800; letter-spacing: .02em; }
.image-missing { color: var(--muted); font-size: 10px; }
.product-card h3, .solution-card h3 { margin: 0 0 5px; font-size: 15px; }
.product-card p, .solution-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 7px; background: #f5f0eb; color: #675a53; font-size: 10px; }
.tag.review { background: var(--warning-soft); color: #89500e; }
.tag.ok { background: #e6f1eb; color: var(--jade); }
.chevron { color: #aa9f99; }
.solution-card { position: relative; overflow: hidden; }
.solution-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); opacity: .75; }
.solution-card .solution-index { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.solution-card .review-line { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--warning); font-size: 11px; }
.solution-card .solution-path { display: block; margin-top: 7px; color: #8d7e76; font-size: 10px; font-weight: 650; }
.chip-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: 5px; padding: 0 4px; border-radius: 999px; background: rgba(116,64,43,.1); font-size: 9px; }
.solution-groups { display: grid; gap: 12px; }
.solution-category { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 5px 18px rgba(75,45,31,.045); }
.solution-category > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; cursor: pointer; list-style: none; }
.solution-category > summary::-webkit-details-marker { display: none; }
.solution-category > summary strong { display: block; color: var(--ink); font-size: 16px; }
.solution-category > summary small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.solution-category-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 750; }
.solution-category[open] > summary { border-bottom: 1px solid var(--line); }
.solution-category-body { padding: 0 12px 12px; }
.solution-category-block { padding: 15px 12px 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.solution-category-title { padding: 0 3px 8px; }
.solution-category-title h3 { margin: 0; font-size: 18px; color: var(--brand-dark); }
.solution-category-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.solution-subgroup { margin-top: 13px; }
.solution-subgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 3px 8px; }
.solution-subgroup-head h3 { margin: 0; color: var(--ink); font-size: 14px; }
.solution-subgroup-head span { color: var(--muted); font-size: 10px; }
.solution-subgroup .card-list { gap: 9px; }
.empty { padding: 36px 20px; border: 1px dashed #d8cbc4; border-radius: 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }

.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.search-inline { display: flex; align-items: center; gap: 9px; padding: 0 13px; height: 46px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.search-inline svg { width: 19px; color: #9e928c; }
.search-inline input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-inline input::placeholder { color: #a79d98; }
.page-title { margin: 4px 0 14px; }
.page-title h1 { margin: 0; font-family: "STKaiti", "KaiTi", serif; font-size: 26px; letter-spacing: .03em; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.result-count { margin: 0 0 10px; color: var(--muted); font-size: 12px; }

.detail-hero { padding: 20px; border-radius: 22px; background: linear-gradient(145deg, #fcebe3, #fff8f3); border: 1px solid #efddd4; }
.detail-hero .eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.detail-hero h1 { margin: 8px 0 7px; font-size: 24px; }
.detail-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.detail-product-image { width: 100%; height: 205px; margin-top: 14px; border-radius: 18px; overflow: hidden; display: grid; place-items: center; background: white; border: 1px solid rgba(232,223,218,.9); }
.detail-product-image img { padding: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.detail-cell { padding: 11px; border-radius: 13px; background: rgba(255,255,255,.76); border: 1px solid rgba(232,223,218,.85); }
.detail-cell span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.detail-cell strong { font-size: 13px; }
.detail-section { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-section h2 { margin: 0 0 10px; font-size: 16px; }
.detail-section p { margin: 0; color: #514944; font-size: 13px; line-height: 1.75; }
.bullet-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bullet-list li { position: relative; padding-left: 18px; color: #514944; font-size: 13px; line-height: 1.65; }
.bullet-list li::before { content: ""; position: absolute; left: 1px; top: .61em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.steps { display: grid; gap: 10px; counter-reset: step; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.step-number { counter-increment: step; width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 800; }
.step h3 { margin: 1px 0 4px; font-size: 13px; }
.step p { font-size: 12px; line-height: 1.6; color: var(--muted); }
.warning-box { margin: 14px 0; padding: 14px; border-left: 4px solid var(--warning); border-radius: 4px 14px 14px 4px; background: var(--warning-soft); color: #6f4310; font-size: 12px; line-height: 1.65; }
.settings-card { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); margin-bottom: 12px; }
.settings-card h2 { margin: 0 0 8px; font-size: 16px; }
.settings-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.settings-card .actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.action-button { border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; background: white; color: var(--ink); font-size: 12px; font-weight: 650; }
.action-button.primary { border-color: var(--brand); background: var(--brand); color: white; }
.action-button.danger { color: var(--danger); border-color: #eccfcf; }
.file-input { display: none; }
.check-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.check-list li { display: grid; grid-template-columns: 20px 1fr; gap: 7px; color: #514944; font-size: 12px; line-height: 1.55; }
.check-list li::before { content: "✓"; width: 19px; height: 19px; border-radius: 7px; display: grid; place-items: center; background: #e6f1eb; color: var(--jade); font-weight: 800; font-size: 11px; }

.bottom-nav { position: fixed; z-index: 25; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 520px); display: grid; grid-template-columns: repeat(6, 1fr); padding: 7px 6px max(7px, env(safe-area-inset-bottom)); background: rgba(255,252,249,.94); backdrop-filter: blur(20px); border-top: 1px solid rgba(226,215,207,.9); }
.bottom-nav button { border: 0; background: transparent; color: #8e827b; display: grid; justify-items: center; gap: 2px; padding: 4px; font-size: 10px; }
.bottom-nav button svg { width: 20px; height: 20px; }
.bottom-nav button.active { color: var(--brand); font-weight: 750; }


.assistant-hero { padding: 20px; border-radius: 24px; color: white; background: linear-gradient(145deg, #7b3128 0%, #b64636 58%, #d68b62 100%); box-shadow: 0 16px 32px rgba(122,45,35,.2); }
.assistant-kicker { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.12); font-size: 10px; letter-spacing: .04em; }
.assistant-hero h1 { margin: 14px 0 6px; font-size: 29px; }
.assistant-hero p { margin: 0; max-width: 390px; color: rgba(255,255,255,.86); font-size: 12px; line-height: 1.7; }
.assistant-safety { display: grid; gap: 3px; margin-top: 13px; padding: 12px 14px; border: 1px solid #eed7aa; border-radius: 15px; background: #fff6df; color: #714612; font-size: 11px; line-height: 1.55; }
.assistant-safety strong { font-size: 12px; }
.assistant-form { display: grid; gap: 8px; margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(75,45,31,.05); }
.assistant-form > label { color: #514944; font-size: 12px; font-weight: 750; }
.assistant-query-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.assistant-query-row input { min-width: 0; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: white; color: var(--ink); }
.assistant-query-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(159,47,37,.08); }
.assistant-query-row .action-button { padding-left: 17px; padding-right: 17px; }
.assistant-chips { margin-top: 10px; }
.assistant-results { margin-top: 18px; }
.assistant-empty, .assistant-answer { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.86); }
.assistant-empty strong, .assistant-answer strong { display: block; color: var(--brand-dark); font-size: 14px; }
.assistant-empty p, .assistant-answer p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.assistant-match-list { display: grid; gap: 10px; margin-top: 11px; }
.assistant-match-reason { display: flex; justify-content: flex-end; margin: 0 7px -4px; }
.assistant-match-reason span { position: relative; z-index: 1; padding: 4px 8px; border-radius: 999px; background: #f3ebe5; color: #796960; font-size: 9px; }
.assistant-emergency { padding: 16px; border: 1px solid #e7a3a3; border-radius: 17px; background: #fff0f0; color: #8b1f1f; }
.assistant-emergency strong { display: block; font-size: 16px; }
.assistant-emergency p { margin: 7px 0 0; font-size: 12px; line-height: 1.7; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.portal-view { padding-bottom: 20px; }
.portal-header { padding: 20px; border-radius: 24px; color: white; background: linear-gradient(145deg, #713229 0%, #a94436 60%, #c87855 100%); box-shadow: 0 16px 32px rgba(122,45,35,.18); }
.portal-kicker { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.12); font-size: 10px; }
.portal-header h1 { margin: 13px 0 5px; font-size: 27px; }
.portal-header p { margin: 0; color: rgba(255,255,255,.86); font-size: 12px; line-height: 1.65; }
.portal-user { display: grid; gap: 3px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); }
.portal-user span { color: rgba(255,255,255,.75); font-size: 11px; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.portal-grid { display: grid; gap: 13px; margin-top: 14px; }
.portal-card, .portal-subcard { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.92); box-shadow: 0 7px 22px rgba(75,45,31,.05); }
.portal-card h2, .portal-subcard h3 { margin: 0 0 7px; font-size: 16px; color: var(--brand-dark); }
.portal-card p, .portal-subcard p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.portal-form { display: grid; gap: 10px; margin-top: 11px; }
.portal-field { display: grid; gap: 5px; }
.portal-field > span { color: #514944; font-size: 11px; font-weight: 700; }
.portal-field input, .portal-field select, .portal-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 10px 11px; color: var(--ink); outline: none; }
.portal-field textarea { min-height: 76px; resize: vertical; }
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(159,47,37,.08); }
.portal-check { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; color: var(--muted); font-size: 11px; line-height: 1.55; }
.portal-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.portal-meta-grid > div { padding: 10px; border-radius: 12px; background: #f8f3ef; }
.portal-meta-grid span { display: block; color: var(--muted); font-size: 9px; }
.portal-meta-grid strong { display: block; margin-top: 3px; word-break: break-all; font-size: 11px; }
.portal-warning { margin-top: 12px; padding: 11px; border: 1px solid #ecd09a; border-radius: 13px; background: #fff7e4; color: #744a12; font-size: 11px; }
.portal-warning ul { margin: 7px 0 0; padding-left: 18px; }
.signoff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0; }
.signoff-card { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #faf7f4; }
.signoff-card.signed { border-color: #b9d9c8; background: #eef8f2; }
.signoff-card strong, .signoff-card span { display: block; }
.signoff-card strong { font-size: 11px; }
.signoff-card span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.application-list, .version-list { display: grid; gap: 9px; }
.application-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.application-card strong, .application-card span, .application-card small { display: block; }
.application-card span, .application-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.application-card p { margin: 9px 0; color: #514944; font-size: 11px; line-height: 1.55; }
.role-checks { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.role-checks label { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 9px; background: #f7f2ef; font-size: 10px; }
.role-checks input { width: auto; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0e8e3; }
.version-row:last-child { border-bottom: 0; }
.version-row strong, .version-row span { display: block; }
.version-row strong { font-size: 11px; }
.version-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.search-layer, .sheet-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.search-layer.open, .sheet-layer.open { pointer-events: auto; opacity: 1; }
.search-panel { width: min(100%, 520px); height: min(88vh, 720px); margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 16px; background: var(--paper); border-radius: 0 0 28px 28px; box-shadow: var(--shadow); transform: translateY(-20px); transition: transform .25s ease; }
.search-layer.open .search-panel { transform: none; }
.search-head { display: flex; align-items: center; gap: 9px; }
.search-box { display: flex; align-items: center; gap: 9px; flex: 1; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.search-box svg { width: 19px; color: #9e928c; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.search-results { margin-top: 16px; display: grid; gap: 9px; max-height: calc(88vh - 95px); overflow: auto; }
.sheet-layer { display: flex; align-items: end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(39,27,23,.42); backdrop-filter: blur(3px); }
.bottom-sheet { position: relative; width: min(100%, 520px); max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 21px 18px calc(28px + env(safe-area-inset-bottom)); background: var(--paper); transform: translateY(28px); transition: transform .25s ease; }
.sheet-layer.open .bottom-sheet { transform: none; }
.sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: #d8cec8; margin: -7px auto 16px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 92px; transform: translate(-50%, 20px); max-width: calc(100% - 42px); padding: 11px 15px; border-radius: 12px; background: rgba(40,34,31,.92); color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100vh - 36px); border-radius: 28px; overflow: hidden; }
  .topbar { border-radius: 28px 28px 0 0; }
  .bottom-nav { bottom: 18px; border-radius: 0 0 28px 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* Admin editor */
.admin-banner { margin: 12px 0 14px; padding: 13px 14px; border-radius: 15px; border: 1px solid #e9d5b6; background: #fff7e8; color: #70450e; font-size: 12px; line-height: 1.65; }
.admin-card { padding: 16px; margin-bottom: 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.94); }
.admin-card h2 { margin: 0 0 6px; font-size: 16px; }
.admin-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-grid .admin-card { margin: 0; min-height: 112px; }
.admin-card-button { width: 100%; text-align: left; cursor: pointer; }
.admin-card-button .admin-arrow { display: inline-block; margin-top: 10px; color: var(--brand); font-size: 12px; font-weight: 700; }
.admin-list { display: grid; gap: 9px; }
.admin-list-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: white; text-align: left; }
.admin-list-item img { width: 54px; height: 54px; object-fit: contain; border-radius: 11px; background: #fff; border: 1px solid #f1e8e2; }
.admin-list-item strong { display: block; font-size: 13px; margin-bottom: 3px; }
.admin-list-item small { color: var(--muted); font-size: 10px; }
.admin-form { display: grid; gap: 13px; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 700; color: #514944; }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 11px 12px; color: var(--ink); outline: none; }
.form-field textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(159,47,37,.08); }
.form-help { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-actions { position: sticky; bottom: 78px; z-index: 10; display: flex; gap: 9px; padding: 10px; border-radius: 16px; background: rgba(255,250,246,.94); backdrop-filter: blur(14px); border: 1px solid var(--line); }
.form-actions .action-button { flex: 1; text-align: center; }
.admin-image-editor { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px dashed #d9c9c0; border-radius: 15px; background: #fff; }
.admin-image-editor img { width: 120px; height: 120px; object-fit: contain; border-radius: 12px; background: #fff; }
.admin-toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0; }
.admin-toolbar .action-button { flex: 1; min-width: 130px; }
.admin-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.admin-section { margin-top: 22px; }
.admin-section h2 { margin: 0 0 10px; font-size: 16px; }
.admin-secure { max-width: 390px; margin: 50px auto 0; }
.admin-code { display: block; padding: 12px; border-radius: 12px; background: #2d2825; color: #fff; font-size: 11px; overflow-wrap: anywhere; line-height: 1.6; }
@media (max-width: 390px) { .admin-grid { grid-template-columns: 1fr; } .admin-image-editor { grid-template-columns: 90px 1fr; } .admin-image-editor img { width: 90px; height: 90px; } }


/* Tongue reference gallery */
.tongue-figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.tongue-figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f9f4f0; }
.tongue-figure figcaption { padding: 12px 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tongue-privacy-note { margin-bottom: 11px; padding: 11px 12px; border-radius: 12px; background: #fff3dd; color: #70450e; font-size: 11px; line-height: 1.6; }
