/* Phase H design system: shared visual layer for every existing feature. */
:root {
  --bg-deep: #121916;
  --bg-mid: #1a2520;
  --bg-light: #26342d;
  --surface: rgba(32, 46, 39, 0.88);
  --surface-hover: #304238;
  --jade: #9bbd93;
  --jade-glow: #d4e8c9;
  --amber: #e3b87a;
  --amber-soft: #f5ddb8;
  --text: #f3f5ef;
  --text-muted: #bec7bd;
  --text-dim: #8c9b90;
  --danger: #e48888;
  --border: rgba(212, 232, 201, 0.13);
  --shadow: 0 18px 45px rgba(3, 9, 6, 0.32);
  --radius: 16px;
}

body {
  background: radial-gradient(circle at top left, #23372c 0, var(--bg-deep) 42rem);
  letter-spacing: 0.005em;
}

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 28px 28px;
}

#app { position: relative; }
h1, h2, h3 { letter-spacing: -0.025em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
p { max-width: 70ch; }

button, input, textarea, select { transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
button { border: 1px solid transparent; box-shadow: 0 4px 14px rgba(4, 12, 7, .18); }
button:hover:not(:disabled) { transform: translateY(-1px); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(227, 184, 122, .78); outline-offset: 3px;
}
input[type="email"], input[type="password"], input[type="text"], input[type="date"], textarea, select {
  border-color: var(--border); background: rgba(13, 22, 17, .72); border-radius: 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--jade); box-shadow: 0 0 0 4px rgba(155,189,147,.12); }

.dashboard-layout, .albums-panel, .notebook-panel, .tasks-panel, .settings-panel, .skills-panel { max-width: 1120px; padding-left: clamp(1rem, 4vw, 2.5rem); padding-right: clamp(1rem, 4vw, 2.5rem); }
.dash-header { border-bottom-color: var(--border); padding-top: 1rem; }
.dash-logo { font-weight: 750; letter-spacing: .02em; }
.dash-greeting { margin: 1.4rem 0 1.8rem; }
.dash-greeting p { font-size: 1.05rem; }

.dash-cards { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; }
.dash-card, .album-card, .settings-section, .tasks-item, .notebook-panel, .albums-panel, .skills-panel {
  background: linear-gradient(145deg, rgba(38,52,45,.94), rgba(24,35,29,.92)); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.dash-card { border-radius: var(--radius); min-height: 145px; text-align: left; color: inherit; font: inherit; width: auto; }
.dash-user { padding: .35rem .45rem; color: var(--text-muted); font: inherit; }
.dash-card:hover, .album-card:hover { border-color: rgba(212,232,201,.42); background: linear-gradient(145deg, #33473b, #26382f); }
.dash-card-icon { font-size: 1.8rem; }
.dash-card h3 { font-size: 1rem; }
.dash-card p { line-height: 1.45; }

.folder-tabs { gap: .55rem; padding-block: .8rem; }
.folder-tab { border-color: var(--border); background: rgba(26,37,32,.82); }
.folder-tab.active { background: var(--jade); color: #122016; }

.modal-overlay { backdrop-filter: blur(7px); background: rgba(5,10,7,.72); }
.modal { border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 26px 70px rgba(0,0,0,.48); background: #1c2822; }
.more-navigation { width: min(680px, calc(100% - 2rem)); max-height: min(780px, calc(100vh - 2rem)); overflow: auto; }
.more-navigation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.more-navigation-grid button { min-height: 3.1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(155, 198, 151, .1); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.more-navigation-grid button:hover, .more-navigation-grid button:focus-visible { background: rgba(155, 198, 151, .22); color: var(--text-strong); }
@media (max-width: 520px) { .more-navigation-grid { grid-template-columns: 1fr; } }
.modal-detail { max-width: 720px; }
.modal-header { border-bottom: 1px solid var(--border); padding-bottom: .8rem; }
.detail-body { padding-top: .5rem; }
.detail-actions, .notebook-actions, .modal-actions { gap: .6rem; flex-wrap: wrap; }

.albums-panel, .notebook-panel, .tasks-panel, .settings-panel, .skills-panel { margin: 1.5rem auto; border-radius: 20px; }
.albums-header, .notebook-head, .tasks-header, .settings-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.album-card { border-radius: 14px; border: 1px solid var(--border); }
.search-item { border: 1px solid var(--border); border-radius: 12px; background: rgba(16,26,20,.56); padding: .7rem .85rem; margin: .45rem 0; }
.notebook-page-detail, .album-detail { padding: 1rem 0; }

.settings-section { border-radius: var(--radius); padding: 1.2rem; }
.settings-section h3 { color: var(--amber-soft); }
.settings-hint { color: var(--text-muted); font-size: .92rem; }
.settings-danger { background: linear-gradient(145deg, rgba(82,35,35,.45), rgba(39,25,24,.75)); }

.bottom-nav { background: rgba(18,25,22,.92); border-top: 1px solid var(--border); backdrop-filter: blur(12px); }
.bottom-nav a { color: var(--text-muted); }
.bottom-nav a.active { color: var(--jade-glow); }

.error, .form-error, .settings-error, .voice-error, .timeline-error { display: block; background: rgba(126,42,42,.22); border: 1px solid rgba(245,166,166,.34); border-left: 3px solid var(--danger); border-radius: 8px; padding: .65rem .8rem; line-height: 1.4; }
.settings-success, .success, .voice-success, .timeline-success { display: block; background: rgba(80,125,78,.18); border: 1px solid rgba(181,227,176,.3); border-left: 3px solid var(--jade); border-radius: 8px; padding: .65rem .8rem; line-height: 1.4; }
.loading, .ft-loading, .pattern-loading, .onenext-loading { color: var(--jade-glow); background: rgba(18,25,22,.36); border-radius: 10px; padding: 1rem; }
button:disabled, input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; opacity: .62; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .dashboard-layout { padding-bottom: 7.5rem; }
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .dash-card { min-height: 128px; padding: 1rem; }
  .dash-card p { font-size: .78rem; }
  .albums-header, .notebook-head, .tasks-header, .settings-header { align-items: flex-start; flex-wrap: wrap; }
  .bottom-nav { overflow-x: auto; justify-content: flex-start; }
  .bottom-nav a { min-width: 62px; }
}

@media (max-width: 430px) {
  .dash-cards { grid-template-columns: 1fr; }
  .dash-card { min-height: auto; }
  .modal { margin: .5rem; width: calc(100% - 1rem); }
  .btn-small { min-height: 40px; }
}

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

.action-review-modal { width: min(100% - 2rem, 640px); }
.action-review-list { display: grid; gap: .75rem; margin: 1rem 0; }
.action-review-item { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem; border: 1px solid rgba(67, 107, 84, .35); border-radius: 14px; background: rgba(244, 250, 245, .7); color: #173c2c; cursor: pointer; }
.action-review-item input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: #477e60; }
.action-review-item span { display: grid; gap: .2rem; }
.action-review-item small { color: #426353; line-height: 1.4; }

/* Calm garden presentation. This visual layer does not alter feature logic. */
body {
  background-color: #0d1712;
  background-image: linear-gradient(180deg, rgba(7,17,12,.24), rgba(7,16,11,.52)), url("/background2.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
body::before { display: none; }

.aime-atmosphere { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.atmosphere-shade {
  position: absolute; inset: -3%;
  background: radial-gradient(circle at 50% 20%, rgba(202,231,190,.09), transparent 36%), linear-gradient(90deg, rgba(5,13,9,.25), transparent 42%, rgba(5,13,9,.18));
  animation: garden-breathe 24s ease-in-out infinite alternate;
}
.atmosphere-particles i {
  --size: 12px; --left: 10%; --duration: 30s; --delay: 0s;
  position: absolute; left: var(--left); bottom: -30px; width: var(--size); height: var(--size);
  border: 1px solid rgba(224,242,214,.4); border-radius: 48% 52% 56% 44%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.36), rgba(194,224,198,.08) 50%, transparent 72%);
  box-shadow: 0 0 12px rgba(186,224,191,.12); opacity: 0;
  animation: particle-rise var(--duration) linear var(--delay) infinite;
}
.atmosphere-particles i:nth-child(1) { --left: 8%; --size: 10px; --duration: 31s; --delay: -7s; }
.atmosphere-particles i:nth-child(2) { --left: 24%; --size: 14px; --duration: 36s; --delay: -23s; }
.atmosphere-particles i:nth-child(3) { --left: 43%; --size: 9px; --duration: 28s; --delay: -13s; }
.atmosphere-particles i:nth-child(4) { --left: 61%; --size: 13px; --duration: 34s; --delay: -29s; }
.atmosphere-particles i:nth-child(5) { --left: 78%; --size: 11px; --duration: 30s; --delay: -18s; }
.atmosphere-particles i:nth-child(6) { --left: 92%; --size: 15px; --duration: 38s; --delay: -4s; }

#app { position: relative; z-index: 1; }
.app-view-enter { opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform 1.05s cubic-bezier(.2,.75,.25,1); }
.app-view-visible { opacity: 1; transform: none; }
.welcome-view, .auth-view { min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }
.welcome-screen, .screen {
  width: min(100%, 460px); padding: clamp(1.6rem, 5vw, 2.8rem);
  border: 1px solid rgba(218,236,207,.18); border-radius: 28px;
  background: linear-gradient(145deg, rgba(22,39,30,.86), rgba(10,23,16,.78));
  box-shadow: 0 28px 80px rgba(0,0,0,.42); backdrop-filter: blur(14px); text-align: center;
}
.welcome-mark, .auth-butterfly { width: 62px; height: 62px; margin: 0 auto 1.15rem; }
.welcome-mark img, .auth-butterfly {
  display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 14px rgba(210,230,174,.25));
  animation: mark-hover 5.5s ease-in-out infinite;
}
.welcome-eyebrow, .family-tree-kicker { color: var(--amber-soft); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.welcome-screen h1 { margin: .35rem 0 .65rem; }
.welcome-screen > p:not(.welcome-eyebrow) { margin-inline: auto; }
.welcome-enter { width: auto; min-width: 180px; margin-top: .8rem; padding-inline: 1.65rem; }

.dashboard-layout {
  background: linear-gradient(180deg, rgba(13,26,19,.78), rgba(13,25,18,.9));
  border-inline: 1px solid rgba(218,236,207,.08); box-shadow: 0 0 70px rgba(0,0,0,.18); backdrop-filter: blur(8px);
}
.home-chat { margin: 0 0 1.35rem; padding: clamp(1rem, 2.4vw, 1.5rem); border: 1px solid rgba(255,255,255,.38); border-radius: 24px; }
.home-chat-title-row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.home-chat-title-row .btn-small { width: auto; margin: 0; white-space: nowrap; }
.home-chat-heading h2 { margin: .15rem 0 .3rem; color: #fff; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.home-chat-heading p, .home-chat-note { margin: 0; color: rgba(255,255,255,.86); }
.home-chat-messages { display: flex; flex-direction: column; gap: .55rem; max-height: 190px; overflow: auto; margin: 1rem 0 .75rem; padding: .1rem; }
.home-chat-empty { margin: 0; color: rgba(255,255,255,.78); }
.home-chat-bubble { display: flex; gap: .6rem; align-items: flex-start; max-width: 88%; padding: .65rem .8rem; border-radius: 14px; color: #fff; line-height: 1.4; white-space: pre-wrap; }
.home-chat-bubble strong { flex: 0 0 auto; color: #fff3d2; }
.home-chat-user { align-self: flex-end; background: rgba(62, 104, 79, .62); }
.home-chat-assistant { align-self: flex-start; background: rgba(28, 62, 45, .62); }
.home-chat-composer { display: flex; gap: .7rem; align-items: stretch; }
.home-chat-composer textarea { flex: 1; min-height: 3.2rem; resize: vertical; color: #183126; background: rgba(248,252,247,.78); }
.home-chat-send { width: auto; min-width: 84px; margin: 0; align-self: stretch; }
.home-chat-note { margin-top: .6rem; font-size: .78rem; opacity: .82; }
.home-chat-organised { align-self: flex-start; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .55rem .7rem; border: 1px solid rgba(255,255,255,.36); border-radius: 12px; background: rgba(28,62,45,.48); color: #fff; font-size: .82rem; }
.home-chat-organised button { width: auto; margin: 0; padding: .35rem .6rem; font-size: .78rem; }
.home-chat-sources { align-self: flex-start; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; max-width: 100%; }
.home-chat-sources .settings-hint { margin: 0; }
.home-chat-photo-source { display: inline-flex; gap: .45rem; align-items: center; width: auto; margin: 0; padding: .3rem .45rem; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: rgba(28,62,45,.44); color: #fff; font-size: .78rem; }
.home-chat-photo-source img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: rgba(255,255,255,.2); }
.home-chat-file-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.2); }
.home-chat-photo-source span { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.organisation-result-list { display: grid; gap: .65rem; padding: 0; list-style: none; }
.organisation-result-list li { display: grid; gap: .2rem; padding: .7rem; border: 1px solid rgba(37,77,58,.18); border-radius: 10px; }
.home-search-entry { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; margin: 1rem 0 1.35rem; padding: 1rem 1.15rem; border: 1px solid rgba(255,255,255,.38); border-radius: 18px; background: rgba(205,225,214,.24); color: #fff; }
.home-search-entry > span { font-size: 1.45rem; }
.home-search-entry h2, .home-search-entry p { margin: 0; }
.home-search-entry h2 { font-size: 1.1rem; }
.home-search-entry p { margin-top: .2rem; color: rgba(255,255,255,.82); }
.home-search-entry button { width: auto; margin: 0; }
@media (max-width: 520px) { .home-search-entry { grid-template-columns: auto 1fr; } .home-search-entry button { grid-column: 1 / -1; width: 100%; } }
.home-chat-action { align-self: flex-start; display: grid; gap: .3rem; max-width: 88%; padding: .7rem .8rem; border: 1px solid rgba(255,255,255,.4); border-radius: 14px; background: rgba(106, 145, 119, .42); color: #fff; }
.home-chat-action strong { color: #fff3d2; }
.home-chat-action div { display: flex; gap: .45rem; margin-top: .25rem; }
.home-chat-action button { width: auto; margin: 0; padding: .42rem .7rem; font-size: .82rem; }
.home-chat-action-cancel { background: transparent; border: 1px solid rgba(255,255,255,.44); color: #fff; }
.family-tree-feature {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.85fr);
  align-items: center; width: 100%; min-height: 300px; margin: 0 0 1.2rem; padding: clamp(1.2rem,4vw,2.2rem);
  overflow: hidden; border: 1px solid rgba(214,235,202,.2); border-radius: 24px;
  background: radial-gradient(circle at 77% 45%, rgba(168,210,161,.15), transparent 33%), linear-gradient(135deg, rgba(41,65,51,.94), rgba(16,34,24,.93));
  color: var(--text); text-align: left; box-shadow: var(--shadow);
}
.family-tree-feature:hover {
  border-color: rgba(228,239,195,.48);
  background: radial-gradient(circle at 77% 45%, rgba(185,222,174,.2), transparent 34%), linear-gradient(135deg, rgba(46,72,57,.96), rgba(17,37,26,.95));
}
.memory-garden-actions { margin: 1.35rem 0 2rem; padding: 0; border: 0; background: transparent; }
.garden-section-heading h2 { margin: .2rem 0 .35rem; color: var(--text-strong); font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.garden-section-heading p { margin: 0; color: var(--text-muted); }
.capture-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1.2rem 0; }
.garden-action, .garden-chip { border: 1px solid rgba(212,232,201,.28); border-radius: 15px; color: var(--text); background: rgba(37, 61, 49, .7); font: inherit; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.garden-action { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: center; padding: .85rem 1rem; }
.garden-action > span { grid-row: span 2; font-size: 1.35rem; }
.garden-action strong, .garden-chip strong { color: var(--text-strong); }
.garden-action small, .garden-chip small { display: block; margin-top: .2rem; color: var(--text-muted); font-size: .78rem; }
.garden-action-primary { background: rgba(171, 211, 164, .24); border-color: rgba(212,232,201,.5); }
.garden-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.garden-chip { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; }
.garden-chip > span:first-child { font-size: 1.3rem; }
.garden-action:hover, .garden-action:focus-visible, .garden-chip:hover, .garden-chip:focus-visible { transform: translateY(-2px); border-color: rgba(212,232,201,.68); background: rgba(60, 91, 72, .78); }
@media (max-width: 720px) { .capture-strip, .garden-links { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .capture-strip, .garden-links { grid-template-columns: 1fr; } }
.family-tree-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; max-width: 440px; }
.family-tree-copy strong { margin: .2rem 0 .6rem; color: var(--jade-glow); font-size: clamp(1.65rem,4vw,2.45rem); line-height: 1.1; }
.family-tree-copy > span:nth-child(3) { color: var(--text-muted); font-weight: 400; line-height: 1.55; }
.family-tree-open { margin-top: 1.2rem; color: var(--amber-soft); font-size: .92rem; }
.family-tree-art { position: relative; display: block; align-self: stretch; min-height: 250px; }
.family-tree-art img {
  position: absolute; inset: -40px -24px -44px -16px; width: calc(100% + 40px); height: calc(100% + 84px);
  object-fit: contain; filter: drop-shadow(0 0 18px rgba(180,219,160,.12));
}
.tree-firefly {
  position: absolute; z-index: 2; width: 5px; height: 5px; border-radius: 50%; background: #ffd274;
  box-shadow: 0 0 7px 3px rgba(255,192,79,.42); animation: firefly-pulse 4.4s ease-in-out infinite;
}
.tree-firefly-one { left: 27%; top: 35%; animation-delay: -1.2s; }
.tree-firefly-two { left: 62%; top: 22%; animation-delay: -3.5s; }
.tree-firefly-three { left: 73%; top: 48%; animation-delay: -2.1s; }
.tree-firefly-four { left: 43%; top: 57%; animation-delay: -.4s; }

@keyframes particle-rise {
  0% { transform: translate3d(0,0,0) scale(.8); opacity: 0; }
  12% { opacity: .28; }
  48% { transform: translate3d(16px,-52vh,0) scale(1); opacity: .23; }
  82% { opacity: .2; }
  100% { transform: translate3d(-12px,-110vh,0) scale(1.08); opacity: 0; }
}
@keyframes garden-breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
@keyframes mark-hover { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes firefly-pulse { 0%,100% { opacity: .22; transform: scale(.7); } 45% { opacity: .95; transform: scale(1.18); } 68% { opacity: .44; transform: scale(.9); } }

@media (max-width: 700px) {
  body { background-attachment: scroll; }
  .family-tree-feature { grid-template-columns: 1fr; min-height: 410px; }
  .family-tree-copy { max-width: 100%; }
  .family-tree-art { min-height: 210px; margin-top: .4rem; }
  .family-tree-art img { inset: -24px -16px -48px; width: calc(100% + 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .atmosphere-shade, .atmosphere-particles i, .welcome-mark img, .auth-butterfly, .tree-firefly { animation: none !important; }
  .atmosphere-particles { display: none; }
  .tree-firefly { opacity: .58; }
  .app-view-enter { opacity: 1; transform: none; }
}

/* Peaceful daylight correction */
:root {
  --bg-deep: #334f43;
  --bg-mid: #547165;
  --bg-light: #789187;
  --surface: rgba(221, 233, 225, .42);
  --surface-hover: rgba(237, 244, 239, .58);
  --jade: #b9d9bb;
  --jade-glow: #eff9e9;
  --amber: #efcda0;
  --amber-soft: #fff0d4;
  --text: #f9fcf7;
  --text-muted: #e0e9e2;
  --text-dim: #c1d0c5;
  --border: rgba(244, 251, 243, .34);
  --shadow: 0 18px 46px rgba(24, 48, 38, .18);
}

body {
  background-color: #668078;
  background-image:
    linear-gradient(180deg, rgba(204, 221, 213, .28), rgba(93, 126, 112, .22)),
    url("/background2.png");
}

.atmosphere-shade {
  background:
    radial-gradient(circle at 50% 16%, rgba(238, 247, 235, .34), transparent 42%),
    linear-gradient(180deg, rgba(210, 228, 219, .15), rgba(93, 125, 111, .08));
}

.atmosphere-particles i {
  border-color: rgba(246, 255, 241, .72);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.84), rgba(227,244,229,.2) 52%, transparent 74%);
  box-shadow: 0 0 15px rgba(234, 252, 233, .32);
}

.welcome-screen,
.screen {
  border-color: rgba(255, 255, 255, .42);
  background: linear-gradient(145deg, rgba(205, 222, 213, .32), rgba(105, 139, 123, .2));
  box-shadow: 0 24px 70px rgba(31, 57, 46, .17);
  backdrop-filter: blur(7px);
}

.welcome-screen h1,
.screen h1,
.screen h2 { color: #fff; text-shadow: 0 2px 14px rgba(35, 69, 53, .22); }
.welcome-screen p,
.screen p { color: rgba(255, 255, 255, .9); }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
textarea,
select {
  color: #173126;
  border-color: rgba(255,255,255,.48);
  background: rgba(248, 252, 247, .72);
}
input::placeholder,
textarea::placeholder { color: rgba(42, 66, 55, .62); }

.link-btn { color: #f3fff0; }

.dashboard-layout {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.dash-header {
  border-bottom-color: rgba(255,255,255,.3);
  text-shadow: 0 2px 12px rgba(28, 55, 43, .2);
}
.dash-logo,
.dash-greeting h1 { color: #fff; }
.dash-logo { font-size: 1.7rem; }
.dash-user,
.dash-settings-btn,
.dash-greeting p { color: rgba(255,255,255,.9); }
.dash-user {
  width: auto;
  margin-left: auto;
  cursor: default;
  color: rgba(255,255,255,.9);
}
.dash-user:hover { color: rgba(255,255,255,.9); }

.dash-card,
.album-card,
.settings-section,
.tasks-item,
.notebook-panel,
.albums-panel,
.skills-panel,
.home-chat,
.panic-section,
.family-tree-feature {
  border-color: rgba(255,255,255,.35);
  background: linear-gradient(145deg, rgba(221, 234, 226, .48), rgba(114, 150, 132, .3));
  box-shadow: 0 14px 36px rgba(31, 57, 46, .14);
  backdrop-filter: blur(8px);
}
.dash-card:hover,
.album-card:hover,
.family-tree-feature:hover {
  border-color: rgba(255,255,255,.64);
  background: linear-gradient(145deg, rgba(238, 245, 240, .63), rgba(151, 183, 166, .4));
}
.dash-card h3,
.family-tree-copy strong { color: #fff; text-shadow: 0 2px 10px rgba(37, 66, 52, .22); }
.dash-card p,
.family-tree-copy > span:nth-child(3) { color: rgba(255,255,255,.88); }

.family-tree-feature {
  background:
    radial-gradient(circle at 76% 43%, rgba(238, 222, 235, .25), transparent 35%),
    linear-gradient(135deg, rgba(207, 225, 215, .54), rgba(104, 143, 123, .3));
}
.family-tree-feature:hover {
  background:
    radial-gradient(circle at 76% 43%, rgba(244, 228, 240, .32), transparent 36%),
    linear-gradient(135deg, rgba(231, 240, 233, .62), rgba(135, 169, 150, .38));
}
.family-tree-art img { filter: drop-shadow(0 0 18px rgba(255, 222, 211, .25)); }
.family-tree-open,
.family-tree-kicker { color: #fff1d1; }

.tree-firefly {
  width: 5px;
  height: 5px;
  left: 0;
  top: 0;
  offset-rotate: 0deg;
  animation-name: firefly-wander, firefly-twinkle;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
}
.tree-firefly-one {
  offset-path: path("M 64 168 C 102 80 210 82 260 144 C 287 178 252 217 182 190 C 116 165 92 207 64 168");
  animation-duration: 16s, 3.7s;
  animation-delay: -4s, -1.2s;
}
.tree-firefly-two {
  offset-path: path("M 170 62 C 242 18 331 55 302 120 C 273 183 202 164 174 117 C 151 88 142 75 170 62");
  animation-duration: 19s, 4.4s;
  animation-delay: -13s, -3.5s;
}
.tree-firefly-three {
  offset-path: path("M 238 158 C 308 112 370 137 353 204 C 336 268 248 249 222 199 C 207 177 216 169 238 158");
  animation-duration: 22s, 3.9s;
  animation-delay: -8s, -2.1s;
}
.tree-firefly-four {
  offset-path: path("M 103 221 C 161 177 239 211 222 269 C 205 324 119 313 79 270 C 54 243 71 230 103 221");
  animation-duration: 18s, 4.8s;
  animation-delay: -15s, -.4s;
}

.folder-tab,
.search-item,
.modal,
.bfly-card,
.checkin-form {
  border-color: rgba(255,255,255,.34);
  background: rgba(231, 240, 234, .72);
  color: #183128;
}
.folder-tab { color: #254638; }
.folder-tab.active { background: rgba(234, 248, 227, .94); color: #183126; }
.search-item strong,
.modal h2,
.modal h3 { color: #1e4435; }
.search-item p,
.modal p { color: #49675a; }

.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  border-top-color: rgba(255,255,255,.38);
  background: rgba(76, 109, 94, .72);
  box-shadow: 0 -8px 30px rgba(31,57,46,.12);
  backdrop-filter: blur(12px);
  padding: .78rem .35rem 1rem;
  gap: .12rem;
}
.bottom-nav a {
  color: rgba(255,255,255,.82);
  padding: 4px 7px;
  font-size: .86rem;
  line-height: 1.25;
}
.bottom-nav a.active,
.bottom-nav a:hover { color: #fff; }
.folders-panel-list { display: grid; gap: .6rem; margin-bottom: 1rem; }
.folders-panel-row { align-items: center; gap: .5rem; }
.folders-panel-row.active { border-color: rgba(135,190,145,.72); background: rgba(210,235,216,.72); }
.folder-panel-open {
  flex: 1 1 auto;
  min-height: 2.5rem;
  border: 0;
  background: transparent;
  color: #244b3b;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

body.has-app-navigation #app {
  padding-bottom: 5.75rem;
}

.bottom-nav[hidden] {
  display: none;
}
.tasks-header-actions { display: flex; gap: .5rem; margin-left: auto; }
.tasks-due-overdue { color: #8f2f2f; font-weight: 700; }
.tasks-completed-view .tasks-done-btn { display: none; }

/* Let the botanical garden remain visible behind the interface. */
body {
  background-image:
    url("/background2.png");
}
.atmosphere-shade {
  background: none;
}
.welcome-screen, .screen {
  background: rgba(205, 222, 213, .16);
  backdrop-filter: blur(1px);
}
.family-tree-feature {
  background:
    radial-gradient(circle at 76% 43%, rgba(238, 222, 235, .18), transparent 35%),
    linear-gradient(135deg, rgba(207, 225, 215, .30), rgba(104, 143, 123, .16));
  backdrop-filter: blur(3px);
}
.memory-garden-actions {
  background: rgba(215, 233, 221, .18);
  backdrop-filter: blur(3px);
}
.garden-action, .garden-chip { background: rgba(37, 61, 49, .42); }
.garden-action-primary { background: rgba(171, 211, 164, .28); }

.family-tree-page {
  width: min(100% - 2rem, 1040px);
  min-height: calc(100vh - 8rem);
  margin: 1.5rem auto;
  padding: clamp(1.1rem, 4vw, 2rem);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(215,231,220,.58), rgba(102,140,121,.36));
  box-shadow: 0 18px 46px rgba(24,48,38,.17);
  backdrop-filter: blur(9px);
}

.family-tree-page-header {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.34);
}

.family-tree-page-header .btn-back {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.family-tree-page-header h2 {
  margin: .15rem 0 .3rem;
  color: #fff;
}

.family-tree-page-header p:not(.family-tree-kicker) {
  margin: 0;
  color: rgba(255,255,255,.88);
}

.family-tree-page .ft-card {
  background: rgba(238,245,240,.72);
  border-color: rgba(255,255,255,.46);
}

@media (max-width: 560px) {
  .family-tree-page { width: calc(100% - 1rem); margin: .5rem auto; padding: 1rem; }
  .family-tree-page-header { flex-direction: column; gap: .8rem; }
}

.dash-nudge {
  border-color: rgba(255,255,255,.42);
  background: linear-gradient(135deg, rgba(230,241,232,.75), rgba(199,224,210,.64));
  box-shadow: 0 12px 30px rgba(31,57,46,.12);
  backdrop-filter: blur(7px);
}
.dash-nudge-text { color: #244b3b; }
.dash-nudge .btn-small,
.dash-nudge .btn-dismiss { width: auto; flex: 0 0 auto; margin: 0; }

.brain-list { display: grid; gap: .85rem; }
.brain-memory { align-items: flex-start; gap: .85rem; }
.brain-memory-main { flex: 1 1 auto; min-width: 0; }
.brain-memory-main h3 { margin: 0 0 .35rem; font-size: 1rem; }
.brain-memory-main p { margin: 0 0 .55rem; overflow-wrap: anywhere; }
.brain-badges, .brain-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.brain-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: #244b3b;
  font-size: .78rem;
  line-height: 1.1;
}
.brain-actions { flex: 0 0 15rem; justify-content: flex-end; }
.brain-actions .btn-small { width: auto; margin: 0; }

@media (max-width: 720px) {
  .brain-memory { flex-direction: column; }
  .brain-actions { flex: 1 1 auto; justify-content: flex-start; }
}

@keyframes firefly-wander {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
@keyframes firefly-twinkle {
  0%,100% { opacity: .25; transform: scale(.7); }
  38% { opacity: 1; transform: scale(1.24); }
  62% { opacity: .45; transform: scale(.88); }
}

@media (prefers-reduced-motion: reduce) {
  .tree-firefly { offset-path: none; }
  .tree-firefly-one { left: 27%; top: 35%; }
  .tree-firefly-two { left: 62%; top: 22%; }
  .tree-firefly-three { left: 73%; top: 48%; }
  .tree-firefly-four { left: 43%; top: 57%; }
}

/* ---------- Simplified More menu, hubs, Journal, and quick uploads ---------- */
.more-primary-list { display: grid; gap: .65rem; margin-top: 1rem; }
.more-primary-option { width: 100%; margin: 0; padding: .95rem 1.1rem; background: rgba(37, 61, 49, .55); backdrop-filter: blur(6px); }
.more-primary-option > span { font-size: 1.5rem; }
.more-primary-option strong { font-size: 1.02rem; }
.more-primary-option small { font-size: .84rem; }
.more-other-tools { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.more-other-tools summary { cursor: pointer; color: var(--text-muted); font-size: .9rem; list-style-position: inside; padding: .25rem 0; }
.more-other-tools summary:hover, .more-other-tools summary:focus-visible { color: var(--text); }
.more-other-tools .more-navigation-grid button { min-height: 2.6rem; padding: .55rem .85rem; font-size: .9rem; }

.hub-page .hub-primary-action { margin: 1.1rem 0 .4rem; max-width: 28rem; }
.hub-page .hub-primary-action .garden-action { width: 100%; margin: 0; }
#hub-action-result { margin-top: .6rem; color: var(--text-muted); font-size: .9rem; }
.hub-choices .garden-action { width: 100%; margin: 0; min-height: 5.2rem; }

/* Upload button beside chat inputs */
.chat-attach-btn {
  flex: 0 0 auto; width: 2.9rem !important; min-width: 2.9rem; margin: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; align-self: stretch;
  border: 1px solid rgba(212,232,201,.3); border-radius: 14px; cursor: pointer;
  background: rgba(37, 61, 49, .55); backdrop-filter: blur(6px); color: var(--text); font-size: 1.2rem;
  transition: background .2s ease, border-color .2s ease;
}
.chat-attach-btn:hover, .chat-attach-btn:focus-visible { background: rgba(60, 91, 72, .78); border-color: rgba(212,232,201,.6); }
.chat-attach-btn:disabled { opacity: .55; cursor: progress; }
.chat-input-bar .chat-attach-btn { align-self: center; height: 2.4rem; border-radius: 20px; }
.upload-notice { max-width: 100%; }
.upload-notice-error { flex-basis: 100%; color: #ffd6d6; font-size: .78rem; }

/* Images: upload status, drag-and-drop, album covers */
.albums-upload-status { min-height: 1.2rem; margin: -.4rem 0 .8rem; color: var(--jade-glow); font-size: .9rem; }
.albums-upload-status.has-error { color: var(--danger); }
.albums-dropzone { border: 1px dashed transparent; border-radius: var(--radius); transition: border-color .2s ease, background .2s ease; }
.albums-dropzone.is-dragging { border-color: rgba(212,232,201,.6); background: rgba(155, 198, 151, .1); }
.album-card-cover {
  display: block; height: 7rem; margin: -.2rem -.2rem .7rem; border-radius: 10px;
  background: rgba(155, 198, 151, .12) center / cover no-repeat;
  border: 1px solid var(--border);
}
.album-card-cover:not(.has-image)::after { content: "🖼️"; display: flex; height: 100%; align-items: center; justify-content: center; font-size: 1.6rem; opacity: .6; }

/* Journal (MySanctuary's memories) */
.journal-intro { max-width: 42rem; line-height: 1.55; }
.journal-add-btn { margin-left: auto; }
.journal-list, .journal-new { display: grid; gap: .9rem; }
.journal-new:not(:empty) { margin-bottom: 1rem; }
.journal-entry.brain-memory, .journal-entry {
  display: flex; flex-direction: column; align-items: stretch; gap: .35rem;
  padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-left: 3px solid rgba(227,184,122,.55);
  border-radius: var(--radius); background: rgba(32, 46, 39, .62); backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.journal-entry h3 { margin: .15rem 0 0; color: var(--text-strong, var(--text)); font-size: 1.08rem; }
.journal-entry > p { margin: 0; color: var(--text); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-entry-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.journal-entry-meta time { color: var(--amber-soft); font-size: .82rem; margin-right: .25rem; }
.journal-entry .brain-badge.is-muted { background: rgba(255,255,255,.18); color: var(--text-muted); }
.journal-entry .brain-badge.is-pinned { background: rgba(245,221,184,.85); }
.journal-origin { color: var(--text-dim) !important; font-size: .8rem; }
.journal-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-start; margin-top: .4rem; }
.journal-form { display: grid; gap: .75rem; }
.journal-form label { display: grid; gap: .35rem; color: var(--text-muted); font-size: .88rem; }
.journal-form input[type="text"], .journal-form textarea, .journal-form select { margin: 0; }
.journal-form-row { display: flex; flex-wrap: wrap; gap: .9rem; align-items: end; }
.journal-form-row > label { flex: 1 1 14rem; }
.journal-form .journal-check { display: flex; align-items: center; gap: .5rem; flex: 1 1 14rem; }
.journal-form .journal-check input { width: auto; margin: 0; }
.journal-form .modal-actions { margin-top: 0; }
.journal-form-error:empty { display: none; }
.journal-empty p { max-width: 30rem; margin-inline: auto; }

@media (max-width: 520px) {
  .journal-entry.brain-memory, .journal-entry { padding: .95rem; }
  .chat-attach-btn { width: 2.6rem !important; min-width: 2.6rem; }
}

/* ======================================================================
   Deep Forest Sanctuary theme
   Calm, trauma-informed: a soft out-of-focus emerald canopy, frosted
   sage glass cards, warm cream text. Visual layer only; no logic changes.
   ====================================================================== */
:root {
  --bg-deep: #0b1913;
  --bg-mid: #12271e;
  --bg-light: #1d382c;
  --surface: rgba(20, 36, 28, 0.72);
  --surface-hover: rgba(30, 52, 41, 0.8);
  --glass: rgba(20, 36, 28, 0.72);
  --glass-strong: rgba(16, 30, 23, 0.88);
  --glass-border: rgba(167, 215, 188, 0.22);
  --glass-border-strong: rgba(167, 215, 188, 0.42);
  --jade: #a7d7bc;
  --jade-glow: #cdebd9;
  --sage-btn: #9ccbb0;
  --sage-btn-hover: #b8dcc6;
  --amber: #e2c08a;
  --amber-soft: #f1dcb4;
  --text: #f6f1e6;
  --text-strong: #fffaf0;
  --text-muted: #d7d2c4;
  --text-dim: #b3b6a8;
  --danger: #f0a3a3;
  --border: rgba(167, 215, 188, 0.22);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --radius: 18px;
}

body {
  color: var(--text);
  background-color: #0b1913;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(74, 128, 100, .22), transparent 60%),
    linear-gradient(180deg, rgba(8, 20, 15, .15), rgba(6, 15, 11, .55)),
    url("/assets/forest-canopy.svg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
.atmosphere-shade {
  background:
    radial-gradient(circle at 50% 12%, rgba(167, 215, 188, .07), transparent 45%),
    linear-gradient(90deg, rgba(4, 12, 8, .35), transparent 30%, transparent 70%, rgba(4, 12, 8, .35));
}
.atmosphere-particles i {
  border-color: rgba(205, 235, 217, .28);
  background: radial-gradient(circle at 35% 30%, rgba(236, 248, 238, .32), rgba(167, 215, 188, .06) 52%, transparent 74%);
  box-shadow: 0 0 10px rgba(167, 215, 188, .12);
}

/* Typography */
h1, h2, h3, .dash-logo, .welcome-screen h1, .family-tree-copy strong {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}
body.dyslexia h1, body.dyslexia h2, body.dyslexia h3, body.dyslexia .dash-logo { font-family: var(--dyslexia-font); }
h1, h2, h3, .dash-logo, .dash-greeting h1, .welcome-screen h1, .screen h1, .screen h2,
.dash-card h3, .family-tree-copy strong, .home-chat-heading h2, .family-tree-page-header h2,
.garden-section-heading h2, .modal h2, .modal h3 { color: var(--text-strong); text-shadow: none; }
p, .welcome-screen p, .screen p, .dash-card p, .dash-greeting p, .home-chat-heading p,
.home-chat-note, .home-search-entry p, .family-tree-page-header p:not(.family-tree-kicker),
.family-tree-copy > span:nth-child(3), .modal p, .search-item p { color: var(--text-muted); }
.dash-user, .dash-settings-btn, .dash-user:hover { color: var(--text-muted); }
.welcome-eyebrow, .family-tree-kicker, .family-tree-open { color: var(--amber-soft); }
.dash-header { border-bottom-color: var(--glass-border); text-shadow: none; }

/* Frosted sage glass surfaces */
.welcome-screen, .screen,
.dash-card, .album-card, .settings-section, .tasks-item, .notebook-panel,
.albums-panel, .skills-panel, .home-chat, .panic-section, .family-tree-feature,
.family-tree-page, .memory-garden-actions, .home-search-entry, .journal-entry,
.journal-entry.brain-memory, .dash-nudge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--text);
}
.memory-garden-actions { padding: clamp(1rem, 2.4vw, 1.4rem); border-radius: 22px; }
.journal-entry, .journal-entry.brain-memory { border-left: 3px solid rgba(226, 192, 138, .6); }
.dash-card:hover, .album-card:hover, .family-tree-feature:hover {
  background: var(--surface-hover);
  border-color: var(--glass-border-strong);
}
.family-tree-feature, .family-tree-feature:hover {
  background-image: radial-gradient(circle at 76% 43%, rgba(167, 215, 188, .1), transparent 38%);
  background-color: var(--glass);
}
.dashboard-layout { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }

/* Overlays and lighter panels become calm dark glass with cream text */
.modal-overlay { background: rgba(4, 11, 8, .66); backdrop-filter: blur(8px); }
.modal, .folder-tab, .search-item, .bfly-card, .checkin-form, .family-tree-page .ft-card {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  color: var(--text);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.search-item strong { color: var(--text-strong); }
.folder-tab { color: var(--text-muted); }
.folder-tab.active { background: var(--sage-btn); color: #10241a; border-color: transparent; }
.folders-panel-row.active { background: rgba(167, 215, 188, .16); border-color: var(--glass-border-strong); }
.folder-panel-open { color: var(--text-strong); }
.dash-nudge-text { color: var(--text); }
.brain-badge { background: rgba(167, 215, 188, .16); color: var(--text); }
.journal-entry .brain-badge.is-pinned { background: rgba(226, 192, 138, .85); color: #2a1f0e; }
.tasks-due-overdue { color: #ffb3a7; }

/* Chat bubbles */
.home-chat-user { background: rgba(167, 215, 188, .2); }
.home-chat-assistant { background: rgba(10, 24, 18, .6); }
.home-chat-bubble, .home-chat-organised, .home-chat-photo-source, .home-chat-action { color: var(--text); }
.home-chat-bubble strong, .home-chat-action strong { color: var(--amber-soft); }
.home-chat-organised, .home-chat-photo-source, .home-chat-action, .home-chat-action-cancel {
  border-color: var(--glass-border); background-color: rgba(20, 36, 28, .6);
}
.home-chat-action-cancel { color: var(--text); }

/* Inputs: dark glass fields with cream text */
input[type="email"], input[type="password"], input[type="text"], input[type="date"],
input[type="time"], input[type="search"], input[type="number"], input[type="url"],
textarea, select, .home-chat-composer textarea, .grounding-input {
  color: var(--text-strong);
  background: rgba(8, 20, 15, .62);
  border: 1px solid var(--glass-border);
}
select option { background: #12271e; color: var(--text-strong); }
input::placeholder, textarea::placeholder { color: rgba(215, 210, 196, .62); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(167, 215, 188, .2); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Buttons: soft sage primary, warm-gold accents */
button { background: var(--sage-btn); color: #10241a; border-radius: 12px; }
button:hover { background: var(--sage-btn-hover); }
.btn-onenext, .welcome-enter, .home-chat-send, .garden-action-primary .btn-primary { background: var(--amber); color: #2a1f0e; }
.btn-onenext:hover, .welcome-enter:hover, .home-chat-send:hover { background: #ecd0a2; }
.btn-cancel, .btn-secondary { background: rgba(167, 215, 188, .12); color: var(--text); border: 1px solid var(--glass-border); }
.btn-cancel:hover, .btn-secondary:hover { background: rgba(167, 215, 188, .22); color: var(--text-strong); }
.btn-danger { background: #c97b7b; color: #1d0d0d; }
.link-btn, .link-btn:hover { background: none; color: var(--jade-glow); }
.garden-action, .garden-chip, .more-primary-option, .chat-attach-btn, .more-navigation-grid button {
  background: rgba(20, 36, 28, .66);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.garden-action-primary { background: rgba(167, 215, 188, .2); border-color: var(--glass-border-strong); }
.garden-action:hover, .garden-action:focus-visible, .garden-chip:hover, .garden-chip:focus-visible,
.more-primary-option:hover, .chat-attach-btn:hover, .chat-attach-btn:focus-visible,
.more-navigation-grid button:hover, .more-navigation-grid button:focus-visible {
  background: rgba(40, 70, 55, .82); border-color: var(--glass-border-strong); color: var(--text-strong);
}
.garden-action small, .garden-chip small, .more-primary-option small { color: var(--text-muted); }

/* Bottom navigation */
.bottom-nav {
  background: rgba(10, 22, 16, .86);
  border-top-color: var(--glass-border);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.bottom-nav a { color: var(--text-muted); }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--amber-soft); }

@media (max-width: 700px) { body { background-attachment: scroll; } }

/* ---- Phase 15: subscription upgrade card + crisis notice (Deep Forest Sanctuary) ---- */
.subscription-overlay { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.subscription-card {
  width: min(440px, 100%); max-height: calc(100vh - 2.5rem); overflow-y: auto;
  background: var(--glass-strong, var(--surface)); color: var(--text);
  border: 1px solid var(--glass-border-strong, var(--border)); border-radius: 22px;
  box-shadow: var(--shadow); padding: 1.75rem 1.6rem 1.4rem; text-align: left;
  animation: subscription-card-in .35s ease-out;
}
.subscription-card-leaf { font-size: 2rem; line-height: 1; margin-bottom: .6rem; }
.subscription-card h2 { color: var(--amber-soft); font-size: 1.3rem; margin: 0 0 .6rem; }
.subscription-card p { color: var(--text-muted); line-height: 1.55; margin: 0 0 .9rem; }
.subscription-card-points { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; gap: .45rem; }
.subscription-card-points li { color: var(--text); padding-left: 1.5rem; position: relative; }
.subscription-card-points li::before { content: "🍃"; position: absolute; left: 0; font-size: .9rem; }
.subscription-card-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.subscription-card-actions .btn-primary { background: var(--amber); color: #2a1f0e; }
.subscription-card-actions .btn-primary:hover { background: #ecd0a2; }
.subscription-card-msg { min-height: 1.2em; margin: .8rem 0 0; font-size: .9rem; color: var(--text-dim); }
@keyframes subscription-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .subscription-card { animation: none; } }

.subscription-status-pill { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; border: 1px solid var(--glass-border, var(--border)); }
.subscription-status-active { background: rgba(167, 215, 188, .2); color: var(--jade-glow); }
.subscription-status-trial { background: rgba(226, 192, 138, .16); color: var(--amber-soft); }
.subscription-status-inactive { background: rgba(255, 255, 255, .06); color: var(--text-muted); }
.settings-subscription button + button { margin-left: .4rem; }

.crisis-notice {
  margin: .6rem 0; padding: .9rem 1rem; border-radius: 14px;
  background: rgba(226, 192, 138, .12); border: 1px solid rgba(226, 192, 138, .38); color: var(--text);
}
.crisis-notice strong { display: block; color: var(--amber-soft); margin-bottom: .35rem; }
.crisis-notice p { margin: 0 0 .5rem; color: var(--text-muted); line-height: 1.5; }
.crisis-notice ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.crisis-notice-label { font-weight: 600; }
.crisis-notice a { color: var(--jade-glow); text-decoration: underline; }

/* ---- Admin Dashboard (Settings, ADMIN_EMAIL only) ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.admin-stat { background: rgba(167, 215, 188, .08); border: 1px solid var(--glass-border, var(--border)); border-radius: 14px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.admin-stat-value { font-size: 1.6rem; font-weight: 600; color: var(--amber-soft); line-height: 1.1; }
.admin-stat-label { font-size: .85rem; color: var(--text-muted); }
.admin-search { display: block; margin-bottom: .6rem; }
.admin-search input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-border, var(--border)); background: rgba(8, 20, 15, .62); color: var(--text); font-size: 16px; -webkit-appearance: none; appearance: none; }
.admin-user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; max-height: 60vh; overflow-y: auto; }
.admin-user { border: 1px solid var(--glass-border, var(--border)); border-radius: 12px; padding: .7rem .8rem; background: rgba(255, 255, 255, .03); }
.admin-user-main { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; word-break: break-all; }
.admin-user-name { color: var(--text-muted); font-size: .9rem; }
.admin-user-meta { color: var(--text-dim); font-size: .85rem; margin: .3rem 0 .5rem; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---- Feedback & Bug Reports (Settings) + admin inbox ---- */
#settings-feedback-form select, #settings-feedback-form textarea, .admin-reply-input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-border, var(--border)); background: rgba(8, 20, 15, .62); color: var(--text); font-size: 16px; font-family: inherit; margin-bottom: .5rem; }
#settings-feedback-form textarea, .admin-reply-input { resize: vertical; }
.feedback-form-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.feedback-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .5rem; max-height: 45vh; overflow-y: auto; }
.feedback-list-title { font-size: .9rem; color: var(--text-muted); }
.feedback-item { border: 1px solid var(--glass-border, var(--border)); border-radius: 12px; padding: .6rem .75rem; background: rgba(255, 255, 255, .03); }
.feedback-item-meta { color: var(--text-dim); font-size: .82rem; }
.feedback-text { margin: .35rem 0 0; white-space: pre-wrap; word-break: break-word; }
.feedback-category { font-weight: 600; color: var(--amber-soft); }
.feedback-category-bug { color: #f2a7a7; }
.feedback-awaiting { font-style: italic; }
.feedback-reply { margin-top: .5rem; padding: .5rem .65rem; border-left: 3px solid var(--jade-glow, var(--amber-soft)); background: rgba(167, 215, 188, .08); border-radius: 0 10px 10px 0; }
.admin-messages { margin-top: 1.2rem; }
.admin-messages h4 { margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; }
.admin-messages-count { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.admin-message .admin-reply-input { margin-top: .5rem; }
.admin-message-replied { opacity: .8; }
