/* ============================================================
   Rephrase · responsive web
   Warm paper, editorial serif, one accent. Mobile-first, then
   a two-column desk layout above 980px.
   ============================================================ */

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe7;
  --paper-3: #ece6da;
  --card: #ffffff;
  --ink: #1f1d1a;
  --ink-2: #57524b;
  --ink-3: #8d867c;
  --ink-4: #b1a99e;
  --line: #e8e2d7;
  --line-strong: #d8d0c2;
  --accent: #c0553f;
  --accent-dark: #a94835;
  --accent-soft: #f7ece9;
  --green: #1f6f6b;
  --shadow-sm: 0 1px 2px rgba(40, 32, 20, .05);
  --shadow: 0 1px 2px rgba(40, 32, 20, .05), 0 10px 30px rgba(40, 32, 20, .06);
  --shadow-lg: 0 2px 6px rgba(40, 32, 20, .06), 0 24px 70px rgba(40, 32, 20, .13);
  --radius: 20px;
  --radius-sm: 13px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 82% -8%, rgba(192, 85, 63, .055), transparent 62%),
    radial-gradient(900px 500px at -8% 18%, rgba(31, 111, 107, .045), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 2px; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2.5px solid rgba(192, 85, 63, .55);
  outline-offset: 2px;
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

/* ---------------- top bar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 16px 0 12px;
  border-bottom: 1px solid rgba(232, 226, 215, .7);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1;
  white-space: nowrap;
}
.brand em { font-style: normal; color: var(--accent); }

.brand-sub {
  font-size: 10px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  padding-top: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 107, .1);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.lang-wrap select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 28px 6px 11px;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.lang-wrap select:hover { border-color: var(--line-strong); }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.3;
  transition: border-color .16s, box-shadow .16s;
}
.account-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.account-btn .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.account-btn .gicon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ---------------- hero ---------------- */

.hero {
  padding: 38px 0 30px;
  max-width: 780px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -1.6px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  white-space: nowrap;
}
.hero .sub {
  margin: 16px 0 0;
  max-width: 620px;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.65;
}

/* ---------------- two-column layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  align-items: start;
}
.composer-column { min-width: 0; }
.result-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  /* align results with the composer panel, not the mode tabs above it */
  padding-top: 86px;
}

/* ---------------- tabs ---------------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid rgba(232, 226, 215, .8);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.tab-title { display: block; }
.tab-hint {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .2px;
  color: var(--ink-3);
}
.tab.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(40, 32, 20, .1);
}
.tab.on .tab-hint { color: var(--accent); }

/* ---------------- composer ---------------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .3px;
}
.field-tag {
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.char-count {
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.char-count.warn { color: var(--accent); }

textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 13px 14px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea::placeholder { color: var(--ink-4); }
textarea:focus {
  border-color: #c9bfae;
  background: #fffdfa;
  box-shadow: 0 0 0 4px rgba(192, 85, 63, .07);
}
textarea:disabled { opacity: .72; }

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.example {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.4;
  transition: border-color .15s, color .15s, background .15s;
}
.example:hover { border-color: var(--line-strong); color: var(--ink-2); background: var(--paper); }

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.section-label .aside {
  margin-left: auto;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  color: var(--ink-3);
}
.link-btn {
  margin-left: auto;
  border: 0;
  background: none;
  padding: 2px 0;
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}
.link-btn:hover { text-decoration: underline; }

.seg {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.seg button {
  flex: 1;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 8px 4px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.seg button:last-child { border-right: 0; }
.seg button.on {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 650;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 11px 5px 8px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.4;
  transition: border-color .15s, background .15s, color .15s;
}
.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--ink-3));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
}
.chip:hover { border-color: var(--line-strong); }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip.on .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }

.who-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.who-input:focus { border-color: #c9bfae; box-shadow: 0 0 0 4px rgba(192, 85, 63, .06); }

.primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 20px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .4px;
  transition: transform .08s, background .18s, opacity .18s;
}
.primary:hover { background: #2d2a25; }
.primary:active { transform: scale(.992); }
.primary:disabled { opacity: .42; cursor: default; transform: none; }
.primary .spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  padding: 4px;
}
.cancel:hover { color: var(--ink-2); text-decoration: underline; }

.quota {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.quota-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-3);
  font-size: 11.5px;
}
.quota-line b { color: var(--ink-2); font-weight: 600; }
.quota-line .reset { color: var(--ink-4); white-space: nowrap; }
.quota-bar {
  height: 3px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--paper-3);
  overflow: hidden;
}
.quota-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .35s ease, background .2s;
}
.quota.empty .quota-bar span { background: var(--accent); }
.quota.empty .quota-line b { color: var(--accent); }
.quota.offline .quota-bar span { width: 0 !important; }

.privacy-note {
  margin: 12px 2px 0;
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.6;
}
.privacy-note a { color: var(--ink-3); }

/* ---------------- empty / loading / error ---------------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .48);
  padding: 28px 26px;
}
.empty .mark {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  color: var(--accent);
  opacity: .32;
  margin-bottom: 8px;
}
.empty h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.3px;
}
.empty p { margin: 0; color: var(--ink-3); font-size: 13.5px; max-width: 440px; }
.steps {
  display: grid;
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.step {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; }
.step .num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.step b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.step span { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.5; }

.loading-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 24px;
  box-shadow: var(--shadow);
}
.loading-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 18px;
}
.loading-head .dots { display: inline-flex; gap: 4px; }
.loading-head .dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.2s infinite;
}
.loading-head .dots i:nth-child(2) { animation-delay: .15s; }
.loading-head .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.skeleton {
  height: 12px;
  border-radius: 99px;
  margin: 11px 0;
  background: linear-gradient(90deg, var(--paper-2) 20%, #f8f5ef 50%, var(--paper-2) 80%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton:nth-child(2) { width: 92%; }
.skeleton:nth-child(3) { width: 76%; }
.skeleton:nth-child(4) { width: 84%; }
.skeleton:nth-child(5) { width: 58%; }
@keyframes shimmer { to { background-position: -220% 0; } }

.error-card {
  border: 1px solid #ecd3cc;
  border-radius: var(--radius);
  background: #fdf5f2;
  padding: 18px 20px;
  color: var(--ink-2);
  font-size: 13.5px;
}
.error-card b { display: block; color: var(--accent-dark); font-size: 13px; margin-bottom: 3px; }
.error-card .retry {
  margin-top: 10px;
  border: 1px solid #e3c2b9;
  background: #fff;
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--accent-dark);
}

/* ---------------- results ---------------- */

