/* Koshi Team · glass theme */
:root {
  --bg: #070a17;
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .1);
  --glass-deep: rgba(14, 18, 38, .72);
  --surface: var(--glass);
  --surface2: var(--glass-strong);
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .12);
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --blur: blur(22px) saturate(160%);
  --text: #f1f4ff;
  --muted: #9aa4c4;
  --accent: #6f8bff;
  --accent2: #9a6bff;
  --grad: linear-gradient(135deg, #8a6bff 0%, #5b8cff 55%, #3fc6ff 100%);
  --glow: 0 10px 30px rgba(110, 120, 255, .38);
  --ok: #46e3a5;
  --warn: #ffc25e;
  --bad: #ff7a85;
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--text); overscroll-behavior: none; font: 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
body { padding: 14px 14px calc(104px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* живой фон за стеклом */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(70px); opacity: .55; }
body::before { width: 460px; height: 460px; left: -160px; top: -140px; background: radial-gradient(circle, #7b4dff 0%, transparent 65%);
  animation: drift1 22s ease-in-out infinite alternate; }
body::after { width: 520px; height: 520px; right: -220px; top: 32vh; background: radial-gradient(circle, #1f7bff 0%, transparent 65%);
  animation: drift2 26s ease-in-out infinite alternate; }
.bg-orb { position: fixed; z-index: -1; pointer-events: none; width: 380px; height: 380px; left: -60px; bottom: -160px; border-radius: 50%;
  background: radial-gradient(circle, #13c9b0 0%, transparent 65%); filter: blur(80px); opacity: .32; animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(70px, 90px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-80px, -60px) scale(1.08); } }

h1 { font-size: 28px; line-height: 1.12; margin: 6px 0 8px; letter-spacing: -.025em; }
h2 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 12px; font-weight: 700; margin: 24px 6px 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card, .glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); box-shadow: var(--hi), var(--shadow); border-radius: var(--radius); }
.card { padding: 16px; margin-bottom: 12px; }

.btn { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px;
  border: 0; border-radius: 18px; padding: 0 18px; font: 650 17px/1 var(--font); color: #fff; background: var(--grad); cursor: pointer;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .12s var(--ease), filter .2s, opacity .2s;
  text-decoration: none; letter-spacing: .01em; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 4.5s 1.5s infinite; }
.btn.ghost::after, .btn.small::after { display: none; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn:active { transform: scale(.975); filter: brightness(.92); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text);
  font-weight: 550; font-size: 15px; min-height: 48px; border: 1px solid var(--line); box-shadow: var(--hi); }
.btn.small { width: auto; min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; box-shadow: var(--hi); }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; color: #a9b8ff; font: 500 15px/1.2 var(--font); padding: 10px 6px; cursor: pointer; }

input, select, textarea { width: 100%; background: rgba(0, 0, 0, .25); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; font: 16px var(--font); outline: none; transition: border-color .2s, box-shadow .2s; }
select option { background: #151a33; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(111, 139, 255, .18); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 2px 6px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; background: var(--glass); color: var(--text);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font: 550 14px/1 var(--font); cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s; }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(110, 120, 255, .35); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: .05em;
  background: var(--glass-strong); color: var(--muted); text-transform: uppercase; border: 1px solid var(--line-soft); }
.badge.ok { background: rgba(70, 227, 165, .14); color: var(--ok); border-color: rgba(70, 227, 165, .25); }
.badge.warn { background: rgba(255, 194, 94, .14); color: var(--warn); border-color: rgba(255, 194, 94, .25); }

.toast { position: fixed; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--glass-deep); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line);
  color: var(--text); padding: 12px 18px; border-radius: 16px; font-size: 14px; z-index: 300; max-width: 88%; text-align: center;
  animation: fadeUp .25s var(--ease); box-shadow: var(--hi), var(--shadow); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.scroll { overflow-x: auto; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel { position: relative; overflow: hidden; background: var(--glass); border: 1px solid var(--line-soft); border-radius: var(--radius); height: 120px; margin-bottom: 12px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); animation: shimmer 1.3s infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.01em; font-size: 17px; }
.logo i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); }

/* окна снизу */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 5, 14, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; max-width: 560px; margin: 0 auto; background: var(--glass-deep);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); animation: slideUp .32s var(--ease);
  max-height: 88vh; overflow-y: auto; box-shadow: var(--hi), 0 -20px 60px rgba(0, 0, 0, .45); }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .2); margin: 0 auto 16px; }
.sheet .result, .sheet .card { background: rgba(255, 255, 255, .05); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
