:root {
  --ink: #203933;
  --ink-soft: #3e574f;
  --muted: #738078;
  --green: #285c4c;
  --green-deep: #173c33;
  --green-mid: #31564a;
  --line: #dfe5d7;
  --line-strong: #cbd5c2;
  --paper: #f5f6ee;
  --paper-deep: #edefe2;
  --card: #fffef8;
  --card-soft: #fafbf3;
  --lime: #dbebb9;
  --lime-strong: #b6cf79;
  --amber: #8a6427;
  --amber-soft: #faf2dc;
  --danger: #9b3d32;
  --danger-soft: #fbece8;
  --shadow: 0 14px 40px rgba(32, 57, 51, 0.09);
  --shadow-soft: 0 4px 18px rgba(32, 57, 51, 0.06);
  --radius: 20px;
  --radius-small: 13px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(219, 235, 185, 0.42), transparent 32rem),
    radial-gradient(circle at 96% 22%, rgba(182, 207, 121, 0.17), transparent 25rem),
    var(--paper);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-wrap: anywhere;
}

body.onboarding-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: -0.8px;
}

h2 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 16px;
  line-height: 1.4;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
}

a {
  color: var(--green);
}

input,
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px 13px;
  width: 100%;
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input::placeholder,
textarea::placeholder {
  color: #9aa59b;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(102, 140, 121, 0.48);
  outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #668c79;
  box-shadow: 0 0 0 3px rgba(102, 140, 121, 0.12);
}

img {
  max-width: 100%;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 8px;
  color: #84927f;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: 2.3px;
}

.hint {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--green-deep);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

/* Brand and boot */

.brand-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--lime);
  color: var(--green-deep);
  font-size: 27px;
  line-height: 1;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(40, 92, 76, 0.08);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 20px;
}

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

.brand-row strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.brand-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: 0.7px;
}

.brand-row.compact strong {
  font-size: 16px;
}

.brand-row.compact small {
  font-size: 9.5px;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}

.boot .brand-mark {
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.86; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* Auth */

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(28px + var(--safe-top)) 16px calc(32px + var(--safe-bottom));
}

