:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --fg: #f4f1ea;
  --muted: #b8b3a8;
  --acc: #e8c36a;
  --btn: #1c1c22;
  --ok: #3dd68c;
  --bad: #ff6b6b;
  --line: #2a2a32;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
}
h1 {
  font-size: 20px;
  margin: 18px 0 6px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.pitch {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
  margin: 12px 0 8px;
}
.pitch strong { color: var(--acc); font-weight: 700; }
.pitch p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
.pitch p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.gate-brand {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 10px;
  margin: 12px 0 8px;
}
.gate-brand .field { margin-bottom: 10px; }
.gate-brand .logo-hint { margin: -2px 0 8px; }
.gate-brand .settings-status { margin: 0; min-height: 0; }
.gate-brand .settings-status:empty { display: none; }
.backup { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 10px 0 0; }
.hidden { display: none !important; }
#gate { padding-top: 8px; }
#signin {
  width: 100%;
  margin: 22px 0 10px;
  font-size: 20px;
  font-weight: 800;
  padding: 20px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--acc);
  color: #111;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
#signin small { display: block; font-size: 14px; font-weight: 600; margin-top: 8px; }
#gateStatus, #status {
  min-height: 24px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 15px;
}
.banner {
  background: #2a2414;
  color: var(--acc);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 8px 0 14px;
}
.micwrap { display: flex; justify-content: center; margin: 8px 0 18px; }
#mic {
  width: 168px; height: 168px; border-radius: 50%; border: 0;
  background: #0b0b0d url(btn-xray-mic.png) center / cover no-repeat;
  color: transparent; font-size: 0;
  box-shadow: 0 10px 30px rgba(232,195,106,.35);
  cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overflow: hidden;
}
#mic.listening {
  background: #0b0b0d url(btn-xray-mic.png) center / cover no-repeat;
  color: transparent;
  animation: pulse 1s infinite;
  box-shadow: 0 0 0 5px var(--acc), 0 0 0 12px rgba(255, 107, 107, .4), 0 10px 30px rgba(232,195,106,.35);
}
@keyframes pulse { 50% { transform: scale(1.04); box-shadow: 0 0 0 7px var(--acc), 0 0 0 16px rgba(255, 107, 107, .22), 0 10px 30px rgba(232,195,106,.35); } }
#q {
  width: 100%;
  font-size: 22px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 2px solid #333;
  background: var(--btn);
  color: var(--fg);
}
#go {
  width: 100%;
  margin-top: 12px;
  font-size: 20px;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--acc);
  color: #111;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
#horseListBtn {
  width: 100%;
  margin-top: 10px;
  font-size: 20px;
  padding: 16px;
  border: 2px solid var(--acc);
  border-radius: 16px;
  background: transparent;
  color: var(--acc);
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.film {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.film img { width: 100%; height: auto; display: block; }
.cap { font-size: 13px; color: var(--muted); padding: 8px 8px 10px; }
.empty {
  grid-column: 1 / -1;
  background: var(--btn);
  border-radius: 18px;
  padding: 28px 18px;
  text-align: center;
  font-size: 17px;
  line-height: 1.45;
}
.empty strong { display: block; color: var(--fg); font-size: 18px; margin-bottom: 8px; }
.empty span { color: var(--muted); font-size: 14px; }
.card {
  background: var(--btn);
  border-radius: 18px;
  padding: 16px;
  margin: 8px 0;
  font-size: 18px;
  width: 100%;
  border: 0;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.card small { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.a2hs {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.a2hs b { color: var(--fg); }

.wait { color: var(--muted); font-size: 14px; padding: 28px 8px; text-align: center; }
.film .wait { min-height: 80px; }

.howto {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px 16px 8px;
  margin: 12px 0 16px;
}
.howto summary {
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  padding: 12px 0;
  color: var(--fg);
  touch-action: manipulation;
}
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after {
  content: " ▾";
  color: var(--acc);
  font-weight: 800;
}
.howto[open] summary::after { content: " ▴"; }
.howto h2 {
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: none;
  margin: 0 0 8px;
}
.howto h3 {
  font-size: 14px;
  color: var(--acc);
  margin: 12px 0 6px;
}
.howto p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.howto ol { margin: 0 0 8px; padding-left: 1.2em; font-size: 15px; line-height: 1.55; }
.howto li { margin: 0 0 2px; }
.howto code {
  color: var(--fg);
  background: #121216;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
}
.share-ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  color: var(--acc);
}

.vetask {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 12px;
  margin: 12px 0 16px;
}
.vetask h2 {
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: none;
  margin: 0 0 8px;
}
.vetask p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  flex: 1 1 40%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121216;
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.chips button.on {
  border-color: var(--acc);
  background: #2a2414;
  color: var(--acc);
}
.vetask-status { min-height: 1.2em; margin: 10px 0 0 !important; font-size: 13px !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  margin: 0 -16px;
  padding: 10px 16px 8px;
}
.brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand h1,
.brand-name {
  margin: 0;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--btn);
}
.homebtn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--acc);
  color: #111;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  touch-action: manipulation;
}
.iconbtn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}
#app.away .home-chrome { display: none !important; }


.a2hs-block { margin: 0 0 14px; }
.a2hs-btn {
  width: 100%;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--btn);
  color: var(--fg);
  cursor: pointer;
  touch-action: manipulation;
}
.a2hs-btn-primary {
  font-size: 20px;
  font-weight: 800;
  padding: 20px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--acc);
  color: #111;
}
.a2hs-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.a2hs-help {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 8px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.a2hs-help p { margin: 0 0 8px; }
.a2hs-help ol { margin: 0 0 8px; padding-left: 1.2em; color: var(--fg); }
.a2hs-help b { color: var(--fg); }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet-card {
  background: #16161c;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px 16px;
  width: min(520px, 100%);
  max-height: 90dvh;
  overflow: auto;
}
.sheet-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
}
.field {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.field input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 17px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #121216;
  color: var(--fg);
}
.field input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 15px;
  color: var(--fg);
}
.logo-hint { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #121216;
}
.textbtn {
  border: 0;
  background: none;
  color: var(--acc);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
}
.settings-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.dangerbtn, .donebtn {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.dangerbtn {
  background: #3a1c1c;
  color: #ffb4b4;
  margin-bottom: 8px;
}
.donebtn {
  background: var(--acc);
  color: #111;
}

.gmail-status {
  min-height: 0;
  margin: -4px 0 14px;
  color: var(--acc);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.gmail-status:empty { display: none; }

.legal { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.legal a { color: var(--acc); text-decoration: none; }
.legal-page h1 { text-transform: none; letter-spacing: 0; }
.legal-page p { color: var(--muted); line-height: 1.5; font-size: 16px; }
.legal-page a { color: var(--acc); }
