:root {
  color-scheme: light;
  --bg: #FBF6EC;
  --surface: #FFFDF8;
  --surface-soft: #F4ECDD;
  --ink: #2A2118;
  --muted: rgba(42, 33, 24, 0.68);
  --soft-muted: rgba(42, 33, 24, 0.66);
  --line: #E7DBC7;
  --brand: #9A4A18;
  --brand-dark: #8E4415;
  --brand-fill: #B4571E;
  --brand-fill-hover: #8E4415;
  --danger-fill: #9A3F1F;
  --danger-fill-hover: #7F3318;
  --coral: #E8912A;
  --coral-light: #F2A94A;
  --rose: #B0512D;
  --green: #5F7A54;
  --shadow: 0 18px 44px rgba(74, 52, 24, 0.07);
  --field: #FFFDF8;
  --subtle-bg: rgba(251, 246, 236, 0.62);
  --topbar-bg: rgba(255, 253, 248, 0.78);
  --page-bg: linear-gradient(180deg, #F6ECD8 0%, #FBF6EC 44%, #FBF6EC 78%, #FBEEDD 100%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171209;
  --surface: #231B11;
  --surface-soft: #2B2115;
  --ink: #F4EBDA;
  --muted: rgba(244, 235, 218, 0.66);
  --soft-muted: rgba(244, 235, 218, 0.56);
  --line: rgba(244, 235, 218, 0.13);
  --brand: #E08A3E;
  --brand-dark: #F0A45E;
  --brand-fill: #A9531A;
  --brand-fill-hover: #93461A;
  --coral: #F0A94A;
  --coral-light: #F6BE71;
  --rose: #DB7A4E;
  --green: #9DB58C;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  --field: #241D14;
  --subtle-bg: rgba(244, 235, 218, 0.08);
  --topbar-bg: rgba(35, 27, 17, 0.82);
  --page-bg: linear-gradient(180deg, #1E1710 0%, #191309 42%, #171209 78%, #211710 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  background-attachment: fixed;
  font-family:
    "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body::selection {
  color: #fff;
  background: var(--brand-fill);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-top: 18px;
}

.app-shell[hidden],
.auth-screen[hidden] {
  display: none;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(780px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.auth-card h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 760;
  line-height: 1;
}

.auth-subtitle {
  margin: -8px 0 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.auth-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-choices[hidden] {
  display: none;
}

.auth-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 282px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.auth-panel h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
}

.auth-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.reset-form {
  align-content: start;
}

.auth-form[hidden] {
  display: none;
}

.auth-note {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.auth-note[hidden] {
  display: none;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: var(--soft-muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.dev-code {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(232, 145, 42, 0.24);
  border-radius: 10px;
  color: #8E4415;
  background: rgba(232, 145, 42, 0.08);
  font-weight: 760;
}

.dev-code[hidden] {
  display: none;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 38px rgba(36, 31, 28, 0.045);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
}

.topbar h1 {
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 760;
  line-height: 1.05;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.topbar-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.menu-link {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.menu-link:hover,
.menu-link.is-active {
  color: var(--brand);
}

.burger-button {
  display: none;
  width: 40px;
  height: 40px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.burger-button span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.account-menu {
  position: relative;
}

.avatar-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #fff;
  background: var(--brand-fill);
  font-size: 13px;
  font-weight: 800;
}

.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 14px;
  width: 292px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 44px rgba(36, 31, 28, 0.12);
}

.account-popover[hidden] {
  display: none;
}

.account-summary {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.account-summary strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-section {
  display: grid;
  gap: 10px;
}

.account-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.theme-toggle {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-soft);
}

.theme-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.personal-info {
  display: grid;
  gap: 8px;
  margin: 0;
}

.personal-info div {
  display: grid;
  gap: 3px;
}

.personal-info dt {
  color: var(--soft-muted);
  font-size: 12px;
  font-weight: 700;
}

.personal-info dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-action {
  min-height: 42px;
  border: 1px solid rgba(180, 58, 78, 0.18);
  border-radius: 12px;
  color: var(--rose);
  background: rgba(180, 58, 78, 0.045);
  font-weight: 760;
}

.account-action.is-neutral {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 50px clamp(18px, 4vw, 44px) 72px;
}

.view[hidden] {
  display: none;
}

.view.is-active {
  display: block;
}

.capture-layout,
.manage-layout {
  display: grid;
  align-items: start;
  gap: 28px;
}

.capture-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.manage-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.capture-main,
.capture-side,
.side-stack {
  display: grid;
  gap: 18px;
}

.editor-area,
.recent-area,
.library-area,
.profile-area,
.settings-area,
.account-area,
.pricing-area,
.search-area,
.tags-area {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.editor-area {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.settings-area,
.profile-area,
.account-area,
.search-area,
.tags-area {
  padding: 22px;
}

.account-area {
  max-width: 680px;
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 20px;
  font-weight: 720;
  line-height: 1.18;
}

.primary-capture .section-heading h2 {
  color: var(--brand);
}

.capture-heading {
  padding: 0 6px;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 28px;
  max-width: 190px;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--subtle-bg);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill.is-on {
  border-color: rgba(180, 87, 30, 0.22);
  color: var(--brand);
  background: rgba(180, 87, 30, 0.08);
}

.quote-bubble,
.settings-form {
  display: grid;
  gap: 15px;
}

.quote-bubble {
  min-height: 342px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow:
    0 24px 60px rgba(36, 31, 28, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bubble-input {
  min-height: 232px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 21px;
  line-height: 1.45;
  resize: none;
}

.bubble-input::placeholder {
  color: var(--soft-muted);
}

.bubble-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.bubble-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.bubble-details {
  min-width: 0;
  color: var(--muted);
}

.bubble-details summary {
  width: max-content;
  max-width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  outline: none;
  cursor: pointer;
}

.bubble-details summary::-webkit-details-marker {
  display: none;
}

.bubble-details summary:hover,
.bubble-details[open] summary {
  color: var(--ink);
  background: rgba(180, 87, 30, 0.08);
}

.bubble-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.bubble-meta-grid input {
  min-height: 42px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--field);
}

.bubble-meta-grid input::placeholder {
  color: var(--soft-muted);
}

.bubble-meta-grid input:focus {
  border-color: rgba(180, 87, 30, 0.42);
  box-shadow: 0 0 0 3px rgba(180, 87, 30, 0.14);
}

.bubble-submit {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral-light) 0%, var(--coral) 100%);
  box-shadow: 0 10px 24px rgba(232, 145, 42, 0.22);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.bubble-submit:hover {
  background: linear-gradient(135deg, #F2A94A 0%, #C0701A 100%);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--soft-muted);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(180, 87, 30, 0.72);
  box-shadow: 0 0 0 4px rgba(180, 87, 30, 0.11);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}





.schedule-slot-top strong {
  color: var(--ink);
  font-size: 14px;
}

.switch-row {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.switch-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.primary-button,
.google-button,
.ghost-button,
.danger-button,
.tab-button,
.text-button {
  min-height: 46px;
  border-radius: 10px;
  padding: 10px 15px;
  border: 1px solid transparent;
  font-weight: 720;
}

.primary-button {
  color: #fff;
  background: var(--brand-fill);
}

.primary-button:hover {
  background: var(--brand-fill-hover);
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--field);
}

.google-button:hover,
.ghost-button:hover,
.tab-button:hover {
  border-color: rgba(180, 87, 30, 0.28);
  color: var(--brand);
}

.google-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--field);
  font-weight: 820;
}

.ghost-button,
.tab-button {
  border-color: var(--line);
  color: var(--ink);
  background: var(--field);
}

.tab-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--field);
  font-weight: 650;
}

.tab-button.is-active {
  border-color: var(--line);
  color: var(--ink);
  background: var(--field);
}

.danger-button {
  border-color: rgba(180, 58, 78, 0.18);
  color: var(--rose);
  background: rgba(180, 58, 78, 0.045);
}

.text-button {
  min-height: auto;
  justify-self: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--brand);
  background: transparent;
  font-size: 13px;
}

.forgot-button {
  margin-top: -4px;
}

.primary-button:disabled,
.google-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.wide-action {
  width: 100%;
}

.compact-button {
  min-height: 38px;
  padding: 7px 11px;
}

.search-input {
  max-width: 280px;
}

.search-area .search-input {
  max-width: none;
}

.quote-list,
.recent-list {
  display: grid;
  gap: 12px;
}

.recent-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-card {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.recent-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.quote-card p,
.recent-card p {
  margin: 0;
  line-height: 1.55;
}

.quote-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.tag {
  display: inline-flex;
  max-width: 150px;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(180, 87, 30, 0.08);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-actions button {
  min-height: 36px;
  padding: 7px 11px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-filter {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(180, 87, 30, 0.12);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--brand);
  background: rgba(180, 87, 30, 0.07);
  font-size: 13px;
  font-weight: 700;
}

.tag-filter:hover,
.tag-filter.is-active {
  border-color: rgba(180, 87, 30, 0.28);
  background: rgba(180, 87, 30, 0.12);
}

.clear-filter {
  color: var(--ink);
  background: var(--field);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--subtle-bg);
}

.compact-empty {
  width: 100%;
  padding: 16px;
}

.pricing-area {
  max-width: 900px;
  margin: 0 auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pricing-card {
  display: grid;
  gap: 22px;
  align-content: space-between;
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.pricing-card.featured {
  border-color: rgba(180, 87, 30, 0.24);
  background:
    linear-gradient(180deg, rgba(180, 87, 30, 0.08), transparent 52%),
    var(--field);
  box-shadow: 0 22px 52px rgba(180, 87, 30, 0.12);
}

.pricing-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.1;
}

.price {
  margin: 0;
  color: var(--brand);
  font-size: 42px;
  font-weight: 760;
  line-height: 1;
}

.price span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 720;
}

.pricing-card ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-weight: 650;
  list-style: none;
}

.pricing-card li {
  position: relative;
  padding-left: 21px;
}

.pricing-card li::before {
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--coral);
  content: "";
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 10px;
  color: var(--bg);
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .capture-layout,
  .manage-layout {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-top: 42px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
    width: min(100% - 24px, 1120px);
    padding: 11px 12px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .topbar-right {
    gap: 8px;
  }

  .burger-button {
    display: inline-grid;
  }

  .topbar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 62px;
    z-index: 18;
    display: none;
    min-width: 148px;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .topbar-menu.is-open {
    display: flex;
  }

  .menu-link {
    padding: 10px 11px;
  }

  .avatar-button {
    width: 40px;
    height: 40px;
  }

  .account-popover {
    right: 0;
    width: min(292px, calc(100vw - 32px));
  }

  .auth-card {
    padding: 26px;
  }

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

  .auth-panel {
    min-height: auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .quote-bubble {
    min-height: 230px;
    padding: 20px;
    border-radius: 22px;
  }

  .bubble-input {
    min-height: 140px;
    font-size: 18px;
  }

  .bubble-footer {
    grid-template-columns: 1fr auto;
  }

  .bubble-meta-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-input {
    max-width: none;
  }

  .recent-area,
  .library-area,
  .profile-area,
  .settings-area,
  .account-area,
  .pricing-area,
  .search-area,
  .tags-area {
    padding: 20px;
  }

  .schedule-header,
  .schedule-slot-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-area {
    padding: 0;
  }

  .recent-list {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: auto;
  }
}

/* ---- Account view ---- */
.account-page {
  display: grid;
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 4px 8px;
}

.account-avatar {
  display: grid;
  flex: none;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-fill);
  font-size: 19px;
  font-weight: 760;
}

.account-identity {
  min-width: 0;
  flex: 1;
}

.account-identity h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-chip {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 720;
}

.plan-chip.is-unlimited {
  color: #fff;
  background: var(--brand-fill);
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px 40px;
  padding: 26px 28px;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--line);
}

.settings-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
}

.settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.settings-body {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.settings-body [hidden],
.account-page [hidden] {
  display: none;
}

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

.row-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.row-note.subtle {
  font-size: 13px;
}

.row-note strong {
  color: var(--ink);
  font-weight: 720;
}

.row-value {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

.save-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.save-status[data-tone="success"] {
  color: var(--green);
}

.save-status[data-tone="error"] {
  color: var(--rose);
}

a.primary-button,
a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.plan-name {
  margin: 0;
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.plan-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.plan-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-meter.is-full span {
  background: var(--brand-fill);
}

.upgrade-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.store-actions {
  display: grid;
  gap: 10px;
}

.plan-current {
  margin: 0;
  padding: 12px 15px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 720;
  text-align: center;
}

.plan-current[hidden],
.store-actions[hidden] {
  display: none;
}

.danger-zone {
  border-color: rgba(176, 81, 45, 0.32);
}

.danger-button {
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid rgba(176, 81, 45, 0.45);
  border-radius: 10px;
  color: var(--rose);
  background: transparent;
  font-weight: 720;
}

.danger-button:hover {
  background: rgba(176, 81, 45, 0.08);
}

.danger-button.is-solid {
  border-color: transparent;
  color: #fff;
  background: var(--danger-fill);
}

.danger-button.is-solid:hover {
  background: var(--danger-fill-hover);
}

.danger-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.delete-confirm {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(176, 81, 45, 0.07);
}

.delete-confirm p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .settings-row {
    grid-template-columns: 1fr;
    padding: 22px 20px;
  }

  .account-identity h2 {
    font-size: 23px;
  }
}

/* ---- Library capacity ---- */
.capacity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.capacity:hover {
  border-color: var(--soft-muted);
}

.capacity-meter {
  display: block;
  width: 56px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.capacity-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.capacity.is-full {
  border-color: rgba(176, 81, 45, 0.4);
  color: var(--rose);
}

.capacity.is-full .capacity-meter span {
  background: var(--brand-fill);
}

.capacity.is-unlimited .capacity-meter {
  display: none;
}

.quote-bubble.is-locked {
  opacity: 0.55;
}

.quote-bubble.is-locked .bubble-submit {
  cursor: not-allowed;
}

.limit-notice {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(176, 81, 45, 0.28);
  border-radius: 14px;
  background: var(--surface);
}

.limit-notice[hidden] {
  display: none;
}

.limit-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.limit-notice .limit-title {
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 600;
}

.library-solo {
  max-width: 880px;
  margin: 0 auto;
}

/* ---- Storage card: the library as a shelf ---- */
.storage-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px 36px;
  align-items: end;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--coral) 7%, transparent), transparent 70%),
    var(--surface);
}

.storage-copy {
  display: grid;
  gap: 8px;
}

.storage-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.storage-title .plan-chip {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.storage-count {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  border-bottom: 3px solid var(--line);
}

.shelf[hidden] {
  display: none;
}

.shelf li {
  height: 58px;
  border: 1px dashed var(--line);
  border-bottom: 0;
  border-radius: 4px 4px 1px 1px;
}

.shelf li.is-filled {
  border: 0;
  background: linear-gradient(180deg, var(--coral-light), var(--coral));
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.08);
}

.shelf li.is-filled:nth-child(3n) {
  height: 52px;
  background: linear-gradient(180deg, var(--coral), var(--brand));
}

.shelf li.is-filled:nth-child(4n + 1) {
  height: 62px;
}

.storage-card .upgrade-block {
  grid-column: 1 / -1;
  padding-top: 6px;
}

.storage-card .upgrade-block[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .storage-card {
    grid-template-columns: 1fr;
    padding: 22px 20px;
  }

  .shelf {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    row-gap: 10px;
  }

  .shelf li {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capacity-meter span {
    transition: none;
  }
}

/* ---- Unlimited: the endless shelf ---- */
.shelf-infinite {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  margin: 4px -28px 0;
  padding: 0 0 6px;
  border-bottom: 3px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.shelf-infinite[hidden] {
  display: none;
}

.shelf-track {
  display: flex;
  width: max-content;
  align-items: flex-end;
  animation: shelf-drift var(--shelf-duration, 60s) linear infinite;
}

.shelf-infinite:hover .shelf-track {
  animation-play-state: paused;
}

.shelf-set {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-right: 4px;
}

.spine {
  display: block;
  flex: none;
  width: 16px;
  border-radius: 4px 4px 1px 1px;
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.08);
}

.spine.tone-a {
  background: linear-gradient(180deg, var(--coral-light), var(--coral));
}

.spine.tone-b {
  background: linear-gradient(180deg, var(--coral), var(--brand));
}

.spine.tone-c {
  background: linear-gradient(180deg, color-mix(in srgb, var(--coral-light) 70%, var(--surface)), var(--coral-light));
}

@keyframes shelf-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .shelf-track {
    animation: none;
  }
}

@media (max-width: 760px) {
  .shelf-infinite {
    margin-inline: -20px;
  }

  .spine {
    width: 12px;
  }
}

/* ---- Library: inline edit, undo toast, long words ---- */
.quote-card p,
.recent-card p {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.quote-card.is-editing {
  border-color: var(--brand-fill);
}

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

.edit-form textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.5;
}

.toast.has-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: auto;
}

.toast-action {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent);
  border-radius: 8px;
  color: var(--bg);
  background: transparent;
  font-weight: 720;
}

.toast-action:hover {
  background: color-mix(in srgb, var(--bg) 14%, transparent);
}

/* ---- Touch: every tap target reaches 44px on coarse pointers and phones ---- */
@media (pointer: coarse), (max-width: 760px) {
  .brand-lockup,
  .menu-link,
  .capacity,
  .bubble-details summary,
  .tag-filter,
  .quote-actions button,
  .account-action,
  .toast-action,
  .theme-toggle {
    min-height: 44px;
  }

  .brand-lockup,
  .menu-link,
  .tag-filter {
    display: inline-flex;
    align-items: center;
  }

  .burger-button,
  .avatar-button {
    width: 44px;
    height: 44px;
  }

  .tag-list {
    gap: 8px;
  }
}
