
:root{
  --p:#e60012;
  --p2:#b8000e;
  --bg:#f7f7f7;
  --card:#ffffff;
  --text:rgba(17,24,39,.92);
  --muted:rgba(17,24,39,.62);
  --border:rgba(17,24,39,.12);
  --shadow:0 18px 60px rgba(2,6,23,.14);
  --shadowSoft:0 10px 24px rgba(2,6,23,.10);
  --r:22px;
  --r2:14px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0f16;
    --card:#111827;
    --text:rgba(255,255,255,.92);
    --muted:rgba(255,255,255,.62);
    --border:rgba(255,255,255,.10);
    --shadow:0 18px 70px rgba(0,0,0,.55);
    --shadowSoft:0 10px 26px rgba(0,0,0,.35);
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.skip{
  position:absolute;
  left:-999px; top:10px;
  background:#fff;
  color:#111;
  padding:8px 10px;
  border-radius:10px;
  z-index:9999;
}
.skip:focus{ left:10px; }

.app{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  max-width:520px;
  margin:0 auto;
  padding-bottom:84px;
}

.top{
  padding:18px 16px 14px;
  background: radial-gradient(1200px 340px at 15% -10%, rgba(255,255,255,.22), transparent 60%),
              linear-gradient(135deg, var(--p), var(--p2));
  color:#fff;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}
.top__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand__logo{
  width:46px; height:46px;
  border-radius:14px;
  object-fit:cover;
  background:rgba(255,255,255,.25);
  border:1px solid rgba(255,255,255,.35);
}
.brand__text{ min-width:0; }
.brand__name{ font-weight:900; letter-spacing:.2px; font-size:20px; }
.brand__tag{ opacity:.9; font-size:12px; margin-top:2px; }

.chip{
  border:none;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.16);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  border:1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(10px);
}

.quick{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
}
.quick__btn{
  border:none;
  border-radius:16px;
  padding:10px 8px;
  cursor:pointer;
  background: rgba(255,255,255,.14);
  color:#fff;
  border:1px solid rgba(255,255,255,.25);
  text-align:left;
}
.quick__btn:active{ transform: translateY(1px); }
.quick__icon{ font-size:18px; display:block; }
.quick__label{ font-weight:800; font-size:12px; display:block; margin-top:4px; }

.main{
  padding:14px 16px 0;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--r);
  box-shadow: var(--shadowSoft);
  padding:16px 14px 16px;
  margin-bottom:14px;
}
.card__head h2{ margin:0; font-size:18px; font-weight:900; }
.card__head .muted{ margin:6px 0 0; }

.muted{ color: var(--muted); font-size:12px; line-height:1.35; }
.hint{ color: var(--muted); font-size:11px; margin-top:6px; line-height:1.35; }
.footnote{ color: var(--muted); font-size:11px; margin:10px 2px 0; }

label{ display:block; font-size:12px; font-weight:800; margin:14px 0 6px; }
input, select, textarea{
  width:100%;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.55);
  color: var(--text);
  padding:11px 12px;
  font-size:14px;
  outline:none;
}
@media (prefers-color-scheme: dark){
  input, select, textarea{ background: rgba(255,255,255,.05); }
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(230,0,18,.7);
  box-shadow: 0 0 0 3px rgba(230,0,18,.18);
}

textarea{ min-height:92px; resize:vertical; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px 12px;
}
.grid__full{ grid-column: 1 / -1; }
@media (max-width: 420px){
  .grid{ grid-template-columns: 1fr; }
}

.row{ display:flex; gap:10px; align-items:center; }
.row--between{ justify-content: space-between; }
.row--gap{ gap:10px; }

.seg{
  display:flex;
  gap:8px;
  margin-top:2px;
}
.seg__btn{
  flex:1;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.15);
  background: rgba(17,24,39,.10);
  color: var(--text);
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
}
.seg__btn--active{
  background: rgba(230,0,18,.12);
  border-color: rgba(230,0,18,.40);
  color: var(--p);
}

.btn{
  border:none;
  border-radius:999px;
  padding:11px 14px;
  font-weight:900;
  font-size:14px;
  cursor:pointer;
}
.btn--primary{
  width:100%;
  margin-top:14px;
  background: var(--p);
  color:#fff;
  box-shadow: 0 12px 30px rgba(230,0,18,.35);
}
.btn--primary:active{ transform: translateY(1px); background: var(--p2); }
.btn--ghost{
  background: transparent;
  border:1px solid var(--border);
  color: var(--text);
}
.actions{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.actions .btn{ flex:1; }

.result{
  margin-top:14px;
  border-radius: var(--r2);
  border:1px dashed rgba(230,0,18,.35);
  background: rgba(230,0,18,.06);
  padding:12px 12px 12px;
}
.result__main{
  font-size:22px;
  font-weight:1000;
  color: var(--p2);
  letter-spacing:.2px;
  word-break: break-word;
}
.result__grid{
  margin-top:10px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
}
.result__grid span{ display:block; font-size:11px; color: var(--muted); margin-bottom:2px; }
.result__grid b{ font-size:13px; }
@media (max-width:420px){
  .result__grid{ grid-template-columns: 1fr; }
}

.divider{
  height:1px;
  background: var(--border);
  margin:14px 0;
}

.list{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  border:1px solid var(--border);
  border-radius: 16px;
  padding:10px 10px;
  background: rgba(255,255,255,.55);
}
@media (prefers-color-scheme: dark){
  .item{ background: rgba(255,255,255,.03); }
}
.item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.item__title{
  font-weight:950;
  font-size:13px;
}
.item__meta{
  font-size:10px;
  color: var(--muted);
  margin-top:4px;
}
.item__body{
  margin-top:8px;
  font-size:12px;
  line-height:1.35;
  white-space: pre-wrap;
}
.item__img{
  width:100%;
  max-height:220px;
  object-fit:cover;
  border-radius: 14px;
  margin-top:10px;
  border:1px solid var(--border);
}
.item__btns{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.item__btns button{
  flex:1;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight:900;
  cursor:pointer;
  font-size:12px;
}

.search{
  padding:10px 12px;
  border-radius:999px;
}

.qr__reader{
  width:100%;
  max-width:380px;
  margin: 8px auto 0;
}

.h3{
  margin:0;
  font-size:13px;
  font-weight:950;
}

.screen{ display:none; }
.screen--active{ display:block; }

.tabs{
  position: fixed;
  left:0; right:0; bottom:0;
  display:flex;
  justify-content:center;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
  background: linear-gradient(to top, rgba(0,0,0,.14), transparent 40%);
}
.tabs::before{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0; top:0;
  background: rgba(255,255,255,.75);
  border-top:1px solid rgba(17,24,39,.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index:-1;
}
@media (prefers-color-scheme: dark){
  .tabs::before{
    background: rgba(17,24,39,.78);
    border-top:1px solid rgba(255,255,255,.10);
  }
}

.tab{
  flex:1;
  max-width: 108px;
  border:none;
  background: transparent;
  padding: 8px 6px 6px;
  cursor:pointer;
  color: var(--muted);
  text-align:center;
  border-radius: 16px;
}
.tab span{ display:block; font-size:18px; margin-bottom:4px; }
.tab b{ font-size:10px; font-weight:950; }
.tab--active{
  color: var(--p);
  background: rgba(230,0,18,.08);
}

.noscript{
  padding:12px;
  background:#fff;
  border:1px solid #ddd;
  border-radius: 14px;
  margin: 16px;
}