.result { display: flex; flex-direction: column; gap: 14px; }
.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.result-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.5px;
}
.result-head .count {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 9px;
}
.result-actions { margin-left: auto; display: flex; gap: 7px; }
.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  padding: 6px 11px;
  color: var(--ink-2);
  font-size: 11.5px;
  transition: border-color .15s, color .15s, background .15s;
}
.ghost:hover { border-color: var(--line-strong); color: var(--ink); background: #fff; }

.origin {
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  padding: 12px 15px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.65;
}
.origin b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.version {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 19px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rise .32s ease both;
}
.version::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--vc, var(--accent));
  opacity: .85;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.version-top {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
}
.version-label {
  color: var(--vc, var(--accent));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.version-hint {
  color: var(--ink-4);
  font-size: 10.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.version p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.version .why {
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}
.version-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.mini {
  border: 0;
  background: none;
  border-radius: 7px;
  padding: 4px 7px;
  color: var(--ink-2);
  font-size: 11.5px;
}
.mini:hover { background: var(--paper-2); color: var(--ink); }
.mini.danger:hover { color: var(--accent); }
.version-actions .spacer { flex: 1; }

.tip {
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 12px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.tip b { color: var(--ink); font-weight: 600; }

/* hear */

.hear-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.confidence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 3px 9px;
  font-size: 10.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--paper-2);
  color: var(--ink-2);
}
.confidence::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.confidence.low::before { background: var(--accent); }
.confidence.medium::before { background: #b58a2f; }
.hear-block { margin-top: 20px; }
.hear-block:first-of-type { margin-top: 10px; }
.hear-block .k {
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.hear-block .v { color: var(--ink); font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.hear-block .v.big { font-family: var(--serif); font-size: 21px; line-height: 1.5; letter-spacing: -.2px; }
.hear-block .v.muted { color: var(--ink-2); font-size: 13.5px; }
.hear-block ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.hear-block li { margin: 4px 0; }
.hear-reply {
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  padding: 13px 15px;
}
.hear-avoid { color: var(--ink-3) !important; font-size: 13px !important; }
.ai-note {
  margin: 4px 0 0;
  color: var(--ink-4);
  font-size: 10.5px;
  text-align: center;
  line-height: 1.6;
}

/* ---------------- history ---------------- */

.history {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.history-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.history-head h3 {
  margin: 0;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.history-head .count { color: var(--ink-4); font-size: 10.5px; }
.history-head .clear {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  padding: 2px;
}
.history-head .clear:hover { color: var(--accent); text-decoration: underline; }
.history-list { display: flex; flex-direction: column; }
.history-item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background .15s;
}
.history-item:hover { background: rgba(255, 255, 255, .55); }
.history-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 9px 4px;
  text-align: left;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.history-item .tag {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .4px;
}
.history-item .txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item .when { flex: none; color: var(--ink-4); font-size: 10.5px; }
.history-item .del {
  flex: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-4);
  font-size: 13px;
  line-height: 1;
}
.history-item .del:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 80;
  transform: translate(-50%, 14px);
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 11px;
  background: #24211d;
  color: #fff;
  padding: 10px 16px;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- dialogs ---------------- */

dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgba(31, 29, 26, .42);
  backdrop-filter: blur(3px);
}
.dialog-inner { padding: 24px 24px 20px; }
.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.dialog-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.3px;
  line-height: 1.2;
}
.dialog-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.55; }
.dialog-close {
  margin-left: auto;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
}
.dialog-close:hover { background: var(--paper-2); color: var(--ink); }
.dialog-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.dialog-body p { margin: 0 0 12px; }
.dialog-body ul { margin: 0 0 14px; padding-left: 19px; }
.dialog-body li { margin: 4px 0; }
.google-slot { display: flex; justify-content: center; margin: 16px 0 10px; min-height: 44px; }
.google-fallback {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.dialog-foot .ghost { padding: 8px 14px; font-size: 12.5px; }
.danger-btn {
  border: 1px solid #dfb8ad;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.danger-btn:hover { background: var(--accent-dark); }
.danger-btn:disabled { opacity: .5; }

.reasons { display: grid; gap: 5px; margin: 12px 0 4px; }
.reason {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 8px 11px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.reason:hover { border-color: var(--line-strong); }
.reason input { accent-color: var(--accent); }

/* account menu */

.account-menu {
  position: absolute;
  z-index: 70;
  width: 250px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: pop .15s ease both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.account-menu .who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.account-menu .who img,
.account-menu .who .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.account-menu .who .name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.account-menu .who .email {
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.3;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu .quota-mini {
  padding: 7px 9px 9px;
  color: var(--ink-3);
  font-size: 10.5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: none;
  padding: 8px 9px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}
.menu-item:hover { background: var(--paper-2); }
.menu-item.danger { color: var(--accent-dark); }
.menu-item.danger:hover { background: var(--accent-soft); }
.account-menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------------- footer ---------------- */

.foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-4);
  font-size: 11px;
}
.foot .spacer { flex: 1; }
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--accent); }

.offline-banner {
  margin-bottom: 14px;
  border: 1px solid #ecd3cc;
  border-radius: 11px;
  background: #fdf5f2;
  padding: 8px 12px;
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------------- responsive ---------------- */

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .composer-column { position: static; }
  .result-column { padding-top: 0; }
  .hero { padding: 30px 0 24px; }
  .result-column { gap: 18px; }
  .empty { padding: 24px 20px; }
  .empty .steps { margin-top: 18px; }
  .result-head h2 { font-size: 23px; }
  .result-actions { width: 100%; margin-left: 0; }
}

/* 平板宽度下顶栏放不下「Free」胶囊和登录按钮，先收起胶囊 */
@media (max-width: 900px) {
  .pill { display: none; }
}

@media (max-width: 700px) {
  .page { padding: 0 16px 44px; }
  .topbar {
    min-height: 62px;
    gap: 10px;
    padding: 12px 0 10px;
    flex-wrap: wrap;
  }
  .brand { font-size: 22px; }
  .brand-sub { display: none; }
  .pill { display: none; }
  .top-actions { gap: 8px; }
  .lang-wrap span { display: none; }
  .lang-wrap select { padding: 6px 26px 6px 10px; font-size: 11.5px; }
  .account-btn { padding: 4px 10px 4px 5px; font-size: 11.5px; }
  .account-btn .avatar { width: 24px; height: 24px; }
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: clamp(34px, 10.5vw, 46px); letter-spacing: -1.2px; }
  .hero .sub { margin-top: 12px; font-size: 14.5px; }
  .eyebrow { font-size: 10px; margin-bottom: 7px; }
  .panel { padding: 16px; border-radius: 18px; }
  textarea { min-height: 118px; font-size: 16px; }
  .section-label { margin-top: 17px; }
  .empty { padding: 20px 18px; }
  .empty .mark { font-size: 44px; }
  .empty h2 { font-size: 22px; }
  .version { padding: 16px 16px 12px; border-radius: 17px; }
  .version p { font-size: 15px; }
  .version-hint { display: none; }
  .hear-card { padding: 18px; border-radius: 18px; }
  .hear-block .v.big { font-size: 19px; }
  .result-head h2 { font-size: 22px; }
  .foot { margin-top: 36px; font-size: 10.5px; gap: 10px; }
  .foot .spacer { display: none; }
  dialog { width: calc(100vw - 24px); border-radius: 18px; }
  .dialog-inner { padding: 20px 18px 16px; }
  .dialog-head h2 { font-size: 22px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .top-actions { width: 100%; justify-content: flex-end; }
  .chip { font-size: 11.5px; padding-right: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
