:root {
  --bg: #f7f7f3;
  --bg-soft: #f0f2e9;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --line: #191919;
  --line-soft: #d8d8d1;
  --text: #101113;
  --muted: #6d7179;
  --brand: #0a7c6d;
  --brand-2: #06685b;
  --danger: #ba274a;
  --ok: #0f7a5c;
  --shadow: 0 14px 36px rgba(16, 17, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 420px at -10% -20%, #fff4ca 0%, transparent 52%),
    radial-gradient(1100px 480px at 120% -10%, #e2f3ed 0%, transparent 58%),
    var(--bg);
}

.mobile-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.app-frame,
.auth-frame {
  width: min(460px, 100%);
  min-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, #fffefa 0%, #fffdf7 100%);
  border: 1.5px solid #ecece8;
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: max(18px, env(safe-area-inset-top)) 18px max(86px, calc(18px + env(safe-area-inset-bottom)));
  overflow: hidden;
  position: relative;
}

.auth-frame {
  display: grid;
  align-content: center;
  gap: 12px;
  max-width: 420px;
}

.logo-mark {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  box-shadow: 0 10px 20px rgba(7, 31, 27, 0.16);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 6.2vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.14;
}

h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 17px;
}

.sub,
.hint,
.tiny {
  margin: 0;
  color: var(--muted);
}

.sub {
  font-size: 15px;
  line-height: 1.6;
}

.hint {
  margin-top: 10px;
  font-size: 13px;
}

.tiny {
  font-size: 12px;
  line-height: 1.5;
}

.mini-label,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1.5px solid #bfc7d5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #2a466c;
  background: #edf4ff;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ios-auth {
  text-align: left;
}

.ios-group {
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: 16px;
  padding: 10px 12px 12px;
  display: grid;
  gap: 7px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: #40454f;
}

input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--line-soft);
  border-radius: 13px;
  background: #fff;
  padding: 12px;
  font-size: 16px;
  color: var(--text);
  min-height: 46px;
}

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

input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(10, 124, 109, 0.2);
  outline-offset: 0;
}

button {
  border: 1.6px solid #cfd2d8;
  border-radius: 13px;
  min-height: 46px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button.primary {
  border-color: #0e5f54;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
}

button.large {
  min-height: 50px;
  border-radius: 14px;
}

button.ghost {
  border-color: transparent;
  color: #4c515a;
  background: #f4f5f1;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-links.one {
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1.5px solid #e5e6df;
  border-radius: 20px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.hero-card {
  gap: 12px;
  background:
    linear-gradient(140deg, #fffef8 0%, #f4faf6 70%),
    var(--surface);
}

.code,
.code-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.code {
  margin: 0;
  font-size: 13px;
  border: 1.5px solid #d8dccd;
  border-radius: 12px;
  background: #f8faef;
  color: #2a3647;
  padding: 10px;
  word-break: break-all;
}

.code-inline {
  border: 1px solid #d6d9c8;
  background: #f8f8f0;
  color: #5b5562;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.wrap {
  flex-wrap: wrap;
}

.tab-panel {
  display: grid;
  gap: 12px;
}

.seg-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid #dadbd4;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f5f1;
}

.seg {
  border: 0;
  border-radius: 0;
  min-height: 40px;
  background: transparent;
  color: #656977;
}

.seg.active {
  background: #fff;
  color: var(--text);
}

.panel-stack {
  display: grid;
  gap: 10px;
}

.q-list {
  display: grid;
  gap: 10px;
}

.q-item {
  border: 1.5px solid #e2e2dc;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #cad2d6;
  font-size: 12px;
}

.tag.ok {
  color: #0f6b53;
  border-color: #97cfbb;
  background: #eafaf3;
}

.tag.wait {
  color: #7c5a1a;
  border-color: #e6cd9a;
  background: #fff7df;
}

.answer-preview {
  border: 1px solid #d8d8cf;
  border-radius: 12px;
  background: #fbfcf8;
  color: #2f3340;
  padding: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.bind-card {
  border: 1.5px dashed #b8cfc7;
  border-radius: 14px;
  background: #f4fbf8;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.create-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1.5px solid #d8dcd1;
  border-radius: 12px;
  background: #fff;
  color: #1f425d;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.ask-frame {
  background:
    radial-gradient(800px 320px at -8% -10%, #fff1cb 0%, transparent 58%),
    radial-gradient(700px 280px at 100% 0, #ddf0ea 0%, transparent 62%),
    #fffef8;
}

.ask-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.ask-card {
  border: 1.5px solid #dfe2d2;
}

.tabbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(12px, env(safe-area-inset-bottom));
  height: 58px;
  border: 1.5px solid #d8dbd2;
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.95);
  display: grid;
  grid-template-columns: 1fr 1fr;
  backdrop-filter: saturate(140%) blur(10px);
  overflow: hidden;
}

.tab {
  border: 0;
  border-right: 1px solid #eceee5;
  border-radius: 0;
  min-height: 58px;
  background: transparent;
  color: #6d7179;
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  background: #f2faf7;
  color: #0c6e60;
}

.hidden {
  display: none !important;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.ok {
  color: var(--ok);
  font-weight: 700;
}

@media (max-width: 440px) {
  .mobile-shell {
    padding: 0;
  }

  .app-frame,
  .auth-frame {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding-left: 14px;
    padding-right: 14px;
  }
}
