:root { color-scheme: dark; --bg:#101313; --panel:#181d1c; --line:#303735; --text:#f3f4ed; --muted:#99a39f; --accent:#d8ff66; font-family:Inter,ui-sans-serif,system-ui,sans-serif; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); }
a { color:var(--accent); }
button,.button { border:0; border-radius:9px; padding:.75rem 1rem; background:var(--accent); color:#152000; font-weight:700; cursor:pointer; text-decoration:none; font:inherit; }
button.ghost,.button.ghost { background:transparent; color:var(--text); border:1px solid var(--line); }
button.danger,.button.danger { background:#8f3036;color:#fff; }
input,select,textarea { width:100%; margin-top:.4rem; padding:.75rem; border:1px solid var(--line); border-radius:8px; background:#0e1111; color:var(--text); font:inherit; }
label { display:block; color:var(--muted); font-size:.85rem; margin-bottom:1rem; }
.field-label { color:var(--muted); font-size:.85rem; }
.brand { font-weight:900; letter-spacing:.2em; color:var(--accent); }
.muted { color:var(--muted); }
.eyebrow { color:var(--accent); text-transform:uppercase; letter-spacing:.12em; font-size:.72rem; font-weight:800; }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:2rem; background:radial-gradient(circle at 70% 20%,#253527,transparent 35%); }
.auth-card { width:min(420px,100%); padding:2.5rem; border:1px solid var(--line); border-radius:18px; background:rgba(24,29,28,.9); }
.auth-card h1 { font-size:2rem; margin-bottom:.25rem; }
.stack { margin-top:2rem; }.stack button { width:100%; }.switch { text-align:center; margin-top:1.5rem; color:var(--muted); }
.alert { padding:.75rem; border-radius:8px; background:#442325; }
.topbar { height:70px; display:flex; align-items:center; justify-content:space-between; padding:0 2rem; border-bottom:1px solid var(--line); }
.top-actions { display:flex; gap:1rem; align-items:center; color:var(--muted); }.top-actions form { margin:0; }
.editor-shell { display:grid; grid-template-columns:300px 1fr; min-height:calc(100vh - 70px); }
.panel { padding:2rem; border-right:1px solid var(--line); }.panel hr { border:0; border-top:1px solid var(--line); margin:2rem 0; }.panel>button { width:100%; margin-top:1.5rem; }
.component-picker { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }.component-picker button { padding:.6rem; }
.wallpaper-picker { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:1rem; }
.wallpaper-option { position:relative; margin:0; cursor:pointer; }
.wallpaper-option input { position:absolute; opacity:0; pointer-events:none; }
.wallpaper-preview { display:block; width:100%; aspect-ratio:16/10; background-position:center; background-size:cover; border:3px solid transparent; border-radius:10px; }
.wallpaper-name { display:block; padding-top:.4rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wallpaper-option input:checked+.wallpaper-preview { border-color:var(--accent); box-shadow:0 0 0 2px rgba(216,255,102,.2); }
.no-wallpaper .wallpaper-preview { display:grid; place-items:center; background:linear-gradient(135deg,#0e1111,#252b29); }
.no-wallpaper .wallpaper-preview::after { content:'No image'; color:var(--muted); }
.editor-shell>section { padding:3rem; }.editor-shell h1 { font-size:clamp(2.5rem,5vw,5rem); margin:.2rem 0; }
.display-card { padding:clamp(.5rem,1.5vw,1.2rem); text-shadow:0 2px 12px rgba(0,0,0,.65); min-width:0; }
.display-card h2,.display-card p { margin:.25rem 0; }
.weather-content { display:flex;align-items:center;gap:.5rem; }.weather-content[hidden] { display:none; }.weather-icon { width:clamp(55px,7vw,100px);height:auto;filter:drop-shadow(0 2px 8px rgba(0,0,0,.45)); }.weather-temperature { font-size:clamp(2rem,5vw,5rem);font-weight:800;line-height:1; }.weather-condition { font-size:clamp(.9rem,1.5vw,1.2rem);text-transform:capitalize; }.weather-details,.weather-status { color:var(--muted);font-size:clamp(.7rem,1.1vw,.95rem); }
.calendar-choice { display:flex;align-items:center;gap:.6rem;padding:.6rem 0;margin:0;border-bottom:1px solid var(--line); }.calendar-choice input { width:auto;margin:0; }.calendar-color { width:.75rem;height:.75rem;border-radius:50%;flex:none; }
.calendar-events { display:grid;gap:.4rem; }.calendar-event { display:flex;align-items:flex-start;gap:.55rem;min-width:0; }.calendar-event div { min-width:0; }.calendar-event strong,.calendar-event small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }.calendar-event small,.calendar-status { color:var(--muted); }.calendar-event .calendar-color { margin-top:.35rem; }
.quote-content { margin:.5rem 0; }.quote-content blockquote { margin:0;font-size:clamp(1rem,2vw,1.8rem);font-weight:600;line-height:1.3; }.quote-content figcaption { margin-top:.6rem;color:var(--muted); }.quote-source { display:inline-block;margin-top:.4rem;color:var(--muted);font-size:.7rem; }.quote-status { color:var(--muted); }
.module-workspace { margin-top:2rem; min-width:0; }
.module-tabs { display:flex; gap:.35rem; overflow-x:auto; padding:0 0 .5rem; border-bottom:1px solid var(--line); scrollbar-width:thin; }
.module-tab { display:flex; align-items:center; gap:.45rem; flex:0 0 auto; max-width:220px; padding:.75rem 1rem; border:1px solid var(--line); border-bottom:0; border-radius:9px 9px 0 0; background:#111514; color:var(--muted); font-weight:650; }
.module-tab span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.module-tab.active { background:var(--panel); color:var(--text); box-shadow:inset 0 3px var(--accent); }
.fixed-tab { flex-shrink:0; }.optional { margin-left:.35rem; color:var(--accent); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; }
.tab-grip { color:var(--muted); cursor:grab; }
.module-panel { min-height:330px; padding:2rem; border:1px solid var(--line); border-top:0; border-radius:0 0 14px 14px; background:var(--panel); }
.module-panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:2rem; }
.module-panel-head h2 { margin:.25rem 0 0; font-size:1.75rem; }
.module-panel-head .remove { color:#ffb5b5; }
.module-fields { max-width:700px; }
.empty-modules { min-height:280px; display:grid; place-content:center; text-align:center; }
.admin-shell { width:min(1100px,calc(100% - 3rem)); margin:3rem auto; }.admin-shell>h1 { font-size:clamp(2rem,5vw,4rem);margin:.25rem 0 2rem; }.admin-links { display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem; }.admin-links a { display:flex;flex-direction:column;gap:.4rem;padding:1.5rem;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);text-decoration:none;font-size:1.2rem;font-weight:700; }.admin-links small { color:var(--muted);font-weight:400; }.table-wrap { overflow-x:auto;border:1px solid var(--line);border-radius:12px; }table { width:100%;border-collapse:collapse;background:var(--panel); }th,td { padding:1rem;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap; }th { color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.08em; }.role-badge { padding:.3rem .55rem;border-radius:999px;background:#28322c;color:var(--accent);font-size:.8rem; }.pagination { display:flex;align-items:center;justify-content:center;gap:1rem;margin-top:1.5rem; }
.account-shell { width:min(620px,calc(100% - 3rem));margin:3rem auto; }.account-shell>h1 { font-size:clamp(2rem,5vw,4rem);margin:.25rem 0 2rem; }.account-shell hr { border:0;border-top:1px solid var(--line);margin:2rem 0; }
.admin-form-card { padding:1.5rem;border:1px solid var(--line);border-radius:12px;background:var(--panel);margin-bottom:2rem; }.form-row { display:grid;grid-template-columns:2fr 1fr;gap:1rem; }.field-heading { display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:1rem 0; }.field-heading h3,.field-heading p { margin:.2rem 0; }.service-field { display:grid;grid-template-columns:1fr 1.4fr 1fr auto;gap:.75rem;align-items:end;padding:.75rem 0;border-top:1px solid var(--line); }.service-field label { margin:0; }.service-field button { margin-bottom:0; }.service-list article { display:flex;align-items:center;gap:1rem;padding:1rem 0;border-bottom:1px solid var(--line); }.service-list h3,.service-list p { margin:.15rem 0; }.service-icon { font-size:2rem; }
.category-list { display:grid;gap:1rem; }.category-card { padding:1.5rem;border:1px solid var(--line);border-radius:12px;background:var(--panel); }.category-card h2 { margin:.2rem 0; }.category-card>.service-list { margin-top:1rem; }
.service-summary { flex:1;min-width:0; }
.module-actions { display:flex;align-items:center;gap:.5rem;flex-wrap:wrap; }.module-actions form { margin:0; }.module-disabled { opacity:.65; }.module-status { display:inline-block;padding:.2rem .45rem;border-radius:999px;font-size:.65rem;vertical-align:middle;text-transform:uppercase;letter-spacing:.06em;background:#274432;color:#bff3ca; }.module-status.disabled { background:#453437;color:#ffc5c8; }
.display { height:100vh; min-height:0; padding:0; display:grid; overflow:hidden; }.layout-top_bottom { grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:35% 30% 35%; }.layout-left_right { grid-template-columns:30% 40% 30%;grid-template-rows:repeat(3,minmax(0,1fr)); }.display.has-wallpaper { --text:#f3f4ed;--muted:#cbd2ce;color:var(--text);background-position:center;background-size:cover;background-attachment:fixed;background-repeat:no-repeat; }.display-slot { display:flex; align-items:center; min-width:0; min-height:0; overflow:hidden; padding:1vw; }.slot-top_1{grid-column:1;grid-row:1}.slot-top_2{grid-column:2;grid-row:1;justify-content:center;text-align:center}.slot-top_3{grid-column:3;grid-row:1;justify-content:flex-end;text-align:right}.slot-bottom_1{grid-column:1;grid-row:3}.slot-bottom_2{grid-column:2;grid-row:3;justify-content:center;text-align:center}.slot-bottom_3{grid-column:3;grid-row:3;justify-content:flex-end;text-align:right}.layout-top_bottom .display-body{grid-column:1/-1;grid-row:2}.slot-left_1{grid-column:1;grid-row:1}.slot-left_2{grid-column:1;grid-row:2}.slot-left_3{grid-column:1;grid-row:3}.slot-right_1{grid-column:3;grid-row:1;justify-content:flex-end;text-align:right}.slot-right_2{grid-column:3;grid-row:2;justify-content:flex-end;text-align:right}.slot-right_3{grid-column:3;grid-row:3;justify-content:flex-end;text-align:right}.layout-left_right .display-body{grid-column:2;grid-row:1/-1}.display-body { display:grid; place-items:center; min-height:0; }.display-body h1 { margin:0; font-size:clamp(2rem,5vw,5rem); text-align:center; text-shadow:0 2px 16px rgba(0,0,0,.7); }.theme-light { --bg:#edf0e9;--panel:white;--line:#ccd2ca;--text:#152019;--muted:#657068; background-color:var(--bg);color:var(--text); }.clock { font-size:clamp(2rem,5vw,6rem); font-weight:800; }
.display-config-link { position:fixed;left:.75rem;bottom:.65rem;z-index:20;color:var(--text);font-size:1.25rem;line-height:1;text-decoration:none;opacity:.5;text-shadow:0 1px 5px rgba(0,0,0,.8); }
/* Full-screen displays carry a small muted "Powered by Displazio" mark in the top right. Sized to a
   full-screen calendar entry and using the same --muted colour so it never competes with the module. */
.powered-by { position:fixed; top:.9vw; right:1.3vw; z-index:20; margin:0; color:var(--muted); font-size:clamp(.65rem,1vw,1.1rem); font-weight:600; line-height:1; text-shadow:0 1px 5px rgba(0,0,0,.45); pointer-events:none; }
@media (max-width:750px) { .editor-shell { grid-template-columns:1fr; }.panel { border-right:0;border-bottom:1px solid var(--line);}.top-actions>span { display:none; }.editor-shell>section { padding:2rem; }.form-row,.service-field { grid-template-columns:1fr; } }

/* Tide charts stay within their lower slot and the requested viewport caps. */
.display-card.tide-card { box-sizing:border-box; width:30vw; max-width:min(100%,30vw); max-height:min(100%,25vh); padding:.25rem; overflow:hidden; display:flex; flex-direction:column; flex:0 1 30vw; }
.tide-card h2 { font-size:clamp(.7rem,1.2vw,1.2rem); flex:none; }
.tide-chart { min-height:0; display:flex; flex-direction:column; font-size:clamp(.55rem,.8vw,.85rem); }
.tide-body { min-height:0; display:flex; flex-direction:column; gap:.15em; flex:1 1 auto; }
.tide-body[hidden] { display:none; }
.tide-head { display:flex; align-items:baseline; justify-content:space-between; gap:.6em; flex:none; }
.tide-station { font-weight:700; text-transform:uppercase; letter-spacing:.02em; font-size:1.25em; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tide-date { opacity:.75; white-space:nowrap; flex:none; }
.tide-metrics { margin:0; flex:none; opacity:.85; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tide-metrics:empty { display:none; }
.tide-main { display:flex; align-items:flex-start; justify-content:space-between; gap:.8em; flex:none; min-width:0; }
.tide-current { min-width:0; }
.tide-current p { margin:0; }
.tide-asof { opacity:.7; }
.tide-reading { font-size:1.6em; font-weight:700; line-height:1.15; white-space:nowrap; }
.tide-difference { opacity:.7; white-space:nowrap; }
.tide-difference:empty,.tide-asof:empty { display:none; }
.tide-events { list-style:none; margin:0; padding:0; flex:none; display:grid; gap:.08em; }
.tide-events li { display:grid; grid-template-columns:auto auto auto auto; gap:.45em; align-items:baseline; white-space:nowrap; }
.tide-event-height { text-align:right; opacity:.8; }
.tide-event-time { font-weight:700; }
.tide-event-day { opacity:.6; font-size:.85em; }
.tide-event-high { color:#e4705e; }
.tide-event-low { color:#6ec5d8; }
.tide-plot { display:block; width:100%; min-height:0; flex:1 1 auto; }
.tide-plot[hidden] { display:none; }
.tide-plot text { fill:currentColor; font-size:11px; text-shadow:none; }
.tide-plot .tide-axis { opacity:.65; }
.tide-plot .tide-area { fill:currentColor; opacity:.12; stroke:none; }
.tide-plot polyline { fill:none; stroke:currentColor; stroke-width:2; }
.tide-plot .tide-line-future { opacity:.45; }
.tide-plot .tide-line-past { stroke:#e4705e; }
.tide-plot line { stroke:currentColor; opacity:.3; }
.tide-plot .tide-now { stroke:#e4705e; opacity:.9; stroke-width:1.5; }
.tide-plot .tide-now-dot { fill:none; stroke:#e4705e; stroke-width:2; }
.tide-caption,.tide-chart a { flex:none; }

.google-sign-in { display:block; text-align:center; margin-top:1.5rem; }
.auth-divider { text-align:center; margin:1rem 0; }

.calendar-agenda .calendar-events { grid-template-columns:minmax(0,1fr); gap:.65rem; }
.calendar-day { min-width:0; }
.calendar-day h3 { margin:0 0 .35rem; font-size:.85em; }
.calendar-day .calendar-event { margin-bottom:.3rem; font-size:.8em; }
.calendar-day .calendar-event small { font-size:.8em; }
.calendar-day>.muted { font-size:.7em; }

/* Full-screen modules own the entire viewport; no center wallpaper region. */
.layout-full_screen { grid-template: minmax(0, 1fr) / minmax(0, 1fr); background: var(--bg); }
.layout-full_screen .slot-full_screen { width: 100%; height: 100%; padding: 1.5vw; align-items: stretch; }
.layout-full_screen .display-card { width: 100%; height: 100%; max-width: none; max-height: none; min-height: 0; display: flex; flex-direction: column; }
.layout-full_screen .display-card > h2 { flex: none; font-size: clamp(1rem, 2vw, 2rem); margin: 0 0 .6rem; }
.layout-full_screen .display-card.tide-card { flex: 1 1 auto; }
.layout-full_screen .tide-chart { flex: 1; font-size: clamp(.8rem, 1.3vw, 1.2rem); }
.layout-full_screen .tide-plot { height: 100%; }
.layout-full_screen .component-calendar { text-shadow: none; }
.layout-full_screen .calendar-agenda { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.layout-full_screen .calendar-period { margin: 0 0 .7rem; font-size: clamp(1rem, 2.3vw, 2.5rem); flex: none; }
.layout-full_screen .calendar-status { flex: none; }
.layout-full_screen .calendar-status:empty { display: none; }
.layout-full_screen .calendar-events { flex: 1; min-height: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--calendar-rows, 1), minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.layout-full_screen .calendar-day { min-height: 0; overflow: auto; padding: clamp(.25rem, .7vw, .8rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.layout-full_screen .calendar-day h3 { font-size: clamp(.6rem, 1.1vw, 1.2rem); margin-bottom: .6rem; }
.layout-full_screen .calendar-event { font-size: clamp(.65rem, 1vw, 1.1rem); margin-bottom: .65rem; }
.layout-full_screen .calendar-month .calendar-event { font-size: clamp(.6rem, .9vw, 1rem); margin-bottom: .35rem; gap: .3rem; }
.layout-full_screen .calendar-month .calendar-event small { display: inline; }
.layout-full_screen .calendar-month .calendar-color { width: .4rem; height: .4rem; }
.layout-full_screen .calendar-today { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 3px var(--accent); }
.layout-full_screen .calendar-outside-month { opacity: .5; }

.layout-full_screen .calendar-day { overflow: hidden; }
.layout-full_screen .calendar-month .calendar-event > div { display: flex; gap: .3rem; align-items: baseline; flex: 1; }
.layout-full_screen .calendar-month .calendar-event strong { flex: 1; min-width: 0; }
.layout-full_screen .calendar-month .calendar-event small { flex: 0 1 auto; max-width: 50%; }
.layout-full_screen .calendar-month .calendar-day h3 { margin-bottom: .3rem; }
.layout-full_screen .calendar-event[hidden] { display: none; }

/* Anchor Top & Bottom modules to their respective screen edges. */
.layout-top_bottom :is(.slot-top_1, .slot-top_2, .slot-top_3) { align-items: flex-start; }
.layout-top_bottom :is(.slot-bottom_1, .slot-bottom_2, .slot-bottom_3) { align-items: flex-end; }

/* News Feed: two-line items (feed name, headline) cycled one at a time inside a clipped viewport. */
.display-card.news-card { box-sizing:border-box; width:100%; max-width:100%; overflow:hidden; }
.news-feed { width:100%; min-width:0; font-size:clamp(1rem,1.6vw,1.6rem); text-align:left; }
.news-status { color:var(--muted); font-size:.8em; }
.news-viewport { position:relative; overflow:hidden; width:100%; height:2.5em; }
.news-item { position:absolute; top:0; left:0; display:flex; flex-direction:column; white-space:nowrap; will-change:transform; }
.news-vertical .news-item { right:0; }
.news-source { font-size:.7em; line-height:1.3; color:var(--muted); font-weight:600; letter-spacing:.02em; overflow:hidden; text-overflow:ellipsis; }
.news-headline { display:inline-block; line-height:1.3; font-weight:600; }

/* Multi-line: headlines wrap over as many lines as they need and fill the module, bottom-justified,
   so the block grows upward from the lower edge of the slot and never scrolls. */
.display-card.news-card:has(.news-multi_line) { height:100%; display:flex; flex-direction:column; }
.news-multi_line { flex:1; min-height:0; display:flex; flex-direction:column; }
.news-lines { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:flex-end; gap:.6em; overflow:hidden; }
.news-lines[hidden] { display:none; }
.news-line { display:flex; flex-direction:column; min-width:0; }
.news-line[hidden] { display:none; }
.news-multi_line .news-headline { display:block; white-space:normal; overflow-wrap:anywhere; }

/* Moon Phase */
.moon-phase { min-width:0; }
.moon-status { color:var(--muted); }
.moon-content { display:flex; align-items:center; gap:clamp(.5rem,1.2vw,1.2rem); }
.moon-graphic { flex:none; width:clamp(4rem,8vw,8.5rem); height:auto; filter:drop-shadow(0 0 12px rgba(255,244,214,.18)); }
/* The dark side blocks the wallpaper; earthshine shows faint terrain; the sunlit part is the full photo. */
.moon-dark { fill:rgba(8,10,12,.92); }
.moon-earthshine { opacity:.14; }
.moon-rim { fill:none; stroke:rgba(255,255,255,.12); stroke-width:.6; }
.moon-text p { margin:0; }
.moon-name { font-size:clamp(1rem,1.7vw,1.7rem); font-weight:700; line-height:1.2; }
.moon-illumination { color:var(--muted); font-size:.9em; }
.moon-times { display:flex; flex-wrap:wrap; gap:.15rem .9rem; margin-top:.25rem !important; font-variant-numeric:tabular-nums; }
.moon-location { color:var(--muted); }
.slot-top_3 .moon-content, .slot-bottom_3 .moon-content, .slot-right_1 .moon-content, .slot-right_2 .moon-content, .slot-right_3 .moon-content { flex-direction:row-reverse; }
.slot-top_2 .moon-content, .slot-bottom_2 .moon-content { justify-content:center; }
.layout-full_screen .moon-card { justify-content:center; align-items:center; }
.moon-full-screen { width:100%; height:100%; display:grid; place-items:center; }
.moon-full-screen .moon-content { flex-direction:column; gap:2vh; text-align:center; }
.moon-full-screen .moon-graphic { width:min(55vh,60vw); }
.moon-full-screen .moon-name { font-size:clamp(2rem,5vw,4.5rem); }
.moon-full-screen .moon-illumination, .moon-full-screen .moon-times { font-size:clamp(1.1rem,2.2vw,2rem); justify-content:center; }
.moon-full-screen .moon-times { gap:.3rem 2.5rem; }
.moon-full-screen .moon-location { font-size:clamp(.95rem,1.5vw,1.4rem); }