.auth-card {
  width: min(100%, 460px);
  padding: 26px 22px 22px;
  border: 1px solid rgba(203, 213, 194, 0.8);
  border-radius: 26px;
  background: rgba(255, 254, 248, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card .brand-row {
  margin-bottom: 30px;
}

.auth-card h1 {
  margin-bottom: 12px;
}

.auth-lede {
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.72;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
}

.auth-tab {
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.auth-tab.active {
  background: var(--green);
  color: #f8faef;
  box-shadow: 0 3px 12px rgba(40, 92, 76, 0.18);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.field-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.auth-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px;
}

/* Buttons */

.primary,
.secondary,
.quiet {
  min-height: 46px;
  padding: 11px 17px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.primary {
  background: var(--green);
  color: #fbfdf4;
  box-shadow: 0 5px 16px rgba(40, 92, 76, 0.16);
}

.primary:hover {
  background: #1f4c3e;
}

.primary:active,
.secondary:active,
.quiet:active {
  transform: translateY(1px);
}

.secondary {
  border: 1px solid var(--line-strong);
  background: #fbfcf4;
  color: var(--green);
}

.secondary:hover {
  background: #f3f7e8;
}

.quiet {
  background: transparent;
  color: var(--muted);
}

.quiet:hover {
  background: rgba(40, 92, 76, 0.06);
}

.danger-text {
  color: var(--danger);
}

.wide {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 4px 2px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.text-button:hover {
  text-decoration: underline;
}

.text-link {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
  text-underline-offset: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill:hover {
  border-color: #aabda0;
  background: #f4f8e9;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 27px;
  line-height: 1;
}

.icon-btn:hover {
  background: rgba(40, 92, 76, 0.08);
}

/* App shell */

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(223, 229, 215, 0.9);
  background: rgba(245, 246, 238, 0.9);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(100%, 820px);
  min-height: 66px;
  margin: 0 auto;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mode-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.user-chip {
  max-width: 150px;
  overflow: hidden;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#main {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 22px 16px calc(104px + var(--safe-bottom));
}

.view {
  animation: view-in 0.18s ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-intro {
  margin-bottom: 20px;
}

.view-intro h1 {
  margin-bottom: 9px;
}

.view-intro .muted {
  max-width: 630px;
  font-size: 14px;
  line-height: 1.7;
}

/* Compose */

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

#voice-text {
  min-height: 122px;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(transparent 0, transparent calc(1.65em - 1px), rgba(203, 213, 194, 0.34) calc(1.65em - 1px), rgba(203, 213, 194, 0.34) 1.65em);
  background-size: 100% 1.65em;
  background-attachment: local;
  font-size: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}

.record-pill {
  color: var(--green);
}

.record-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a4584d;
}

.record-pill.is-recording {
  border-color: rgba(155, 61, 50, 0.38);
  background: var(--danger-soft);
  color: var(--danger);
}

.record-pill.is-recording .record-dot {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.55); opacity: 0.45; }
}

.recording-status {
  min-height: 0;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.recording-status:empty {
  margin-top: 0;
}

.inline-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.media-preview {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.preview-head,
.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-head {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.preview-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.screenshot-link {
  display: block;
  margin-top: 9px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1e6;
}

.screenshot-link img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

#audio-player {
  width: 100%;
  height: 42px;
  margin-top: 9px;
}

.draft-status {
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.submit-capture {
  margin-top: 6px;
}

.force-submit {
  margin-top: 10px;
  color: var(--amber);
}

.notice {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.6;
}

.notice-warn {
  border: 1px solid #ead9a9;
  background: var(--amber-soft);
  color: var(--amber);
}

.form-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #eccfc7;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.55;
}

.inline-success {
  margin-top: 8px;
  color: var(--green);
  font-size: 12.5px;
}

.last-submitted {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d7e2ca;
  border-radius: var(--radius);
  background: #f3f8e8;
}

.last-submitted h2 {
  margin-bottom: 5px;
  font-size: 17px;
}

.last-media {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.last-media-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 12px;
}

.last-media-item audio {
  width: 100%;
  height: 38px;
}

.last-media-item img {
  width: 74px;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
}

/* Record lists */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 2px 12px;
}

.section-heading h2 {
  font-size: 19px;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

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

.record-card {
  width: 100%;
  display: block;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 9px rgba(32, 57, 51, 0.025);
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.record-card:hover {
  border-color: #b8c8ad;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.record-top,
.record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-top {
  margin-bottom: 9px;
}

.record-top time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf3e1;
  color: var(--green);
  font-size: 10px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.gray {
  background: #eef0e9;
  color: var(--muted);
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.record-card h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 16.5px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-footer {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.record-footer span:last-child {
  text-align: right;
}

.record-media-marks {
  display: inline-flex;
  gap: 8px;
}

.record-media-marks b {
  font-weight: 500;
}

.empty-state {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  background: rgba(255, 254, 248, 0.55);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 14px;
}

.empty-state p {
  font-size: 12.5px;
  line-height: 1.65;
}

.loading-note {
  padding: 20px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--card);
  color: var(--muted);
}

.search-box input {
  min-height: 44px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

.search-box span {
  font-size: 19px;
  line-height: 1;
}

.filter-row {
  display: flex;
  gap: 7px;
  margin: 12px 0;
  padding: 1px 0 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #fbfdf4;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin: 2px 2px 9px;
}

.list-meta {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.list-toolbar .text-button {
  flex: 0 0 auto;
  min-height: 32px;
  font-size: 11.5px;
}

/* Plans */

.plan-list {
  display: grid;
  gap: 11px;
}

.plan-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 9px rgba(32, 57, 51, 0.025);
}

.plan-card:hover {
  border-color: #b8c8ad;
}

.plan-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 6px;
  border-radius: 11px;
  background: #edf3e1;
  color: var(--green);
  line-height: 1.2;
}

.plan-date strong {
  font-size: 19px;
  letter-spacing: -0.4px;
}

.plan-date small {
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.6px;
}

.plan-body {
  min-width: 0;
}

.plan-body h3 {
  overflow: hidden;
  font-size: 15.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.plan-meta strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.plan-section-title {
  margin: 28px 2px 11px;
  font-size: 16px;
}

/* Settings */

.settings-card {
  margin-bottom: 14px;
  padding: 18px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 2px 9px rgba(32, 57, 51, 0.025);
}

.settings-card h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.settings-card h2 .tag {
  margin-left: 5px;
  vertical-align: 2px;
}

.settings-copy {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}

.settings-copy strong {
  color: var(--green);
}

.account-info {
  display: grid;
  gap: 8px;
  margin: 13px 0 4px;
}

.account-info div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.account-info dt {
  color: var(--muted);
  font-size: 12px;
}

.account-info dd {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.settings-form {
  margin-top: 14px;
}

.settings-form .field {
  margin-bottom: 9px;
}

.status-line {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.status-line.configured {
  background: #edf4df;
  color: var(--green);
}

.settings-subtitle {
  margin: 18px 0 7px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.shortcut-help {
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #d7e2ca;
  border-radius: 12px;
  background: #f3f8e8;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.shortcut-help ol {
  margin: 0;
  padding-left: 19px;
}

.shortcut-help li {
  margin-bottom: 7px;
  line-height: 1.6;
}

.shortcut-help li:last-child {
  margin-bottom: 0;
}

.credential-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.credential-row.revoked {
  opacity: 0.62;
}

.credential-meta {
  min-width: 0;
}

.credential-meta strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-meta span {
  color: var(--muted);
  font-size: 11.5px;
}

.credential-row .text-button {
  flex: none;
}

.credential-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.shortcut-bind {
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #c9dcf0;
  border-radius: 12px;
  background: #eef5fb;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.shortcut-bind .settings-subtitle:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

.secret-value {
  flex: 1 1 220px;
  min-width: 0;
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.secret-row .secondary {
  flex: none;
}

.install-link {
  color: #185FA5;
  font-weight: 600;
  font-size: 14px;
}

.help-details {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.help-details summary {
  color: var(--green);
  font-weight: 650;
  cursor: pointer;
}

.help-details ol {
  margin: 9px 0 0;
  padding-left: 20px;
}

.help-details li {
  margin-bottom: 5px;
  line-height: 1.6;
}

.invite-result {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid #d7e2ca;
  border-radius: 13px;
  background: #f3f8e8;
}

.invite-code {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-align: center;
}

#invite-copy-status {
  margin-top: 0;
}

/* Bottom nav */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 8px calc(7px + var(--safe-bottom));
  border-top: 1px solid rgba(203, 213, 194, 0.86);
  border-radius: 18px 18px 0 0;
  background: rgba(255, 254, 248, 0.95);
  box-shadow: 0 -8px 28px rgba(32, 57, 51, 0.07);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(40, 92, 76, 0.05);
}

.nav-item.active {
  color: var(--green);
  background: #edf4df;
}

.nav-glyph {
  font-size: 19px;
  line-height: 1;
}

/* Detail dialog */

.detail-dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 820px);
  max-width: 100%;
  max-height: 92dvh;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 -16px 50px rgba(23, 60, 51, 0.24);
}

.detail-dialog::backdrop {
  background: rgba(23, 60, 51, 0.45);
  backdrop-filter: blur(2px);
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.detail-top .eyebrow {
  margin: 0;
}

.detail-content {
  max-height: calc(92dvh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 18px calc(28px + var(--safe-bottom));
}

.detail-title-row {
  margin-bottom: 4px;
}

.detail-title {
  margin: 8px 0 5px;
  font-size: clamp(23px, 5.8vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.detail-meta {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.detail-section {
  margin-top: 20px;
}

.detail-section h3 {
  margin-bottom: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.9px;
}

.prose {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.78;
  white-space: pre-wrap;
}

.detail-note {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px;
  line-height: 1.65;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review {
  padding: 12px 13px;
  border-left: 3px solid var(--lime-strong);
  border-radius: 0 11px 11px 0;
  background: var(--card-soft);
}

.review-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.review-sources {
  display: grid;
  gap: 4px;
  margin-top: 9px;
}

.review-sources a {
  font-size: 12px;
  font-weight: 600;
  text-underline-offset: 3px;
  word-break: break-word;
}

.detail-media {
  display: grid;
  gap: 11px;
  margin-top: 19px;
}

.detail-media-box {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.detail-media-box > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.detail-media-box audio {
  width: 100%;
  height: 42px;
}

.detail-media-box img {
  display: block;
  width: 100%;
  max-height: 340px;
  border-radius: 8px;
  object-fit: contain;
  background: #eef1e6;
}

.media-fallback {
  color: var(--muted);
  font-size: 12px;
}

.schedule-box {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.schedule-box h3 {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.9px;
}

.schedule-grid {
  display: grid;
  gap: 11px;
}

.schedule-grid .field > span {
  font-size: 11.5px;
}

.schedule-grid input,
.schedule-grid select {
  min-height: 44px;
  padding: 9px 11px;
  font-size: 13px;
}

.schedule-grid .runs-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
}

.schedule-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.detail-actions button {
  min-height: 43px;
  font-size: 12.5px;
}

.archive-button.confirming {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.execution-details {
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.execution-details summary {
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
}

.execution-list {
  margin: 9px 0 0;
  padding-left: 18px;
}

.execution-list li {
  margin-bottom: 4px;
  line-height: 1.55;
}

.detail-status {
  margin-top: 12px;
}

/* Onboarding */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(23, 60, 51, 0.48);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.onboarding-card {
  width: min(100%, 520px);
  max-height: calc(100dvh - 32px);
  padding: 23px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(23, 60, 51, 0.3);
  animation: sheet-in 0.22s ease-out;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding-card h2 {
  margin-bottom: 13px;
  font-size: 23px;
}

.welcome-steps {
  margin: 0 0 16px;
  padding-left: 21px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}

.welcome-steps li {
  margin-bottom: 8px;
}

.welcome-steps strong {
  color: var(--green);
}

.bark-callout {
  padding: 13px;
  border: 1px solid #d7e2ca;
  border-radius: 13px;
  background: #f3f8e8;
}

.bark-callout strong {
  color: var(--green);
  font-size: 13.5px;
}

.bark-callout p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.welcome-actions {
  margin-top: 17px;
}

.welcome-actions .primary {
  flex: 1 1 100%;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 300;
  width: min(calc(100% - 32px), 420px);
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--green-deep);
  color: #f8faef;
  box-shadow: 0 10px 32px rgba(23, 60, 51, 0.3);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 0.18s ease-out;
}

.toast.error {
  background: #7c332b;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Wider screens */

@media (min-width: 720px) {
  .detail-dialog {
    inset: 50% auto auto 50%;
    width: min(760px, calc(100% - 32px));
    max-height: 88dvh;
    border-radius: 22px;
    transform: translate(-50%, -50%);
  }

  .detail-content {
    max-height: calc(88dvh - 60px);
    padding: 20px 24px 28px;
  }

  .onboarding {
    place-items: center;
  }

  .onboarding-card {
    padding: 28px;
  }

  .compose-card {
    padding: 24px;
  }

  .settings-card {
    padding: 21px 22px;
  }

  .record-card {
    padding: 17px 18px;
  }
}

@media (max-width: 390px) {
  .topbar-inner {
    padding-left: 13px;
    padding-right: 13px;
  }

  #main {
    padding-left: 13px;
    padding-right: 13px;
  }

  .auth-card {
    padding: 22px 17px 19px;
  }

  .user-chip {
    max-width: 104px;
  }

  .brand-row.compact small {
    display: none;
  }

  .compose-card {
    padding: 17px 14px;
  }

  .settings-card {
    padding: 16px 14px;
  }

  .detail-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .plan-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

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