:root {
  --forest-950: #0b2e23;
  --forest-900: #103d2f;
  --forest-800: #164f3b;
  --forest-700: #1d684d;
  --forest-600: #278261;
  --forest-100: #dff1e9;
  --forest-50: #eff8f4;
  --cream: #fbfaf5;
  --paper: #ffffff;
  --ink: #15211d;
  --muted: #5d6c66;
  --line: #dbe4df;
  --warning: #8a5400;
  --warning-bg: #fff4d8;
  --danger: #a93434;
  --danger-bg: #fff0f0;
  --success: #146345;
  --shadow-sm: 0 1px 2px rgb(16 61 47 / 0.08), 0 5px 18px rgb(16 61 47 / 0.06);
  --shadow-lg: 0 18px 50px rgb(10 46 35 / 0.18);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --tap: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0%, rgb(39 130 97 / 0.08), transparent 28rem),
    var(--cream);
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #e4a72e;
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid #b9c8c1;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
}

textarea {
  min-height: 132px;
  padding: 12px 14px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder {
  color: #89968f;
}

label {
  color: #33443d;
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 6vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.62;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--forest-900);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--forest-700);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  align-items: end;
  gap: 3px;
  width: 31px;
  height: 31px;
  padding: 7px 5px;
  border-radius: 10px;
  background: var(--forest-800);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

.brand-mark span {
  display: block;
  height: 11px;
  border-radius: 2px 2px 1px 1px;
  background: #f4d78e;
}

.brand-mark span:nth-child(2) {
  height: 15px;
  background: white;
}

.brand-mark span:nth-child(3) {
  height: 9px;
  background: #a8dbc5;
}

.brand-mark--large {
  grid-template-columns: repeat(3, 10px);
  gap: 5px;
  width: 56px;
  height: 56px;
  padding: 12px 8px;
  border-radius: 17px;
  margin-bottom: 23px;
}

.brand-mark--large span {
  height: 20px;
}

.brand-mark--large span:nth-child(2) {
  height: 27px;
}

.brand-mark--large span:nth-child(3) {
  height: 16px;
}

.login-view {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px 18px;
  background:
    linear-gradient(145deg, rgb(16 61 47 / 0.95), rgb(22 79 59 / 0.87)),
    var(--forest-900);
}

.login-card {
  width: min(100%, 430px);
  padding: 32px 24px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin-bottom: 12px;
  color: var(--forest-950);
}

.login-description {
  margin-bottom: 26px;
}

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

.stack--compact {
  gap: 8px;
}

.stack--compact label:not(:first-child) {
  margin-top: 8px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 67px;
}

.text-button,
.clear-button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: var(--forest-700);
  background: transparent;
  font-weight: 800;
}

.password-field .text-button {
  position: absolute;
  top: 2px;
  right: 5px;
}

.security-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.form-error {
  margin: 1px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 0.85rem;
  font-weight: 700;
}

.field-help {
  margin: -2px 0 5px;
  font-size: 0.78rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: var(--tap);
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--forest-800);
  color: white;
  background: var(--forest-800);
  box-shadow: 0 3px 10px rgb(22 79 59 / 0.15);
}

.primary-button:hover:not(:disabled) {
  background: var(--forest-900);
}

.secondary-button {
  border: 1px solid #b6c9c0;
  color: var(--forest-800);
  background: var(--paper);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--forest-600);
  background: var(--forest-50);
}

.primary-button--wide,
.secondary-button--wide {
  width: 100%;
}

.secondary-button--compact {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.icon-button {
  display: inline-grid;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  color: var(--forest-800);
  background: var(--paper);
  font-size: 1.35rem;
}

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

.privacy-shield {
  display: grid;
  position: fixed;
  z-index: 1000;
  inset: 0;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
  color: white;
  background: var(--forest-950);
}

.privacy-shield[hidden] {
  display: none;
}

.privacy-shield__content {
  display: grid;
  justify-items: center;
  text-align: center;
}

.privacy-shield__content .brand-mark {
  background: rgb(255 255 255 / 0.13);
}

.privacy-shield__content strong {
  margin-bottom: 7px;
  font-size: 1.08rem;
}

.privacy-shield__content p {
  margin: 0;
  color: #dcece5;
  font-size: 0.86rem;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgb(22 79 59 / 0.11);
  background: rgb(251 250 245 / 0.92);
  backdrop-filter: blur(18px);
}

.app-header__inner {
  display: flex;
  width: min(100%, 980px);
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto;
  padding: 8px 16px;
}

.brand-button {
  display: inline-flex;
  min-height: var(--tap);
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  color: var(--forest-950);
  background: transparent;
  text-align: left;
}

.brand-button small,
.brand-button strong {
  display: block;
}

.brand-button small {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 0.66rem;
}

.brand-button strong {
  font-size: 1.02rem;
  letter-spacing: -0.025em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill,
.chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--forest-800);
  background: var(--forest-100);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-pill::before {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--forest-600);
  content: "";
}

