:root {
  --ink: #141618;
  --ink-soft: #25282b;
  --paper: #f5f3ee;
  --panel: #fff;
  --line: #e3e0d8;
  --muted: #73766f;
  --accent: #e9a84a;
  --accent-dark: #bd7522;
  --accent-soft: #fbecd4;
  --sage: #8fa69a;
  --success: #3f7b5b;
  --danger: #b64a44;
  --shadow: 0 18px 60px rgba(23, 25, 24, .11);
  --radius: 18px;
  --header: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, summary, label[for], input[type="range"] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 760; letter-spacing: -.03em; font-size: 1.15rem; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.brand-mark::before, .brand-mark::after, .brand-mark i::before, .brand-mark i::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 12px 2px 12px 2px; background: var(--ink); transform-origin: 17px 17px; opacity: .9; }
.brand-mark::before { transform: translate(-9px,-9px) rotate(0deg); }
.brand-mark::after { transform: translate(9px,-9px) rotate(90deg); }
.brand-mark i::before { transform: translate(9px,9px) rotate(180deg); }
.brand-mark i::after { transform: translate(-9px,9px) rotate(270deg); }
.brand-mark i { position: absolute; inset: 0; }

.eyebrow { display: block; margin-bottom: 8px; color: var(--accent-dark); font-size: .71rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.primary-button, .secondary-button, .text-button, .danger-text-button { border: 0; cursor: pointer; border-radius: 11px; font-weight: 720; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 0 19px; background: var(--ink); color: white; box-shadow: 0 7px 18px rgba(20,22,24,.16); }
.primary-button:hover { background: #272a2d; transform: translateY(-1px); }
.primary-button:disabled { opacity: .48; cursor: wait; transform: none; }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); background: white; }
.secondary-button:hover { background: #faf9f6; }
.secondary-button.small { min-height: 36px; padding: 0 12px; font-size: .78rem; }
.text-button { padding: 7px 4px; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--ink); }
.text-button.small { font-size: .75rem; }
.danger-text-button { margin-top: 12px; padding: 8px 0; color: var(--danger); background: transparent; font-size: .79rem; }
.full { width: 100%; }
.icon-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 39px; height: 39px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(20,22,24,.06); }

