﻿:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #65716b;
  --line: #dfe5df;
  --paper: #f7f7f2;
  --panel: #ffffff;
  --moss: #008790;
  --moss-2: #006a72;
  --lake: #25d4d8;
  --berry: #9b354d;
  --gold: #25d4d8;
  --shadow: 0 18px 55px rgba(23, 32, 27, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .72fr);
  background: var(--paper);
}
.hero {
  min-height: 100vh;
  background: linear-gradient(90deg, rgba(13,24,19,.78), rgba(13,24,19,.38) 52%, rgba(13,24,19,.1)), url('/assets/main-screen.jpg?v=20260604') center / cover;
  color: white;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 6vw, 76px);
}
.hero-copy { max-width: 720px; padding-bottom: 8vh; }
.kicker { color: rgba(255,255,255,.82); font-weight: 800; letter-spacing: 0; text-transform: uppercase; font-size: 13px; }
h1 { font-size: clamp(44px, 7vw, 92px); line-height: .94; margin: 16px 0; letter-spacing: 0; }
.hero p { max-width: 620px; font-size: clamp(17px, 2vw, 22px); line-height: 1.55; color: rgba(255,255,255,.88); margin: 0; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: min(100%, 430px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 28px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: #edf1ec; border-radius: 8px; margin-bottom: 22px; }
.tabs button { border: 0; background: transparent; border-radius: 6px; padding: 10px; color: var(--muted); font-weight: 800; }
.tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(23,32,27,.08); }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
label { font-size: 13px; font-weight: 800; color: #334039; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; }
select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; font: inherit; }
select[multiple] { min-height: 104px; padding: 8px; }
input:focus, textarea:focus { border-color: var(--lake); box-shadow: 0 0 0 3px rgba(37,212,216,.18); }
select:focus { border-color: var(--lake); box-shadow: 0 0 0 3px rgba(37,212,216,.18); }
.primary, .secondary, .ghost, .danger { min-height: 43px; border-radius: 7px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 850; }
.primary { background: var(--moss); color: white; width: 100%; }
.primary:hover { background: var(--moss-2); }
.secondary { background: var(--moss); color: white; padding: 0 15px; }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 0 12px; }
.ghost.active { background: #e8fbfb; border-color: var(--lake); color: var(--moss-2); }
.danger { background: #9f253c; color: white; padding: 0 14px; }
.danger:hover { background: #7c1d31; }
.error { min-height: 22px; color: #9f253c; font-weight: 750; font-size: 14px; margin-top: 12px; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at top left, rgba(37,212,216,.12), transparent 34%), linear-gradient(180deg, #f7f7f2, #eef3ef 520px, #f7f7f2); }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(247,247,242,.86); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(223,229,223,.82); box-shadow: 0 8px 30px rgba(23,32,27,.06); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, var(--moss), var(--lake)); color: white; box-shadow: 0 10px 22px rgba(0,135,144,.25); }
.actions { display: flex; align-items: center; gap: 10px; }
.top-actions { justify-content: flex-end; }
.profile-wrap { position: relative; }
.profile-button { min-height: 43px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); padding: 0 13px; font-weight: 850; }
.profile-button:hover { border-color: var(--lake); box-shadow: 0 0 0 3px rgba(37,212,216,.14); }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 160px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 42px rgba(23,32,27,.16); overflow: hidden; z-index: 30; }
.profile-menu button { width: 100%; min-height: 42px; border: 0; background: white; color: var(--ink); text-align: left; padding: 0 13px; font-weight: 850; }
.profile-menu button:hover { background: #e8fbfb; color: var(--moss-2); }
.profile-details { display: grid; gap: 12px; }
.profile-details div { border: 1px solid var(--line); border-radius: 8px; padding: 13px; background: #f8faf7; }
.profile-details span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; margin-bottom: 5px; }
.profile-details strong { font-size: 18px; overflow-wrap: anywhere; }
.icon-only { width: 43px; padding: 0; }
.dashboard-hero { position: relative; overflow: hidden; background: linear-gradient(120deg, rgba(0,106,114,.95), rgba(23,32,27,.76)), url('/assets/main-screen.jpg?v=20260604') center / cover; color: white; }
.dashboard-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); }
.tree-hero { background: linear-gradient(120deg, rgba(0,106,114,.96), rgba(60,74,64,.74)), url('/assets/main-screen.jpg?v=20260604') center / cover; }
.dashboard-hero .inner { max-width: 1240px; margin: 0 auto; padding: 58px 22px 52px; position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: end; }
.hero-main { min-width: 0; }
.dashboard-hero h2 { font-size: clamp(34px, 5vw, 64px); line-height: 1; margin: 10px 0 14px; letter-spacing: 0; max-width: 820px; }
.dashboard-hero p { max-width: 700px; color: rgba(255,255,255,.86); font-size: 18px; line-height: 1.55; margin: 0; }
.hero-panel { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); border-radius: 8px; padding: 18px; box-shadow: 0 20px 55px rgba(7,13,10,.2); backdrop-filter: blur(12px); }
.panel-label { color: rgba(255,255,255,.76); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.panel-stat { display: flex; align-items: end; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.2); padding: 10px 0 14px; margin-bottom: 12px; }
.panel-stat strong { font-size: 44px; line-height: .9; }
.panel-stat span { color: rgba(255,255,255,.8); font-weight: 800; }
.panel-line { display: flex; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.82); font-weight: 800; font-size: 13px; padding: 6px 0; }
.panel-line span:last-child { color: white; text-align: right; overflow-wrap: anywhere; }
.stats { max-width: 1240px; margin: 22px auto 0; padding: 0 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { background: rgba(255,255,255,.94); border: 1px solid rgba(223,229,223,.92); border-radius: 8px; padding: 18px; box-shadow: 0 15px 38px rgba(23,32,27,.1); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: #e8fbfb; color: var(--moss-2); flex: 0 0 auto; }
.stat strong { display: block; font-size: 30px; line-height: 1; }
.stat span { color: var(--muted); font-weight: 750; }
.stat .stat-icon { color: var(--moss-2); }
.content { max-width: 1240px; margin: 0 auto; padding: 30px 22px 70px; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.filters h3 { margin: 0; font-size: 24px; }
.search { max-width: 320px; }
.filter-controls { display: flex; align-items: center; gap: 10px; }
.person-filter { width: 190px; border: 1px solid var(--line); border-radius: 7px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; font: inherit; font-weight: 750; }
.album-select-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.album-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 18px; }
.album-head h3 { margin: 0; font-size: 24px; }
.album-actions { display: flex; gap: 9px; align-items: center; }
.bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; box-shadow: 0 10px 26px rgba(23,32,27,.07); }
.bulk-bar span { color: var(--muted); font-weight: 850; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.album-card { border: 1px solid rgba(223,229,223,.96); background: white; border-radius: 8px; padding: 0; overflow: hidden; text-align: left; box-shadow: 0 12px 32px rgba(23,32,27,.08); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.album-card:hover { transform: translateY(-3px); border-color: rgba(0,135,144,.28); box-shadow: 0 18px 42px rgba(23,32,27,.13); }
.album-card:hover .album-cover img { transform: scale(1.04); }
.album-cover { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, #e8fbfb, #f8faf7); color: var(--moss); display: grid; place-items: center; overflow: hidden; }
.album-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7,13,10,.3)); pointer-events: none; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.album-cover svg { width: 46px; height: 46px; }
.album-card-body { padding: 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.album-card-body strong { overflow-wrap: anywhere; }
.album-card-body span { display: block; color: var(--muted); font-size: 13px; font-weight: 750; margin-top: 4px; }
.album-open { white-space: nowrap; color: var(--moss-2) !important; background: #e8fbfb; border-radius: 999px; padding: 7px 10px; font-size: 12px !important; font-weight: 900 !important; margin-top: 0 !important; }
.locked-album { border: 1px solid var(--line); background: #f8faf7; border-radius: 7px; min-height: 43px; display: flex; align-items: center; padding: 0 13px; font-weight: 850; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: white; border: 1px solid rgba(223,229,223,.96); border-radius: 8px; overflow: hidden; box-shadow: 0 12px 32px rgba(23,32,27,.08); transition: transform .16s ease, box-shadow .16s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(23,32,27,.12); }
.thumb { aspect-ratio: 4/3; background: #e8ede9; display: grid; place-items: center; overflow: hidden; }
.thumb-button { width: 100%; border: 0; padding: 0; color: inherit; position: relative; }
.thumb-button:disabled { cursor: not-allowed; opacity: .45; }
.thumb-button.selected { box-shadow: inset 0 0 0 4px var(--lake); }
.thumb-button:hover img, .thumb-button:hover video { transform: scale(1.03); }
.select-check { position: absolute; z-index: 2; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: white; border: 2px solid var(--lake); color: var(--moss-2); display: grid; place-items: center; font-size: 15px; font-weight: 950; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb img, .thumb video { transition: transform .18s ease; }
.video-badge { position: absolute; margin: 12px; padding: 6px 9px; background: rgba(23,32,27,.76); color: white; border-radius: 999px; font-size: 12px; font-weight: 900; }
.card-body { padding: 13px; }
.card-title { font-weight: 900; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.4; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.tag-row.compact { margin-bottom: 0; }
.tag { border: 1px solid #cdd8d0; background: #f4f7f4; color: var(--moss-2); min-height: 30px; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 850; }
.family-tag { border-color: rgba(37,212,216,.7); background: #e8fbfb; color: var(--moss-2); }
.tag:hover { border-color: var(--moss); color: var(--moss); }
.no-tags { color: var(--muted); font-size: 13px; font-weight: 750; }
.mention-wrap { position: relative; }
.mention-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 34px rgba(23,32,27,.18); overflow: hidden; }
.mention-menu button { width: 100%; min-height: 40px; border: 0; background: white; color: var(--ink); text-align: left; padding: 9px 12px; font-weight: 800; }
.mention-menu button:hover { background: #e8fbfb; color: var(--moss); }
.empty { border: 1px dashed #bcc8c0; border-radius: 8px; min-height: 280px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 28px; background: rgba(255,255,255,.55); }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(10,18,14,.55); }
.modal[hidden] { display: none; }
.modal-card { width: min(100%, 560px); background: white; border-radius: 8px; box-shadow: var(--shadow); padding: 22px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 22px; }
.media-modal { padding: 18px; background: rgba(7, 13, 10, .74); }
.media-viewer { width: min(1180px, 100%); max-height: calc(100vh - 36px); display: grid; grid-template-columns: minmax(0, 1fr) 380px; background: white; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.media-stage { min-height: 420px; background: #0b100d; display: grid; place-items: center; overflow: hidden; }
.media-stage img, .media-stage video { max-width: 100%; max-height: calc(100vh - 36px); width: auto; height: auto; display: block; }
.media-info { padding: 20px; overflow-y: auto; max-height: calc(100vh - 36px); }
.detail-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.file-input { border: 1px dashed #aebbb2; background: #f8faf7; padding: 20px; text-align: center; }
.progress { height: 8px; background: #e8ede9; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s ease; }
.upload-status { min-height: 20px; margin-top: 9px; color: var(--muted); font-size: 13px; font-weight: 750; }
.upload-pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.upload-pick-row .upload-status { margin-top: 0; }
.selected-files { max-height: 140px; overflow-y: auto; display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.selected-files div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf1ec; padding-bottom: 5px; }
.selected-files span { white-space: nowrap; color: var(--moss-2); font-weight: 850; }
.tree-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.tree-form { position: sticky; top: 88px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 10px 26px rgba(23,32,27,.07); }
.tree-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tree-board { min-width: 0; overflow-x: auto; padding: 10px 0 18px; }
.family-list { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 18px; box-shadow: 0 10px 26px rgba(23,32,27,.07); }
.family-list strong { display: block; margin-bottom: 8px; }
.tree-generation { position: relative; display: grid; gap: 13px; padding: 0 18px 34px; min-width: 560px; }
.tree-generation:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 28px; background: var(--lake); opacity: .75; }
.tree-generation-label { width: max-content; margin: 0 auto; color: var(--moss-2); background: #e8fbfb; border: 1px solid rgba(37,212,216,.5); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.tree-row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; padding-top: 18px; }
.tree-row::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: var(--lake); opacity: .7; }
.tree-card { position: relative; width: 220px; min-height: 124px; border: 1px solid #bed1d2; background: linear-gradient(180deg, #ffffff, #f4fbfb); border-radius: 8px; padding: 13px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 11px; align-items: start; text-align: left; box-shadow: 0 10px 26px rgba(23,32,27,.08); }
.tree-card::before { content: ""; position: absolute; left: 50%; top: -18px; width: 2px; height: 18px; background: var(--lake); opacity: .8; }
.tree-generation:first-child .tree-card::before { display: none; }
.tree-card.active, .tree-card:hover { border-color: var(--lake); box-shadow: 0 0 0 3px rgba(37,212,216,.16), 0 10px 26px rgba(23,32,27,.08); }
.tree-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--moss); color: white; font-size: 14px; font-weight: 900; }
.tree-info { min-width: 0; display: grid; gap: 4px; }
.tree-card strong { font-size: 16px; overflow-wrap: anywhere; }
.tree-card .tree-info span, .tree-card small { color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.35; }
.tree-card em { color: var(--moss-2); font-size: 13px; font-style: normal; font-weight: 850; }
.root-person { border-color: rgba(0,135,144,.38); }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--ink); color: white; border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 750; opacity: 0; transform: translateY(10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .hero { min-height: 48vh; align-items: flex-end; }
  .auth-panel { padding: 22px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-panel { max-width: none; }
  .stats { grid-template-columns: 1fr; margin-top: 18px; }
  .filters { align-items: stretch; flex-direction: column; }
  .filter-controls { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
  .person-filter { width: 100%; }
  .album-head { grid-template-columns: 1fr; align-items: stretch; }
  .album-actions { width: 100%; }
  .album-actions button { flex: 1; }
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .top-actions > .ghost, .top-actions > .secondary { flex: 1 1 calc(50% - 8px); }
  .profile-wrap { flex: 1 1 100%; }
  .profile-button { width: 100%; justify-content: center; }
  .profile-menu { left: 0; right: auto; width: 100%; }
  .dashboard-hero .inner { padding: 42px 22px 34px; }
  .tree-layout { grid-template-columns: 1fr; }
  .tree-form { position: static; }
  .tree-two { grid-template-columns: 1fr; }
  .media-viewer { grid-template-columns: 1fr; max-height: none; }
  .media-stage { min-height: 280px; }
  .media-stage img, .media-stage video { max-height: 55vh; }
  .media-info { max-height: none; }
}