.status-pill.is-offline {
  color: #6d4b17;
  background: var(--warning-bg);
}

.status-pill.is-offline::before {
  background: #c47b16;
}

.main-content {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
}

.app-section {
  animation: section-in 180ms ease-out;
}

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

.hero-card,
.sync-overview {
  overflow: hidden;
  position: relative;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 102% -10%, rgb(244 215 142 / 0.3), transparent 11rem),
    linear-gradient(135deg, var(--forest-900), var(--forest-700));
  box-shadow: var(--shadow-sm);
}

.hero-card .eyebrow,
.sync-overview .card-label {
  color: #c9eadb;
}

.hero-card > p:not(.eyebrow),
.sync-overview p {
  color: #dcece5;
}

.hero-card h1 {
  margin-bottom: 8px;
}

.hero-card > p:not(.eyebrow) {
  margin-bottom: 20px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

#search-query::-webkit-search-cancel-button {
  display: none;
}

.search-hero {
  padding: 16px;
}

.search-hero h1 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.search-hero > p:not(.eyebrow) {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.search-filters {
  grid-column: 1 / -1;
  min-width: 0;
}

.search-filters > summary {
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  color: #e4f1eb;
  font-size: 0.85rem;
  font-weight: 700;
}

.search-filters__content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.search-filters .filter-label {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
}

.search-filters .custom-date-range,
.search-filters .search-filter-reset {
  grid-column: 1 / -1;
}

.search-submit-button {
  min-height: 54px;
  border-color: #f0d589;
  color: var(--forest-950);
  background: #f0d589;
  box-shadow: 0 4px 12px rgb(5 35 26 / 0.28);
  font-size: 1rem;
}

.search-submit-button:hover:not(:disabled) {
  border-color: #ffe6a4;
  color: var(--forest-950);
  background: #ffe6a4;
}

.search-submit-button:active:not(:disabled) {
  background: #e6c66f;
  transform: translateY(1px);
}

.custom-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin: 0;
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: var(--radius-sm);
}

.custom-date-range legend,
.custom-date-range label,
.custom-date-range > small {
  color: #e4f1eb;
}

.custom-date-range legend {
  padding-inline: 5px;
  font-size: 0.82rem;
  font-weight: 800;
}

.custom-date-range > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.custom-date-range > span {
  min-height: var(--tap);
  align-content: center;
  color: #e4f1eb;
}

.custom-date-range > button,
.custom-date-range > small,
.custom-date-range > .form-error {
  grid-column: 1 / -1;
}

.custom-date-range > small {
  font-size: 0.74rem;
  line-height: 1.45;
}

.search-filter-reset {
  justify-self: start;
  color: white;
}

.recommendation-filters {
  display: grid;
  grid-column: 1 / -1;
  min-inline-size: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: var(--radius-sm);
  color: white;
  background: rgb(255 255 255 / 0.08);
}

.recommendation-filters legend {
  padding-inline: 5px;
  color: #e4f1eb;
  font-size: 0.82rem;
  font-weight: 800;
}

