:root {
  --ink: #17343b;
  --muted: #66767a;
  --cream: #f7f2e7;
  --paper: #fffdf7;
  --line: #ded9cd;
  --teal: #007592;
  --aqua: #5cdfe5;
  --wine: #755564;
  --gold: #b57712;
  --shadow: 0 18px 48px rgba(25, 45, 49, .1);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Poppins, Roboto, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(0,117,146,.24); outline-offset: 2px; }

[hidden] { display: none !important; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 25px; padding: 32px 20px; background: radial-gradient(circle at 15% 20%, rgba(92,223,229,.24), transparent 34%), radial-gradient(circle at 85% 75%, rgba(117,85,100,.18), transparent 34%), var(--cream); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand b, .auth-brand small { display: block; }
.auth-brand b { font-family: Georgia,serif; font-size: 20px; font-weight: 500; }
.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.auth-card { width: min(100%,510px); padding: clamp(25px,5vw,42px); border: 1px solid rgba(117,85,100,.14); border-radius: 28px; background: rgba(255,253,247,.96); box-shadow: 0 28px 80px rgba(25,45,49,.15); }
.auth-card h1 { margin-bottom: 12px; font-size: clamp(34px,7vw,52px); }
.auth-card .lead { margin-bottom: 22px; font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 22px; padding: 5px; border-radius: 13px; background: #eee8de; }
.auth-tabs button { border: 0; border-radius: 9px; padding: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.auth-tabs button.active { color: #fff; background: var(--teal); box-shadow: 0 5px 13px rgba(0,117,146,.18); }
.auth-form { display: grid; gap: 7px; }
.auth-form label { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.auth-form input { width: 100%; height: 47px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #fff; }
.auth-form .primary-button { margin-top: 12px; }
.auth-form .text-button { margin-top: 3px; padding: 8px; }
.auth-form small { margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }
.auth-message { margin: 18px 0 0; padding: 12px 14px; border-radius: 11px; color: #31555e; background: #e5f5f3; font-size: 11px; line-height: 1.55; }
.auth-message[data-kind="error"] { color: #7c3650; background: #f7e7ed; }
.auth-message[data-kind="success"] { color: #225d4d; background: #e4f5ec; }
.auth-status { text-align: center; }
.auth-status h2 { margin: 8px 0 12px; font-size: 32px; }
.auth-status p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-status .primary-button { margin: 10px 0 7px; }
.status-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 25px; }
.auth-spinner { display: block; width: 40px; height: 40px; margin: 0 auto 18px; border: 4px solid #d9e2df; border-top-color: var(--teal); border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-foot { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 10;
  display: flex; flex-direction: column; padding: 26px 20px 22px;
  border-right: 1px solid rgba(117,85,100,.12);
  background: rgba(255,253,247,.91); backdrop-filter: blur(15px);
}
.brand, .mobile-brand { border: 0; background: none; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; padding: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: var(--wine); color: #fff; font-weight: 800; letter-spacing: .05em; box-shadow: 0 8px 22px rgba(117,85,100,.22); }
.brand b { display: block; font-size: 17px; }
.brand small { color: var(--muted); font-size: 11px; }
.main-nav { display: grid; gap: 7px; margin-top: 42px; }
.nav-item { width: 100%; border: 0; border-radius: 13px; background: transparent; display: flex; align-items: center; gap: 12px; padding: 12px 13px; font-size: 14px; font-weight: 650; cursor: pointer; text-align: left; transition: .2s ease; }
.nav-item span { width: 23px; font-size: 20px; line-height: 1; text-align: center; }
.nav-item em { margin-left: auto; min-width: 24px; padding: 2px 7px; border-radius: 99px; background: #efe5e9; color: var(--wine); font-style: normal; text-align: center; font-size: 11px; }
.nav-item:hover { background: rgba(152,244,238,.3); transform: translateX(2px); }
.nav-item.active { color: #fff; background: var(--teal); box-shadow: 0 9px 24px rgba(0,117,146,.2); }
.nav-item.active em { background: rgba(255,255,255,.18); color: #fff; }
.sidebar-note { margin-top: auto; padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #173e49, #007592); box-shadow: var(--shadow); }
.sidebar-note .lotus { font-size: 28px; color: var(--aqua); }
.sidebar-note p { margin: 8px 0 0; font-size: 12px; line-height: 1.55; }
.sidebar-signature { margin: 16px 4px 0; color: var(--muted); font-family: Georgia, serif; font-style: italic; font-size: 12px; }

.main-content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 8; height: 78px; padding: 16px clamp(20px,4vw,56px); display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(117,85,100,.1); background: rgba(247,242,231,.86); backdrop-filter: blur(16px); }
.mobile-brand { display: none; }
.global-search { max-width: 720px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 6px 18px rgba(25,45,49,.04); }
.global-search span { font-size: 22px; color: var(--teal); }
.global-search input { width: 100%; border: 0; outline: none; padding: 12px 2px; color: var(--ink); background: transparent; }
.global-search kbd { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: #f5f0e6; color: var(--muted); font-size: 10px; white-space: nowrap; }
.profile-chip { margin-left: auto; width: 42px; height: 42px; border: 2px solid #fff; border-radius: 50%; background: linear-gradient(145deg, var(--aqua), var(--teal)); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 7px 20px rgba(0,117,146,.2); }
.account-dialog { width: min(92vw,420px); padding: 36px; border: 0; border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 35px 90px rgba(0,0,0,.28); text-align: center; }
.account-dialog::backdrop { background: rgba(15,34,39,.72); backdrop-filter: blur(4px); }
.account-dialog .icon-button { position: absolute; right: 15px; top: 15px; }
.profile-large { width: 72px; height: 72px; display: grid; place-items: center; margin: 8px auto 20px; border-radius: 50%; color: #fff; background: linear-gradient(145deg,var(--aqua),var(--teal)); font-size: 22px; font-weight: 800; }
.account-dialog h2 { margin: 0 0 5px; font-size: 30px; }
.account-dialog p { color: var(--muted); font-size: 12px; }
.account-active { display: inline-block; margin: 6px 0 22px; padding: 6px 10px; border-radius: 99px; color: #23664f; background: #e4f5ec; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.account-dialog .secondary-button { width: 100%; }

#app { min-height: calc(100vh - 140px); padding: 40px clamp(20px,4vw,56px) 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 5vw, 62px); line-height: 1.03; font-weight: 500; letter-spacing: -.035em; }
h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.lead { max-width: 690px; color: var(--muted); line-height: 1.7; font-size: 16px; }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 36px; padding: clamp(28px,5vw,58px); border-radius: 30px; color: #fff; background: linear-gradient(135deg, #173b45 0%, #007592 58%, #4dbfc6 100%); box-shadow: 0 25px 60px rgba(0,90,111,.2); }
.hero::after { content: ""; position: absolute; width: 430px; height: 430px; right: -150px; top: -190px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.025); }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 16px; }
.hero .eyebrow { color: #bdfbfc; }
.hero p { max-width: 620px; color: rgba(255,255,255,.78); line-height: 1.65; }
.hero-search { display: flex; gap: 8px; max-width: 640px; margin-top: 25px; padding: 7px; border-radius: 16px; background: #fff; }
.hero-search input { min-width: 0; flex: 1; border: 0; outline: none; padding: 11px 12px; color: var(--ink); }
.hero-search button { border: 0; border-radius: 11px; padding: 0 20px; background: var(--wine); color: #fff; font-weight: 750; cursor: pointer; }
.hero-stat { position: relative; z-index: 1; align-self: center; justify-self: end; width: min(100%,310px); padding: 26px; border: 1px solid rgba(255,255,255,.2); border-radius: 24px; background: rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.hero-stat strong { display: block; font-family: Georgia, serif; font-size: 66px; line-height: 1; font-weight: 500; }
.hero-stat > span { color: #c8fbfc; font-size: 13px; }
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 22px; }
.stat-row div { padding: 10px 6px; border-radius: 11px; background: rgba(255,255,255,.1); text-align: center; }
.stat-row b { display: block; font-size: 17px; }
.stat-row small { color: rgba(255,255,255,.65); font-size: 9px; }

.section { margin-top: 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(25px,3vw,36px); }
.text-button { border: 0; background: transparent; color: var(--teal); font-weight: 750; cursor: pointer; }
.therapy-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.therapy-card { position: relative; min-height: 235px; overflow: hidden; border: 0; border-radius: var(--radius); padding: 25px; color: #fff; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: .25s ease; }
.therapy-card:hover { transform: translateY(-5px); box-shadow: 0 24px 50px rgba(25,45,49,.17); }
.therapy-card::after { content: ""; position: absolute; width: 170px; height: 170px; right: -50px; bottom: -70px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255,255,255,.05), 0 0 0 50px rgba(255,255,255,.03); }
.therapy-card.mindfulness { background: linear-gradient(145deg,#0086a5,#43c8cc); }
.therapy-card.tcc { background: linear-gradient(145deg,#755564,#a36a83); }
.therapy-card.gestalt { background: linear-gradient(145deg,#9a6208,#d8a645); }
.therapy-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; background: rgba(255,255,255,.16); font-size: 22px; }
.therapy-card h3 { margin: 30px 0 5px; font-family: Georgia,serif; font-size: 29px; font-weight: 500; }
.therapy-card p { max-width: 240px; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.5; }
.therapy-card .count { position: absolute; right: 22px; top: 24px; font-size: 12px; font-weight: 800; }

.quick-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-chip { border: 1px solid var(--line); border-radius: 99px; padding: 10px 15px; background: var(--paper); font-size: 13px; font-weight: 650; cursor: pointer; transition: .2s; }
.quick-chip:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

.library-toolbar { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; margin-bottom: 24px; }
.inline-search, .select-field { height: 46px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); }
.inline-search { padding: 0 15px; }
.select-field { padding: 0 35px 0 13px; }
.results-meta { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.resource-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.resource-card { overflow: hidden; border: 1px solid rgba(117,85,100,.13); border-radius: 18px; background: var(--paper); box-shadow: 0 10px 27px rgba(25,45,49,.055); transition: .22s ease; }
.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.resource-thumb { position: relative; aspect-ratio: 3 / 3.7; overflow: hidden; background: #e9e2d7; cursor: pointer; }
.resource-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .3s ease; }
.resource-card:hover .resource-thumb img { transform: scale(1.025); }
.therapy-badge { position: absolute; left: 10px; top: 10px; padding: 5px 9px; border-radius: 99px; color: #fff; background: rgba(23,52,59,.76); backdrop-filter: blur(8px); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.favorite-button { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: var(--wine); font-size: 19px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.favorite-button.saved { background: var(--wine); color: #fff; }
.resource-info { padding: 16px; }
.resource-info small { color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.resource-info h3 { min-height: 46px; margin: 7px 0 10px; font-size: 15px; line-height: 1.42; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 8px; border-radius: 99px; color: var(--muted); background: #f1ede5; font-size: 9px; }
.empty-state { grid-column: 1/-1; padding: 65px 25px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.38); }
.empty-state b { display: block; margin-bottom: 8px; font-family: Georgia,serif; font-size: 26px; }

.selector-card { max-width: 860px; margin: 0 auto; padding: clamp(25px,5vw,50px); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.progress { height: 6px; margin-bottom: 35px; border-radius: 9px; background: #e8e2d8; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),var(--aqua)); transition: width .3s; }
.selector-card h2 { font-size: clamp(28px,4vw,42px); }
.choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 25px; }
.choice { border: 1px solid var(--line); border-radius: 16px; padding: 18px 14px; background: #fff; font-weight: 700; cursor: pointer; transition: .2s; }
.choice:hover, .choice.selected { border-color: var(--teal); color: var(--teal); background: rgba(92,223,229,.1); transform: translateY(-2px); }

.bonus-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.bonus-card { display: flex; flex-direction: column; min-height: 250px; padding: 24px; border: 1px solid rgba(117,85,100,.15); border-radius: 20px; background: var(--paper); box-shadow: 0 12px 30px rgba(25,45,49,.06); }
.bonus-card .book-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--wine); font-size: 23px; }
.bonus-card h3 { margin: 22px 0 8px; font-family: Georgia,serif; font-size: 22px; font-weight: 500; }
.bonus-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.bonus-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bonus-meta span { color: var(--muted); font-size: 11px; }
.open-book { border: 0; border-radius: 10px; padding: 9px 12px; color: #fff; background: var(--teal); text-decoration: none; font-size: 11px; font-weight: 750; }

.resource-dialog { width: min(1180px,96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 35px 90px rgba(0,0,0,.3); }
.resource-dialog::backdrop { background: rgba(15,34,39,.78); backdrop-filter: blur(5px); }
.dialog-frame { padding: 22px; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 4px 4px 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: clamp(22px,3vw,34px); }
.icon-button { width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #eee8de; font-size: 26px; cursor: pointer; }
.dialog-body { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 22px; padding-top: 20px; }
.sheet-wrap { max-height: 69vh; overflow: auto; border-radius: 14px; background: #d9d4c9; text-align: center; }
.sheet-wrap img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.sheet-wrap img.zoomed { width: auto; max-width: none; min-width: 130%; cursor: zoom-out; }
.dialog-aside { padding: 8px 5px; }
.detail-category { margin: 20px 0; padding: 14px; border-radius: 12px; color: var(--muted); background: #f1ede5; font-size: 12px; }
.primary-button, .secondary-button { border-radius: 11px; font-weight: 750; cursor: pointer; }
.primary-button { width: 100%; border: 0; padding: 13px; color: #fff; background: var(--wine); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.secondary-button { border: 1px solid var(--line); padding: 10px 7px; background: #fff; font-size: 11px; }
.tip { margin-top: 24px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.application-panel { display: grid; gap: 7px; margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #f7f2e9; }
.application-panel .eyebrow { margin: 0 0 3px; }
.application-panel label { color: var(--muted); font-size: 10px; font-weight: 750; }
.application-panel .select-field, .application-panel .inline-search { width: 100%; height: 40px; }
.application-panel textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
.application-panel .primary-button { margin-top: 4px; padding: 10px; font-size: 11px; }
.application-panel .text-button { padding: 5px; font-size: 11px; }
.application-panel small { color: var(--muted); font-size: 9px; line-height: 1.4; }

.client-layout { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 22px; align-items: start; }
.client-form, .client-list-panel, .client-detail { border: 1px solid rgba(117,85,100,.14); border-radius: 22px; background: var(--paper); box-shadow: 0 12px 32px rgba(25,45,49,.06); }
.client-form { position: sticky; top: 104px; padding: 24px; }
.client-form h2 { margin-bottom: 8px; font-size: 26px; }
.client-form p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.client-form label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.client-form input, .client-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; }
.client-form textarea { resize: vertical; }
.client-form .primary-button { margin-top: 14px; }
.privacy-note { margin-top: 15px !important; padding: 12px; border-radius: 11px; background: #f0ece3; font-size: 10px !important; }
.client-list-panel { padding: 20px; }
.client-list { display: grid; gap: 11px; }
.client-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 13px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 12px; background: #fff; text-align: left; cursor: pointer; transition: .2s; }
.client-row:hover { border-color: var(--teal); transform: translateY(-2px); }
.client-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg,var(--teal),#55cdd0); font-weight: 800; }
.client-row h3 { margin: 0 0 3px; font-size: 15px; }
.client-row p { margin: 0; color: var(--muted); font-size: 10px; }
.client-row > span:last-child { color: var(--teal); font-size: 20px; }
.client-detail { padding: clamp(20px,4vw,34px); }
.client-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.client-detail-head h1 { margin: 0; font-size: clamp(30px,4vw,46px); }
.client-actions { display: flex; gap: 8px; }
.danger-button { border: 1px solid #d9b9c4; border-radius: 10px; padding: 9px 12px; color: #8b3e59; background: #fff; cursor: pointer; font-size: 11px; font-weight: 750; }
.client-notes { margin: 20px 0; padding: 15px; border-radius: 13px; color: var(--muted); background: #f2eee6; font-size: 12px; line-height: 1.6; }
.history-list { display: grid; gap: 12px; margin-top: 18px; }
.history-item { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.history-date { padding: 9px 5px; border-radius: 11px; color: #fff; background: var(--wine); text-align: center; font-size: 9px; line-height: 1.25; }
.history-date b { display: block; font-size: 16px; }
.history-item h3 { margin: 0 0 4px; font-size: 14px; cursor: pointer; }
.history-item h3:hover { color: var(--teal); }
.history-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.remove-history { border: 0; background: transparent; color: #9a6274; cursor: pointer; font-size: 18px; }
.toast { position: fixed; right: 22px; bottom: 25px; z-index: 100; max-width: 340px; padding: 13px 17px; border-radius: 13px; color: #fff; background: #173e49; box-shadow: 0 14px 35px rgba(0,0,0,.2); font-size: 12px; animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px clamp(20px,4vw,56px) 95px; border-top: 1px solid rgba(117,85,100,.1); color: var(--muted); font-size: 10px; }
.footer p { max-width: 570px; margin: 0; }
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .resource-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .bonus-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: auto; flex-wrap: wrap; padding: 12px 18px; }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
  .mobile-brand b { font-size: 13px; }
  .global-search { order: 3; flex-basis: 100%; max-width: none; }
  .global-search kbd { display: none; }
  .profile-chip { width: 36px; height: 36px; }
  #app { padding-top: 25px; padding-bottom: 105px; }
  .hero { grid-template-columns: 1fr; }
  .hero-stat { justify-self: stretch; width: 100%; }
  .therapy-grid { grid-template-columns: 1fr; }
  .therapy-card { min-height: 195px; }
  .resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dialog-body { grid-template-columns: 1fr; }
  .dialog-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .dialog-aside .tag-row, .dialog-aside .detail-category, .dialog-aside .tip { grid-column: 1/-1; }
  .dialog-aside .application-panel { grid-column: 1/-1; }
  .dialog-actions { margin-top: 0; }
  .mobile-nav { position: fixed; left: 10px; right: 10px; bottom: max(10px,env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-template-columns: repeat(6,1fr); padding: 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 18px; background: rgba(255,253,247,.92); box-shadow: 0 12px 35px rgba(0,0,0,.17); backdrop-filter: blur(16px); }
  .mobile-nav button { border: 0; border-radius: 11px; padding: 7px 3px; background: transparent; color: var(--muted); cursor: pointer; }
  .mobile-nav button.active { color: #fff; background: var(--teal); }
  .mobile-nav span { display: block; font-size: 19px; line-height: 1; }
  .mobile-nav small { font-size: 8px; }
  .footer { padding-bottom: 110px; }
  .client-layout { grid-template-columns: 1fr; }
  .client-form { position: static; }
}
@media (max-width: 580px) {
  h1 { font-size: 38px; }
  .hero { padding: 29px 22px; border-radius: 23px; }
  .hero-search { display: block; background: transparent; padding: 0; }
  .hero-search input { width: 100%; border-radius: 12px; background: #fff; }
  .hero-search button { width: 100%; margin-top: 8px; padding: 12px; }
  .stat-row { grid-template-columns: 1fr 1fr 1fr; }
  .library-toolbar { grid-template-columns: 1fr 1fr; }
  .library-toolbar .inline-search { grid-column: 1/-1; }
  .resource-grid { gap: 10px; }
  .resource-info { padding: 12px; }
  .resource-info h3 { min-height: 56px; font-size: 13px; }
  .resource-info .tag-row { display: none; }
  .bonus-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .dialog-frame { padding: 13px; }
  .dialog-body { padding-top: 12px; }
  .dialog-aside { grid-template-columns: 1fr; }
  .dialog-aside > * { grid-column: 1 !important; }
  .sheet-wrap { max-height: 61vh; }
  .footer { display: block; }
  .client-detail-head { display: block; }
  .client-actions { margin-top: 12px; flex-wrap: wrap; }
  .history-item { grid-template-columns: 48px minmax(0,1fr) auto; gap: 9px; }
}