.app-header { position: sticky; z-index: 50; top: 0; height: var(--header); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(245,243,238,.94); backdrop-filter: blur(16px); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-project { color: var(--muted); font-size: .79rem; }
.profile-menu { position: relative; }
.profile-menu summary { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: white; font-size: .78rem; font-weight: 800; cursor: pointer; list-style: none; }
.profile-menu summary::-webkit-details-marker { display: none; }
.menu-popover { position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.menu-popover strong, .menu-popover small { display: block; }
.menu-popover small { margin-top: 3px; color: var(--muted); }
.menu-popover form { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.menu-popover button { padding: 5px 0; border: 0; background: none; color: var(--danger); cursor: pointer; }

.flash { padding: 12px 16px; border-radius: 12px; font-size: .86rem; font-weight: 650; }
.flash.success { background: #deeee5; color: #285d40; }
.flash.error { background: #f6dfdc; color: #853a35; }
.flash.floating { position: fixed; z-index: 110; top: 84px; left: 50%; transform: translateX(-50%); box-shadow: var(--shadow); animation: flash-out .4s ease 4s forwards; }
@keyframes flash-out { to { opacity: 0; transform: translate(-50%, -10px); pointer-events: none; } }

/* Authentication */
.auth-page { background: var(--ink); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .9fr) minmax(520px, 1.1fr); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 42px 7vw 52px; overflow: hidden; background: var(--ink); color: white; }
.auth-story::after { content: ""; position: absolute; width: 480px; height: 480px; left: -240px; bottom: 6%; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.016); }
.auth-story .brand { position: relative; z-index: 2; }
.auth-story > div:not(.film-strip) { position: relative; z-index: 2; }
.auth-story h1 { max-width: 620px; margin: 12px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.1rem, 5.8vw, 6rem); font-weight: 400; line-height: .96; letter-spacing: -.055em; }
.auth-story p { max-width: 510px; margin: 0; color: rgba(255,255,255,.62); font-size: 1.05rem; line-height: 1.6; }
.film-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; position: relative; z-index: 2; width: min(470px, 100%); }
.film-strip i { display: block; aspect-ratio: 16/9; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; background: linear-gradient(145deg, rgba(233,168,74,.18), rgba(255,255,255,.03)); }
.film-strip i:nth-child(2) { background: linear-gradient(155deg, rgba(143,166,154,.22), rgba(255,255,255,.02)); }
.film-strip i:nth-child(3) { background: linear-gradient(120deg, rgba(133,97,82,.28), rgba(255,255,255,.02)); }
.auth-card { display: grid; place-items: center; min-height: 100vh; padding: 36px; border-radius: 32px 0 0 32px; background: var(--paper); }
.auth-card-inner { width: min(480px, 100%); }
.auth-card-inner.compact { width: min(420px, 100%); }
.step-pill { display: inline-flex; margin-bottom: 30px; padding: 7px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.auth-card h2 { margin: 0 0 7px; font-size: 2rem; letter-spacing: -.045em; }
.auth-card p { margin: 0 0 28px; }
.stack-form { display: grid; gap: 17px; }
.stack-form label, .dialog-card > label, .field-label { display: grid; gap: 7px; }
.stack-form label > span, .dialog-card label > span, .field-label > span, .field-title { font-size: .75rem; font-weight: 760; }
.stack-form input, .stack-form select, .dialog-card input, .dialog-card select, .field-label textarea, .library-filter input, .library-filter select { width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white; color: var(--ink); transition: border .15s, box-shadow .15s; }
.stack-form input:focus, .stack-form select:focus, .dialog-card input:focus, .field-label textarea:focus, .library-filter input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,168,74,.16); }
.stack-form label small { color: var(--muted); font-size: .69rem; }
.stack-form .check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: 17px; min-height: 17px; accent-color: var(--ink); }
.form-error { padding: 10px 12px; border-radius: 9px; background: #f5dedb; color: #913f39; font-size: .8rem; }

/* Dashboard */
.dashboard-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 62px 0 90px; }
.dashboard-shell > .flash { margin-bottom: 24px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 38px; }
.page-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 4.8rem); font-weight: 400; letter-spacing: -.055em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.project-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; transition: transform .22s, box-shadow .22s; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-cover { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; overflow: hidden; background: #202326; color: white; }
.project-cover::before { content: ""; position: absolute; inset: -35%; background: radial-gradient(circle at 72% 24%, rgba(233,168,74,.5), transparent 23%), radial-gradient(circle at 32% 70%, rgba(143,166,154,.38), transparent 28%); filter: blur(15px); }
.year-number { position: relative; z-index: 2; font-family: Georgia, serif; font-size: 4.5rem; letter-spacing: -.08em; }
.cover-grain { position: absolute; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E"); }
.play-orbit { position: absolute; right: 16px; bottom: 16px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); }
.play-orbit svg { fill: currentColor; stroke: none; }
.project-card-body { display: flex; justify-content: space-between; gap: 20px; padding: 20px; }
.project-card h2 { margin: 0; font-size: 1.08rem; }
.project-card p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.progress-meta { width: 90px; text-align: right; color: var(--muted); font-size: .7rem; }
.progress-track { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #ebe8e1; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s; }

/* Editor layout */
.editor-page { overflow: hidden; }
.editor-shell { display: grid; grid-template-columns: 278px minmax(0, 1fr); height: calc(100vh - var(--header)); }
.calendar-panel { position: relative; z-index: 4; padding: 24px 20px; overflow-y: auto; border-right: 1px solid var(--line); background: #eeece6; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.month-label { border: 0; background: transparent; font-size: .9rem; font-weight: 800; cursor: pointer; }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekday-row { margin-bottom: 6px; color: #96978f; font-size: .61rem; font-weight: 800; text-align: center; }
.calendar-grid button, .calendar-grid span { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 0; border-radius: 9px; background: transparent; font-size: .7rem; }
.calendar-grid button { cursor: pointer; }
.calendar-grid button:hover { background: rgba(255,255,255,.7); }
.calendar-grid button.has-moment::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); }
.calendar-grid button.processing::after { background: var(--accent); animation: pulse 1s infinite; }
.calendar-grid button.selected { background: var(--ink); color: white; box-shadow: 0 6px 13px rgba(20,22,24,.15); }
.calendar-grid button.selected::after { background: var(--accent); }
.calendar-grid button.today:not(.selected) { box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-grid button.future { opacity: .32; }
.year-progress-card { display: flex; align-items: center; gap: 13px; margin: 26px 0 13px; padding: 14px; border: 1px solid rgba(0,0,0,.05); border-radius: 14px; background: rgba(255,255,255,.64); }
.ring-progress { --progress: 0deg; position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 49px; height: 49px; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), #ddd9d0 0); }
.ring-progress::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #f7f5f0; }
.ring-progress span { position: relative; z-index: 1; font-size: .62rem; font-weight: 800; }
.year-progress-card strong, .year-progress-card small { display: block; }
.year-progress-card strong { font-size: .76rem; }
.year-progress-card small { margin-top: 4px; color: var(--muted); font-size: .65rem; }

.workspace-panel { min-width: 0; overflow-y: auto; background: var(--paper); }
.workspace-toolbar { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: center; min-height: 84px; padding: 16px clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgba(245,243,238,.94); backdrop-filter: blur(12px); }
.selected-date-kicker { display: block; color: var(--muted); font-size: .67rem; font-weight: 760; text-transform: uppercase; letter-spacing: .1em; }
.workspace-toolbar h1 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 1.58rem; font-weight: 400; letter-spacing: -.035em; }
.toolbar-actions { display: flex; gap: 9px; }
.mobile-calendar-button { display: none; }
.editor-loading { display: grid; place-items: center; align-content: center; height: calc(100% - 84px); color: var(--muted); font-size: .8rem; }
.loader { width: 34px; height: 34px; border: 3px solid #ddd9d0; border-top-color: var(--accent); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; } }

.empty-moment { min-height: calc(100% - 84px); display: grid; place-items: center; align-content: center; padding: 40px; text-align: center; }
.empty-moment h2 { margin: 0; font-family: Georgia, serif; font-size: 2.1rem; font-weight: 400; letter-spacing: -.04em; }
.empty-moment p { max-width: 430px; margin: 10px 0 20px; color: var(--muted); line-height: 1.6; }
.empty-actions { display: flex; align-items: center; gap: 15px; }
.empty-illustration { position: relative; width: 138px; height: 100px; margin-bottom: 24px; }
.empty-illustration span, .empty-illustration i { position: absolute; display: block; width: 108px; aspect-ratio: 16/10; border-radius: 12px; background: #dfdcd4; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.empty-illustration span { left: 0; top: 14px; transform: rotate(-8deg); }
.empty-illustration i { right: 0; top: 3px; transform: rotate(8deg); background: linear-gradient(145deg, var(--accent-soft), #e8e1d5); }

.moment-editor-content { display: grid; grid-template-columns: minmax(460px, 1fr) 300px; gap: clamp(20px, 3vw, 42px); width: min(1160px, 100%); margin: 0 auto; padding: 28px clamp(20px, 3vw, 42px) 70px; }
.preview-column { min-width: 0; }
.video-stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 15px; background: #111315; box-shadow: 0 18px 44px rgba(20,22,24,.15); }
.video-stage video { width: 100%; height: 100%; object-fit: cover; }
.video-stage.contain video { object-fit: contain; }
.video-stage.blur::before { content: ""; position: absolute; inset: -30px; background: var(--stage-poster) center/cover; filter: blur(24px) brightness(.55); transform: scale(1.12); }
.video-stage.blur video { position: relative; z-index: 1; object-fit: contain; }
.stage-play { position: absolute; z-index: 2; display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(12,13,14,.45); color: white; cursor: pointer; backdrop-filter: blur(8px); }
.stage-play svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.stage-play.playing { opacity: 0; pointer-events: none; }
.preview-date, .preview-caption, .preview-spoken { position: absolute; z-index: 2; color: white; text-shadow: 0 2px 7px rgba(0,0,0,.72); font-weight: 800; pointer-events: none; }
.preview-date { top: 6%; color: var(--accent); font-size: clamp(.7rem, 1.5vw, 1.25rem); text-transform: uppercase; letter-spacing: .06em; }
.preview-caption { bottom: 7.5%; max-width: 82%; padding: 5px 8px; border-radius: 5px; background: rgba(0,0,0,.28); font-size: clamp(.82rem, 2.1vw, 1.65rem); }
.preview-date,.preview-caption { left:4.5%; }.preview-spoken { right:8%; bottom:18%; left:8%; padding:4px 7px; border-radius:5px; background:rgba(0,0,0,.42); font-size:clamp(.7rem,1.5vw,1.1rem); text-align:center; }
.orientation-warning { position: absolute; z-index: 3; top: 12px; right: 12px; padding: 6px 9px; border-radius: 8px; background: rgba(17,19,21,.72); color: white; font-size: .62rem; }
.trim-card { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.trim-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.trim-heading strong, .trim-heading small { display: block; }
.trim-heading strong { font-size: .78rem; }
.trim-heading small { margin-top: 3px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .67rem; }
.film-timeline { position: relative; height: 74px; overflow: hidden; border-radius: 9px; background: #cbc9c3; touch-action: pan-y; }
.timeline-thumbnails { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(.85); }
.timeline-thumbnails::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent); }
.timeline-shade { position: absolute; z-index: 2; top: 0; bottom: 0; background: rgba(10,11,12,.58); pointer-events: none; }
.timeline-shade.left { left: 0; width: 0; }
.timeline-shade.right { right: 0; width: 0; }
.selection-window { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 30%; border: 2px solid var(--accent); border-radius: 7px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.selection-window i { position: absolute; top: 50%; width: 3px; height: 21px; border-radius: 99px; background: var(--accent); transform: translateY(-50%); }
.selection-window i:first-child { left: 4px; }.selection-window i:last-child { right: 4px; }
.film-timeline input[type="range"] { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; }
.film-timeline input[type="range"]:active { cursor: grabbing; }
.suggestion-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.suggestion-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: #faf9f6; color: var(--muted); font-size: .65rem; font-weight: 700; cursor: pointer; }
.suggestion-chip:first-child { border-color: #ecd4af; background: var(--accent-soft); color: var(--accent-dark); }

.inspector-panel { position: relative; align-self: start; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 10px 30px rgba(30,32,30,.05); }
.inspector-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border-bottom: 1px solid var(--line); }
.inspector-tabs button { padding: 9px 5px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .7rem; font-weight: 780; cursor: pointer; }
.inspector-tabs button.active { background: #f1efe9; color: var(--ink); }
.inspector-section { display: none; padding: 19px; }
.inspector-section.active { display: block; }
.field-label { position: relative; }
.field-label textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.field-label > small { position: absolute; right: 8px; bottom: 7px; color: #9a9b95; font-size: .6rem; }
.caption-suggestions { margin-top: 10px; }.caption-suggestions > span { display:block; margin-bottom:6px; color:var(--accent-dark); font-size:.61rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }.caption-suggestions > div { display:flex; flex-wrap:wrap; gap:6px; }.caption-suggestions button { padding:6px 8px; border:1px solid #ead0a8; border-radius:999px; background:var(--accent-soft); color:#815321; font-size:.62rem; cursor:pointer; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin: 19px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: .76rem; }.toggle-row small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.switch { appearance: none; width: 39px; height: 22px; border-radius: 99px; background: #cfcec9; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch:checked { background: var(--ink); }.switch:checked::after { transform: translateX(17px); }
.field-group { display: grid; gap: 9px; margin-bottom: 18px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #eeece7; }
.segmented button { padding: 8px 4px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .67rem; font-weight: 750; cursor: pointer; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.09); }
.option-stack { display: grid; gap: 7px; }
.option-stack > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; text-align: left; cursor: pointer; }
.option-stack > button.active { border-color: var(--accent); background: #fffaf2; box-shadow: 0 0 0 2px rgba(233,168,74,.1); }
.option-stack > button > span { flex: 1; }.option-stack strong, .option-stack small { display: block; }.option-stack strong { font-size: .7rem; }.option-stack small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.option-stack.compact { grid-template-columns: 1fr 1fr; }.option-stack.compact > button { justify-content: center; padding: 10px 4px; font-size: .66rem; font-weight: 700; text-align: center; }
.fit-icon { width: 28px; height: 20px; border: 1px solid #aaa; border-radius: 3px; background: #d5d2cb; }
.fit-icon.cover { box-shadow: inset 0 0 0 4px #777; }.fit-icon.contain { box-shadow: inset 5px 0 #333, inset -5px 0 #333; }.fit-icon.blur { background: linear-gradient(90deg,#bbb,#eee,#bbb); box-shadow: inset 8px 0 rgba(50,50,50,.4), inset -8px 0 rgba(50,50,50,.4); }
.help-copy { color: var(--muted); font-size: .68rem; line-height: 1.5; }
.subtitle-box { margin-top:18px; padding-top:4px; border-top:1px solid var(--line); }.subtitle-box .toggle-row { margin-top:0; border-top:0; }.subtitle-box .secondary-button { margin-top:10px; font-size:.69rem; }
.save-state { display: flex; gap: 7px; align-items: center; padding: 11px 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: .61rem; }
.save-state span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }.save-state.saving span { background: var(--accent); animation: pulse 1s infinite; }.save-state.error span { background: var(--danger); }

/* Media drawer */
.media-library { position: fixed; z-index: 70; top: var(--header); right: 0; bottom: 0; width: min(430px, 100vw); padding: 23px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--paper); box-shadow: -20px 0 50px rgba(20,22,24,.12); transform: translateX(102%); transition: transform .25s ease; }
.media-library.open { transform: none; }
.drawer-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }.drawer-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.6rem; font-weight: 400; }
.library-filter { display: grid; grid-template-columns: 1fr 120px; gap: 8px; margin-bottom: 14px; }.library-filter input, .library-filter select { min-height: 40px; padding: 8px 10px; font-size: .72rem; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-card { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; cursor: pointer; }
.media-card-image { position: relative; aspect-ratio: 16/10; background: #202326 center/cover; }.media-card-image span { position: absolute; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 5px; background: rgba(0,0,0,.68); color: white; font-size: .56rem; }
.media-card-body { padding: 9px; }.media-card-body strong { display: block; overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }.media-card-body small { color: var(--muted); font-size: .58rem; }
.media-empty { grid-column: 1/-1; padding: 40px 10px; color: var(--muted); text-align: center; font-size: .75rem; }

/* Dialogs */
.modal-dialog { width: min(470px, calc(100% - 28px)); max-height: calc(100vh - 30px); padding: 0; overflow: visible; border: 0; border-radius: 20px; background: transparent; box-shadow: var(--shadow); }
.modal-dialog.wide { width: min(680px, calc(100% - 28px)); }
.modal-dialog::backdrop { background: rgba(17,19,21,.58); backdrop-filter: blur(4px); }
.dialog-card { position: relative; display: grid; gap: 14px; max-height: calc(100vh - 30px); padding: 28px; overflow-y: auto; border-radius: 20px; background: var(--paper); }
.dialog-card h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; letter-spacing: -.04em; }.dialog-card > p { margin: -7px 0 5px; }
.dialog-close { position: absolute; z-index: 2; top: 16px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e8e6df; font-size: 1.25rem; cursor: pointer; }
.import-options { display: grid; gap: 9px; }
.import-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; cursor: pointer; }
.import-option:hover, .import-option.primary { border-color: #e1bd87; background: #fffbf5; }
.import-option > span:nth-child(2) { flex: 1; }.import-option strong, .import-option small { display: block; }.import-option strong { font-size: .79rem; }.import-option small { margin-top: 4px; color: var(--muted); font-size: .65rem; }.import-option b { color: var(--accent-dark); font-size: .68rem; }
.option-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: #efede7; }.option-icon svg { width: 22px; height: 22px; }
.option-icon.google { position: relative; background: white; box-shadow: inset 0 0 0 1px #ddd; }.option-icon.google::before, .option-icon.google::after, .option-icon.google i::before, .option-icon.google i::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 10px 2px 10px 2px; transform-origin: 12px 12px; }.option-icon.google::before { background:#4285f4; transform:translate(-6px,-6px) }.option-icon.google::after { background:#ea4335; transform:translate(6px,-6px) rotate(90deg) }.option-icon.google i::before { background:#fbbc05; transform:translate(6px,6px) rotate(180deg) }.option-icon.google i::after { background:#34a853; transform:translate(-6px,6px) rotate(270deg) }
.upload-progress { margin-top: 5px; padding: 14px; border-radius: 12px; background: #ebe9e2; }.upload-progress > div:first-child { display: flex; justify-content: space-between; font-size: .7rem; }.upload-progress .progress-track { height: 7px; margin: 10px 0 7px; background: #d5d2ca; }.upload-progress small { color: var(--muted); font-size: .62rem; }
.export-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; }.export-summary { padding: 15px; border-radius: 13px; background: #eae7df; }.mini-film { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; overflow: hidden; border-radius: 9px; background: var(--ink); color: white; font-family: Georgia,serif; font-size: 2rem; }.mini-film::before { content:""; position:absolute; inset:0; background:radial-gradient(circle at 70% 20%,rgba(233,168,74,.5),transparent 30%),radial-gradient(circle at 20% 90%,rgba(143,166,154,.4),transparent 35%); }.mini-film span { position:relative; }.export-summary dl { margin: 13px 0 0; }.export-summary dl div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.07); font-size: .64rem; }.export-summary dt { color: var(--muted); }.export-summary dd { margin: 0; font-weight: 750; }.soundtrack-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background:white; }.soundtrack-box span,.soundtrack-box small { display:block; }.soundtrack-box small { max-width: 160px; margin-top: 4px; overflow:hidden; color:var(--muted); font-size:.61rem; text-overflow:ellipsis; white-space:nowrap; }.dialog-footer { display:flex; justify-content:flex-end; align-items:center; gap:15px; padding-top:7px; border-top:1px solid var(--line); }
.style-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }.style-grid label { display:grid; gap:7px; }.style-grid label > span { font-size:.72rem; font-weight:760; }.style-grid input[type="color"] { width:100%; height:47px; padding:5px; }.style-volume { grid-column:1/-1; }.style-volume span { display:flex; justify-content:space-between; }.style-volume input[type="range"] { accent-color:var(--accent-dark); }
.mobile-nav { display: none; }
.offline-page { display: grid; place-items: center; }.offline-card { width:min(420px,calc(100% - 36px)); padding:40px; border:1px solid var(--line); border-radius:20px; background:white; text-align:center; box-shadow:var(--shadow); }.offline-card .brand-mark { margin:auto; }.offline-card h1 { font-family:Georgia,serif; font-weight:400; }.offline-card p { color:var(--muted); line-height:1.6; }
.toast-region { position: fixed; z-index: 150; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }.toast { min-width: 250px; max-width: 380px; padding: 12px 14px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .75rem; animation: toast-in .2s ease; }.toast.error { background: #8e3935; }.toast.success { background: #315e47; }@keyframes toast-in { from { opacity:0; transform:translateY(8px) } }

@media (max-width: 980px) {
  .moment-editor-content { grid-template-columns: 1fr; }
  .inspector-panel { width: 100%; }
  .inspector-section { min-height: 230px; }
  .auth-shell { grid-template-columns: .85fr 1.15fr; }.auth-story { padding: 38px; }.auth-story h1 { font-size: 3.7rem; }
}

@media (max-width: 760px) {
  :root { --header: 58px; }
  body.editor-page { overflow: auto; }
  .app-header { height: var(--header); padding: 0 16px; }.header-project { display:none; }.brand { font-size:1rem; }.brand-mark { width:30px;height:30px; }
  .auth-shell { display:block; }.auth-story { min-height: 38vh; padding: 25px 24px 36px; }.auth-story h1 { margin-top:50px; font-size:2.8rem; }.auth-story p,.film-strip { display:none; }.auth-card { min-height:62vh; padding:30px 22px 50px; border-radius:25px 25px 0 0; }.step-pill { margin-bottom:20px; }
  .dashboard-shell { width:calc(100% - 30px); padding:38px 0 70px; }.page-heading { align-items:start; }.page-heading h1 { font-size:2.7rem; }.page-heading p { max-width:220px; }.page-heading .primary-button { padding:0 13px; }.project-grid { grid-template-columns:1fr; }
  .editor-shell { display:block; height:auto; min-height:calc(100vh - var(--header)); padding-bottom:68px; }.calendar-panel { position:fixed; z-index:65; inset:var(--header) 0 62px 0; padding:24px max(22px,calc((100vw - 390px)/2)); border:0; transform:translateX(-102%); transition:transform .24s; }.calendar-panel.open { transform:none; }.calendar-grid button,.calendar-grid span { max-height:50px; }.year-progress-card { margin-top:18px; }
  .workspace-panel { overflow:visible; }.workspace-toolbar { min-height:72px; padding:11px 15px; }.workspace-toolbar > div:first-child { display:grid; grid-template-columns:37px 1fr; column-gap:6px; }.mobile-calendar-button { grid-row:1/3; display:grid; place-items:center; width:37px; height:37px; padding:0; border:0; border-radius:50%; background:#e8e6df; }.mobile-calendar-button svg { width:18px; }.workspace-toolbar h1 { font-size:1.28rem; }.toolbar-actions .secondary-button { display:none; }.toolbar-actions .primary-button span { display:none; }.toolbar-actions .primary-button { width:42px; padding:0; }.moment-editor-content { display:block; padding:16px 14px 35px; }.video-stage { border-radius:11px; }.trim-card { margin-top:12px; padding:13px; }.film-timeline { height:65px; }.inspector-panel { margin-top:14px; }.inspector-section { min-height:0; }.empty-moment { min-height:calc(100vh - 130px); padding:25px; }.empty-illustration { transform:scale(.85); }
  .mobile-nav { position:fixed; z-index:60; right:0; bottom:0; left:0; display:grid; grid-template-columns:repeat(3,1fr); min-height:62px; padding-bottom:env(safe-area-inset-bottom); border-top:1px solid var(--line); background:rgba(250,249,246,.96); backdrop-filter:blur(14px); }.mobile-nav button { display:grid; place-items:center; align-content:center; gap:2px; border:0; background:transparent; color:var(--muted); font-size:.58rem; font-weight:700; }.mobile-nav button svg { width:20px;height:20px; }.mobile-nav button.active { color:var(--ink); }.mobile-add { display:grid; place-items:center; width:30px;height:30px; border-radius:50%; background:var(--ink); color:white; font-size:1.35rem; font-weight:400; }
  .media-library { top:var(--header); bottom:62px; }.modal-dialog { margin-bottom:max(12px,env(safe-area-inset-bottom)); }.dialog-card { padding:23px 18px; }.export-layout,.style-grid { grid-template-columns:1fr; }.style-volume { grid-column:auto; }.export-summary { display:none; }.import-option { min-height:68px; }.toast-region { right:12px; bottom:76px; left:12px; }.toast { min-width:0; max-width:none; }
}

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