.history-sort-control {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-card .history-sort-control,
.hero-card .history-sort-control > span,
.hero-card .liked-only-control,
.hero-card .liked-only-control > strong {
  color: #ffffff;
}

.recommendation-filters select {
  min-height: 44px;
  width: 100%;
  min-width: 0;
}

.liked-only-filter {
  display: grid;
  width: 100%;
  min-height: 44px;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgb(255 255 255 / 0.42);
  border-radius: 10px;
}

.liked-only-control {
  display: flex;
  width: 100%;
  min-height: 24px;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  cursor: pointer;
}

.liked-only-filter small {
  display: block;
  padding-left: 28px;
  color: #dcece5;
  font-size: 0.71rem;
  font-weight: 500;
  line-height: 1.35;
}

.liked-only-control input {
  flex: 0 0 auto;
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: #f4d78e;
}

.search-input-wrap {
  display: flex;
  position: relative;
  align-items: center;
}

.search-input-wrap > span {
  position: absolute;
  left: 14px;
  color: var(--forest-700);
  font-size: 1.25rem;
}

.search-input-wrap input {
  min-height: 54px;
  padding-right: 48px;
  padding-left: 43px;
  border: 0;
  box-shadow: inset 0 0 0 1px rgb(14 48 37 / 0.15);
}

.search-input-wrap .clear-button {
  position: absolute;
  right: 3px;
  color: #73827b;
  font-size: 1.35rem;
}

.filter-label {
  color: #dcece5;
}

.notice {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  margin: 16px 0;
  padding: 13px 14px;
  border: 1px solid #c9ded4;
  border-radius: var(--radius-sm);
  background: var(--forest-50);
}

.notice > div {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  place-items: center;
  color: white;
  background: var(--forest-700);
  font-size: 0.76rem;
  font-weight: 900;
}

.notice p {
  margin: 0;
  color: #38584b;
  font-size: 0.86rem;
  line-height: 1.5;
}

.notice--warning {
  border-color: #ead7a9;
  background: var(--warning-bg);
}

.notice--warning > div {
  background: var(--warning);
}

.notice--warning p {
  color: #704b0f;
}

.search-summary {
  margin: 18px 0 4px;
  padding: 18px;
  border: 1px solid #bfdbcf;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e8f6ef, #f8fcfa);
}

.search-summary.is-not-found {
  border-color: var(--line);
  background: var(--paper);
}

.search-summary.is-uncertain {
  border-color: #ead7a9;
  background: var(--warning-bg);
}

.search-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--forest-900);
  font-size: 1.13rem;
}

.search-summary p {
  margin: 0;
  font-size: 0.88rem;
}

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

.section-heading--top {
  align-items: start;
  margin-top: 4px;
  margin-bottom: 18px;
}

.section-heading--results {
  margin-top: 23px;
}

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

.section-heading p {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.history-list,
.job-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-card {
  display: grid;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.history-card__main {
  min-width: 0;
}

.history-card__main h3 {
  overflow-wrap: anywhere;
  color: #192c24;
  font-size: 1.05rem;
  line-height: 1.45;
}

.history-card__main > p {
  margin: 5px 0 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.search-highlight {
  padding: 0 0.08em;
  border-radius: 0.2em;
  color: inherit;
  background: #ffe08a;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  color: #375247;
  background: #edf3f0;
  font-weight: 700;
}

.chip--account {
  color: var(--forest-800);
  background: var(--forest-100);
}

.chip--current,
.chip--certain {
  color: #0c5b3b;
  background: #d8f2e5;
}

.chip--warning,
.chip--possible {
  color: #714800;
  background: var(--warning-bg);
}

.note-badge {
  min-height: 40px;
  border: 1px solid #d9bd66;
  color: #664b08;
  background: #fff4cf;
  cursor: pointer;
}

.note-badge:hover:not(:disabled),
.note-badge:focus-visible {
  border-color: #a87400;
  background: #ffe9a9;
}

.book-group-card {
  display: block;
}

.book-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.current-loan-panel {
  display: grid;
  gap: 8px;
  margin-top: 13px;
  padding: 11px;
  border: 1px solid #cbe1d6;
  border-radius: var(--radius-sm);
  background: var(--forest-50);
}

.current-loan-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px 10px;
  color: #30483e;
  font-size: 0.8rem;
}

.current-loan-status > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.current-loan-status > span {
  font-weight: 750;
  text-align: right;
}

.current-loan-status > small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.current-loan-status.is-due-soon > span {
  color: var(--warning);
}

.current-loan-status.is-overdue > span {
  color: var(--danger);
}

.borrow-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.8rem;
}

.borrow-summary strong {
  color: var(--forest-900);
  font-size: 0.91rem;
}

.book-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #edf1ef;
}

.book-card__actions button {
  min-height: 44px;
}

.book-card__actions .book-detail-toggle {
  grid-column: 1 / -1;
}

.book-recommendation {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 7px;
}

.book-recommendation__heading {
  margin: 0 3px 0 0;
  color: var(--forest-900);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.rating-control {
  display: inline-flex;
  width: auto;
  min-width: 0;
  align-items: center;
  gap: 0;
}

.book-recommendation > .preference-button {
  margin-left: auto;
}

.book-card__actions .rating-star {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #80621a;
  background: transparent;
  line-height: 1;
  place-items: center;
}

.rating-star:hover:not(:disabled),
.rating-star:focus-visible {
  color: #664b08;
  background: #fff6d9;
}

.rating-star.is-selected {
  color: #a87400;
}

.rating-star__icon {
  font-size: 1.55rem;
}

.rating-control__value {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.book-recommendation + .mini-button {
  grid-column: 1 / -1;
}

.preference-button.is-pressed {
  border-color: var(--forest-600);
  color: white;
  background: var(--forest-700);
}

.danger-button,
.danger-button:hover:not(:disabled) {
  border-color: #7f2424;
  color: white;
  background: var(--danger);
}

.book-detail {
  margin-top: 13px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #f6f8f7;
}

.book-detail h4 {
  margin: 0 0 10px;
  color: var(--forest-900);
  font-size: 0.86rem;
}

.book-detail__message {
  margin: 0 0 9px;
  font-size: 0.82rem;
}

.book-event-list,
.current-loans-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-event {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.book-event:first-child {
  padding-top: 0;
  border-top: 0;
}

.book-event .history-card__dates {
  margin-top: 9px;
}

.current-filter {
  display: grid;
  gap: 6px;
  margin: 0 2px 14px;
}

.current-loan-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.current-loan-card h2 {
  overflow-wrap: anywhere;
  margin-bottom: 5px;
  color: #192c24;
  font-size: 1.05rem;
}

.current-loan-card > p {
  margin-bottom: 10px;
  font-size: 0.84rem;
}

.note-book-title {
  margin: -7px 0 17px;
  color: var(--forest-900);
  font-weight: 800;
}

.note-help-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
}

.note-help-row small {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.history-card__dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #edf1ef;
}

.history-card__dates div {
  min-width: 0;
}

.history-card__dates small,
.history-card__dates time {
  display: block;
}

.history-card__dates small {
  margin-bottom: 2px;
  color: #77857f;
  font-size: 0.7rem;
}

.history-card__dates time,
.history-card__dates span {
  color: #31453d;
  font-size: 0.82rem;
  font-weight: 750;
}

.empty-state {
  padding: 36px 22px;
  border: 1px dashed #bfcfc7;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.65);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  border-radius: 18px;
  place-items: center;
  color: var(--forest-700);
  background: var(--forest-100);
  font-size: 0.9rem;
  font-weight: 900;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.empty-state--compact {
  padding: 20px;
}

.empty-state--compact p {
  margin: 0;
}

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

.skeleton-list div {
  height: 134px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #e9eeeb 25%, #f6f8f7 50%, #e9eeeb 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite linear;
}

@keyframes skeleton {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.sync-overview {
  display: grid;
  gap: 18px;
}

.sync-overview h2 {
  font-size: 1.35rem;
}

.sync-overview p {
  margin-bottom: 0;
  font-size: 0.83rem;
}

.sync-overview .button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sync-overview .secondary-button {
  border-color: rgb(255 255 255 / 0.5);
  color: white;
  background: rgb(255 255 255 / 0.1);
}

.sync-overview .primary-button {
  border-color: #f0d589;
  color: var(--forest-950);
  background: #f0d589;
}

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

.account-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.account-card.is-disabled {
  background: #f4f5f4;
  box-shadow: none;
}

.account-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.account-card__header h3 {
  margin-bottom: 4px;
  font-size: 1.04rem;
}

.account-card__header p {
  margin: 0;
  font-size: 0.79rem;
}

.account-card__status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 14px 0;
  padding: 11px 0;
  border-top: 1px solid #edf1ef;
  border-bottom: 1px solid #edf1ef;
  color: var(--muted);
  font-size: 0.8rem;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa7a1;
}

.sync-dot.is-good { background: var(--forest-600); }
.sync-dot.is-running { background: #2877b9; animation: pulse 1s infinite alternate; }
.sync-dot.is-error { background: var(--danger); }

@keyframes pulse {
  to { opacity: 0.35; }
}

.account-card__actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-card__actions button {
  min-height: 42px;
  flex: 1 1 auto;
  padding-inline: 12px;
  font-size: 0.79rem;
}

.mini-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #bfd0c8;
  border-radius: 10px;
  color: var(--forest-800);
  background: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.job-card {
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.job-card h3 {
  margin: 0;
  font-size: 0.9rem;
}

.job-card p {
  margin: 3px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.switch-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px !important;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 51px;
  height: 30px;
}

.switch input {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
}

.switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: #a9b4af;
  transition: background 150ms ease;
}

.switch span::after {
  display: block;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
  transition: transform 150ms ease;
  content: "";
}

.switch input:checked + span {
  background: var(--forest-600);
}

.switch input:checked + span::after {
  transform: translateX(21px);
}

.switch input:focus-visible + span {
  outline: 3px solid #e4a72e;
  outline-offset: 2px;
}

.bottom-nav {
  display: grid;
  position: fixed;
  z-index: 25;
  right: 0;
  bottom: 0;
  left: 0;
  grid-template-columns: repeat(3, 1fr);
  min-height: calc(70px + env(safe-area-inset-bottom));
  padding: 6px max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
  border-top: 1px solid rgb(22 79 59 / 0.14);
  background: rgb(255 255 255 / 0.95);
  box-shadow: 0 -6px 25px rgb(16 61 47 / 0.08);
  backdrop-filter: blur(18px);
}

.bottom-nav--four {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav__item {
  display: grid;
  min-height: 58px;
  gap: 1px;
  place-content: center;
  border: 0;
  border-radius: 14px;
  color: #718078;
  background: transparent;
}

.bottom-nav__item > span {
  font-size: 1.45rem;
  line-height: 1;
}

.bottom-nav__item small {
  font-size: 0.68rem;
  font-weight: 800;
}

.bottom-nav__item.is-active {
  color: var(--forest-800);
  background: var(--forest-50);
}

.dialog {
  width: min(calc(100% - 24px), 510px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgb(6 28 21 / 0.64);
  backdrop-filter: blur(3px);
}

.dialog-card {
  overflow-y: auto;
  max-height: calc(100dvh - 32px);
  padding: 23px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--radius-lg);
  background: var(--cream);
}

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

.dialog-header h2,
.dialog-header p {
  margin-bottom: 0;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 22px;
}

.dialog--small {
  max-width: 430px;
}

.toast-region {
  display: grid;
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: calc(83px + env(safe-area-inset-bottom));
  left: 14px;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 13px 15px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 12px;
  color: white;
  background: #173e31;
  box-shadow: 0 8px 30px rgb(7 30 23 / 0.25);
  font-size: 0.86rem;
  font-weight: 700;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  background: #7e2a2a;
}

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

@media (min-width: 680px) {
  .login-card {
    padding: 42px;
  }

  .main-content {
    padding-top: 30px;
    padding-inline: 24px;
  }

  .hero-card,
  .sync-overview {
    padding: 30px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .filter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .custom-date-range,
  .search-filter-reset {
    grid-column: 1 / -1;
  }

  .recommendation-filters {
    grid-template-columns: minmax(230px, 1fr) minmax(180px, 220px);
    align-items: end;
  }

  .custom-date-range {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  }

  .custom-date-range > button {
    grid-column: auto;
  }

  .custom-date-range > small,
  .custom-date-range > .form-error {
    grid-column: 1 / -1;
  }

  .sync-overview {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .sync-overview .button-row {
    grid-template-columns: auto auto;
  }

  .history-card {
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
  }

  .book-group-card {
    display: block;
  }

  .book-card__actions {
    grid-template-columns: auto auto minmax(210px, 1fr);
  }

  .book-card__actions .book-detail-toggle {
    grid-column: auto;
  }

  .book-event .history-card__dates {
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid #edf1ef;
    border-left: 0;
  }

  .history-card__dates {
    padding-top: 0;
    padding-left: 18px;
    border-top: 0;
    border-left: 1px solid #edf1ef;
  }

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

  .bottom-nav {
    right: auto;
    bottom: 18px;
    left: 50%;
    width: 440px;
    min-height: 68px;
    padding: 5px;
    border: 1px solid rgb(22 79 59 / 0.15);
    border-radius: 23px;
    transform: translateX(-50%);
  }

  .toast-region {
    bottom: 100px;
  }
}

@media (min-width: 1000px) {
  .main-content {
    padding-bottom: 130px;
  }
}

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

@media (forced-colors: active) {
  .search-highlight {
    color: HighlightText;
    background: Highlight;
  }

  .brand-mark span,
  .sync-dot,
  .status-pill::before {
    forced-color-adjust: none;
  }
}
