/* Shared styles for signed-in Oppuse pages: dashboard, admin. */
:root {
    --bg: #f7f7f5;
    --text: #1b1b18;
    --muted: #5f5f5a;
    --accent: #2457d6;
    --accent-text: #ffffff;
    --card: #ffffff;
    --border: #e3e3df;
    --danger: #b42318;
    --today: #e8eefc;
    --row: 80px;
    --gap: 12px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1012;
        --text: #ededec;
        --muted: #a1a09a;
        --accent: #7aa2ff;
        --accent-text: #0f1012;
        --card: #17181b;
        --border: #2a2b2f;
        --danger: #f97066;
        --today: #1d2740;
        --logo-keyline: #fff;
    }
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}
a { color: var(--accent); }
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
    padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card);
}
.topbar .brand { margin-right: auto; color: var(--text); line-height: 0; }
.logo { display: block; height: 28px; width: auto; }
.logo.logo-icon { width: 28px; }
body.auth .topbar .brand { visibility: hidden; }
.auth-brand { display: flex; justify-content: center; margin: 24px 0 20px; }
.auth-brand a { color: var(--text); }
.auth-brand .logo { height: 44px; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.page { padding: 16px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 8px 0 4px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 20px; }
.notice { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); margin-bottom: 16px; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card); color: var(--text); font: inherit; font-size: 0.9rem;
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Dashboard grid */
.grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr));
    grid-auto-rows: var(--row);
    gap: var(--gap);
}
.tile {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.tile h2 { font-size: calc(0.85rem * var(--fit, 1)); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.tile .body { flex: 1; min-height: 0; overflow: auto; }
.empty { color: var(--muted); font-size: calc(1rem * var(--fit, 1)); }
@media (max-width: 720px) {
    .grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .grid .tile { grid-column: auto !important; grid-row: auto !important; min-height: 160px; }
}


/* Calendar */
.month { width: 100%; border-collapse: collapse; table-layout: fixed; height: 100%; }
.month th { font-size: calc(0.8rem * var(--fit, 1)); color: var(--muted); font-weight: 600; padding: 4px; text-align: left; }
.month td { border-top: 1px solid var(--border); vertical-align: top; padding: calc(4px * var(--fit, 1)) calc(6px * var(--fit, 1)); font-size: calc(0.85rem * var(--fit, 1)); }
/* Every week gets the same height, however many events it holds. */
.month tbody tr { height: calc(100% / var(--weeks, 6)); }
.month td.other { color: var(--muted); opacity: 0.6; }
.month td.today { background: var(--today); font-weight: 700; border-radius: 6px; }

/* Module list */
.modules { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.module-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.module-card h2 { margin: 0; font-size: 1.1rem; }
.module-card p { margin: 0; color: var(--muted); }
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.badge.on { border-color: var(--accent); color: var(--accent); }

/* Editor */
.editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.palette { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.palette h2 { font-size: 0.9rem; margin: 0 0 8px; }
.palette .item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.palette .item:first-of-type { border-top: 0; }
.palette .item small { display: block; color: var(--muted); }
.canvas {
    position: relative; border: 1px dashed var(--border); border-radius: 12px; min-height: 400px;
    background-image: linear-gradient(to right, var(--border) 1px, transparent 1px), linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    touch-action: none; user-select: none;
}
/* The canvas has the picked screen's shape and holds exactly its rows; nothing may sit past its bottom edge. */
.canvas[data-rows] { min-height: 0; max-width: 100%; border-style: solid; }
.canvas .tile.invalid { outline: 2px solid var(--danger); outline-offset: -2px; }
.canvas .tile { position: absolute; cursor: grab; transition: box-shadow 0.1s; }
.canvas .tile.dragging { cursor: grabbing; box-shadow: 0 8px 24px rgba(0,0,0,0.18); z-index: 10; opacity: 0.92; }
.canvas .tile.invalid { border-color: var(--danger); }
.canvas .tile .meta { color: var(--muted); font-size: 0.8rem; }
.canvas .tile .remove { position: absolute; top: 6px; right: 6px; }
.canvas .tile .resize {
    position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize;
    border-right: 3px solid var(--muted); border-bottom: 3px solid var(--muted); border-radius: 0 0 8px 0;
}
/* Each tile shows a sample picture of its widget on the dashboard's colors, with its name over the top. */
.canvas { background-color: var(--ed-bg, transparent); }
.canvas .tile.has-preview { background: linear-gradient(var(--ed-panel), var(--ed-panel)), var(--ed-bg, var(--card)); color: #fff; border-color: rgba(255, 255, 255, .12); padding: 0; overflow: hidden; }
.canvas.ed-light .tile.has-preview { color: var(--text); border-color: var(--border); }
.canvas .tile .preview { position: absolute; inset: 26px 8px 8px; background: center / contain no-repeat; pointer-events: none; }
.canvas .tile[data-widget="weather.radar"] .preview { inset: 0; background-size: cover; border-radius: 11px; }
.canvas .tile.has-preview h2, .canvas .tile.has-preview .meta { position: relative; z-index: 1; margin: 0; padding: 6px 10px 0; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.canvas .tile.has-preview h2 { color: inherit; font-size: .8rem; }
.canvas .tile.has-preview .meta { display: inline-block; padding-top: 0; color: inherit; opacity: .8; font-size: .72rem; }
.canvas.ed-light .tile.has-preview h2, .canvas.ed-light .tile.has-preview .meta { text-shadow: none; }
.canvas.ed-light .tile.has-preview .preview { filter: invert(.85) hue-rotate(180deg); }
.canvas.ed-light .tile[data-widget="weather.radar"] .preview { filter: none; }
.canvas .tile[data-widget="weather.radar"] h2, .canvas .tile[data-widget="weather.radar"] .meta { color: #1f2937; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.canvas .tile.has-preview .remove { z-index: 2; }
.canvas .ghost { position: absolute; border: 2px dashed var(--accent); border-radius: 12px; pointer-events: none; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .msg { color: var(--muted); font-size: 0.9rem; }

/* Accounts: sign in, sign up and the people page */
.page.narrow { max-width: 440px; }
.page.medium { max-width: 880px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.card h2 { margin: 0 0 12px; font-size: 1.25rem; }
.form-card label { display: block; font-weight: 600; margin: 12px 0 4px; }
.form-card input, .form-card select, .inline select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font: inherit;
}
.form-card input[type=checkbox] { width: auto; }
.form-card label.inline { font-weight: 400; }
.hint { color: var(--muted); font-size: 0.875rem; margin: 4px 0 0; }
.error { color: var(--danger); font-size: 0.875rem; margin: 4px 0 0; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline select { width: auto; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.site-footer { padding: 24px 16px; text-align: center; font-size: 0.875rem; color: var(--muted); }

/* Settings forms */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .two-col { grid-template-columns: 1fr; } }
.form-card fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px 14px; margin: 16px 0 0; }
.form-card legend { font-weight: 700; padding: 0 6px; }
.clock-rows { display: grid; gap: 8px; }
.clock-row { display: grid; grid-template-columns: 1fr 1.4fr 1.6fr auto; gap: 8px; align-items: center; }
.btn.small.clock-remove { width: 32px; padding: 4px 0; font-size: 1.1rem; line-height: 1; }
@media (max-width: 640px) { .clock-row { grid-template-columns: 1fr 1fr; } }

/* Tiles that hold a framed page (radar, forecast) fill the whole tile */
.tile.framed { padding: 0; }
.tile.framed iframe { border: 0; width: 100%; height: 100%; display: block; border-radius: 12px; }
.tile .needs-setup { margin: auto; text-align: center; color: var(--muted); padding: 12px; }

/* Detailed forecast, opened over the whole dashboard as on TeamCal; it closes itself after a while untouched */
.fc-overlay { position: fixed; inset: 0; z-index: 50; background: var(--wall-bg, var(--bg)); display: flex; }
.fc-overlay[hidden] { display: none; }
.fc-overlay iframe { flex: 1; border: 0; background: var(--wall-bg, var(--card)); }

/* Active weather alerts across the top of the radar, one at a time */
.tile[data-widget="radar"] { position: relative; }
.alert-strip { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: 0.55rem 1.1rem; border-radius: 12px 12px 0 0;
    font-size: 1.375rem; font-weight: 700; line-height: 1.2; text-align: center; background: #f5d90a; color: #1a1a1a; }
.alert-strip[hidden] { display: none; }
.alert-strip.sev-moderate { background: #f59e0b; color: #1a1a1a; }
.alert-strip.sev-severe { background: #dc2626; color: #fff; }
.alert-strip.sev-extreme { background: #7f1d1d; color: #fff; }

/* The wall screen can't reach the server (at the bottom, so it never covers an alert), or its sign-in ended */
.wall-banner { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: 90%; padding: 0.55rem 1.4rem;
    border-radius: 999px; background: #b45309; color: #fff; font-size: 1.3rem; font-weight: 600; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; box-shadow: 0 6px 22px rgba(0, 0, 0, .4); }
.wall-banner[hidden] { display: none; }
.signed-out { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(10, 16, 32, .88); }
.signed-out[hidden] { display: none; }
.so-box { max-width: 56rem; margin: 16px; padding: 3rem 3.5rem; border-radius: 18px; background: #7f1d1d; color: #fff; text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.so-box h2 { margin: 0 0 0.75rem; font-size: 3.5rem; font-weight: 800; }
.so-box p { margin: 0 0 1.75rem; font-size: 1.6rem; opacity: .92; }
.so-btn { display: inline-block; padding: 0.9rem 2rem; border-radius: 10px; background: #fff; color: #7f1d1d; font-size: 1.5rem; font-weight: 700; text-decoration: none; }

/* Weather alerts */
.wx-alerts { display: flex; flex-direction: column; gap: 8px; }
.wx-alert { border-left: 5px solid var(--muted); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.wx-alert b { display: block; }
.wx-alert { font-size: calc(1rem * var(--fit, 1)); }
.wx-alert p { margin: 4px 0 0; font-size: calc(0.85rem * var(--fit, 1)); color: var(--muted); }
.wx-alert.sev-extreme { border-color: #7a1fa2; }
.wx-alert.sev-severe { border-color: #d92d20; }
.wx-alert.sev-moderate { border-color: #f79009; }
.wx-alert.sev-minor, .wx-alert.sev-unknown { border-color: #2e90fa; }
.wx-alert.kind-storm { border-color: #f79009; }
.wx-clear { color: var(--muted); font-size: calc(1rem * var(--fit, 1)); }
.wx-status { font-size: calc(0.8rem * var(--fit, 1)); color: var(--muted); margin-top: auto; padding-top: 6px; }

/* The wall dashboard in TeamCal's looks (config/dashboard-themes.php). Standard is TeamCal's blue with the
   yellow clock; the panels sit on the page color and the weather tiles match it. */
body.wall { background: var(--wall-bg); }
/* The team's fonts (Colors and fonts): the text font for the whole screen, the clock font for the clock panel's times. */
body.wall { font-family: var(--wall-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); }
body.wall .c-time, body.wall .w-time { font-family: var(--wall-clock-font, inherit); }
body.wall-dark {
    --text: #ffffff; --muted: rgba(255, 255, 255, .75); --border: rgba(255, 255, 255, .13);
    --accent: #8fd8ff; --today: rgba(255, 255, 255, .16); --bg: rgba(0, 0, 0, .18);
    --logo-keyline: #fff;
    color-scheme: dark;
}
/* Light themes set every color themselves, so a computer in dark mode can't leave pale text on the white tiles. */
body.wall-light {
    --text: #14202b; --muted: #4a5868; --border: #cfd8e2;
    --accent: #2457d6; --accent-text: #ffffff; --card: #ffffff; --bg: rgba(15, 42, 61, .05); --danger: #b42318;
    --today: #e3ebfb; --logo-keyline: none;
    color-scheme: light;
}

/* The wall screen fills the window exactly: no header, no page scroll bars. The grid's rows share the
   height, and a tile with more than fits scrolls inside itself. */
html.wall-page, html.wall-page body { height: 100%; margin: 0; overflow: hidden; }
/* Type scales with the screen, as TeamCal's 1920 px design did: 16 px on a 1920 x 1080 monitor, larger on a 4K
   one, smaller on a laptop, whichever side is tighter. */
html.wall-page { font-size: min(calc(100vw / 120), calc(100vh / 67.5)); }
.wall-main { position: fixed; inset: 0; padding: 10px; }
.wall-grid { height: 100%; gap: 10px; grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.wall-grid .tile { min-height: 0; }
.wall-empty { padding: 24px; }
/* A small window (a phone, or testing on a laptop): stack the tiles and let the page scroll. */
@media (max-width: 900px) {
    html.wall-page { font-size: 16px; }
    html.wall-page, html.wall-page body { height: auto; overflow: auto; }
    .wall-main { position: static; }
    .wall-grid { height: auto; grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; }
    .wall-grid .tile { grid-column: auto !important; grid-row: auto !important; min-height: 180px; max-height: 80vh; }
    .wall-grid .tile[data-widget="radar"] { height: 360px; }
    .wall-grid .tile[data-widget="forecast"] { height: 170px; }
    .week-head { flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 4px 6px; }
    .week-name { font-size: 0.65rem; letter-spacing: 0.02em; }
}

/* The menu under the initial in the top corner: a solid round badge that reads over any tile, a little quieter until
   pointed at; opens on hover or a tap. */
.who { position: fixed; top: 14px; right: 14px; z-index: 40; }
.who-btn { display: block; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; opacity: .85; transition: opacity .15s, transform .15s; }
.who:hover .who-btn, .who.open .who-btn, .who-btn:focus-visible { opacity: 1; transform: scale(1.06); }
.who-av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; box-sizing: border-box;
    background: var(--wall-menu, #1f2937); color: var(--wall-clock, #fff); border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35); font-size: 15px; font-weight: 800; }
body.wall-light .who-av { background: var(--wall-clock); color: #fff; }
.who-menu { position: absolute; right: 0; top: 100%; min-width: 220px; margin-top: 6px; padding: 8px 6px 6px; border-radius: 10px; display: none;
    background: var(--wall-menu, var(--card)); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); text-align: left; }
.who-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.who:hover .who-menu, .who.open .who-menu, .who:focus-within .who-menu { display: block; }
.who-name { padding: 4px 12px 8px; margin-bottom: 4px; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--border);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name strong { color: var(--text); }
.who-menu a, .who-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: none;
    color: var(--text); font: inherit; font-size: 0.95rem; text-align: left; text-decoration: none; cursor: pointer; }
.who-menu a:hover, .who-menu button:hover { background: rgba(127, 127, 127, .16); }
.who-menu form { margin: 0; }
.who-menu [hidden] { display: none; }
.who-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.who-themes { padding: 6px 12px 4px; }
.who-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.who-swatches { display: flex; gap: 8px; }
.who-menu .who-swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(127, 127, 127, .5); cursor: pointer;
    background: linear-gradient(135deg, var(--sw-bg) 55%, var(--sw-clock) 55%); }
.who-menu .who-swatch:hover { background: linear-gradient(135deg, var(--sw-bg) 55%, var(--sw-clock) 55%); border-color: var(--text); }
.who-menu .who-swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
body.wall .tile { background: var(--wall-panel); border: 0; color: var(--text); }
body.wall-light .tile { box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .07); }
body.wall .tile h2 { color: var(--muted); }
body.wall .wx-alert { background: rgba(0, 0, 0, .2); }
body.wall-light .wx-alert { background: var(--wall-bg); }
body.wall .wx-alert p, body.wall .wx-status, body.wall .wx-clear { color: var(--muted); }
body.wall .wx-status a { color: var(--wall-code); }
/* The clock panel, from TeamCal's wall screen. Sizes are TeamCal's, in rem so they follow the screen; the script
   scales them with --k (the main clock) and --wk (the other sites) until everything fits the tile. */
.tile[data-widget="clock"] { padding: 0; }
.clockpanel { --k: 1; --wk: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: calc(0.875rem * var(--k));
    padding: calc(1.125rem * var(--k)) 1.125rem; overflow: hidden; text-align: center; }
/* Nothing in the panel squeezes: if it doesn't fit, the script makes the type smaller instead. */
.clockpanel > * { flex-shrink: 0; }
.c-brand { display: flex; justify-content: center; min-width: 0; }
.c-brand img { display: block; max-width: 100%; height: max(1.9rem, calc(3rem * var(--k))); object-fit: contain; }
.c-brand-name { font-size: calc(1.3rem * max(var(--k), 0.8 * var(--wk))); font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.clock-main { display: flex; flex-direction: column; align-items: center; }
.c-day { font-size: calc(2.75rem * var(--k)); font-weight: 800; line-height: 1.1; white-space: nowrap; }
.c-time { display: flex; align-items: baseline; justify-content: center; gap: calc(0.5rem * var(--k)); margin: calc(0.25rem * var(--k)) 0;
    color: var(--wall-clock, var(--accent)); font-weight: 800; line-height: 1.02; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-time > span { font-size: calc(7rem * var(--k)); letter-spacing: -.02em; }
.c-time > small { font-size: calc(2.25rem * var(--k)); font-weight: 700; letter-spacing: .02em; }
.c-date { font-size: calc(1.875rem * var(--k)); font-weight: 600; opacity: .92; white-space: nowrap; }
.c-world { list-style: none; margin: 0; padding: calc(0.75rem * var(--k)) 0 0; border-top: 1px solid var(--border); display: grid; text-align: left; }
.c-world li { min-width: 0; }
.c-world b { font-weight: 800; color: var(--wall-code, var(--accent)); }
.c-world i { font-style: normal; opacity: .55; margin: 0 .22em; }
.w-time { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.w-time small { font-size: .6em; font-weight: 700; margin-left: .22em; letter-spacing: .02em; opacity: .85; }
.w-time small.w-day { font-weight: 600; opacity: .7; }
.w-name, .w-site { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .92; }
/* group: one row per time, the time once on the left and the sites that share it beside it */
.c-world[data-layout="group"] { grid-template-columns: max-content minmax(0, 1fr); column-gap: calc(0.75rem * var(--wk)); margin-inline: -6px; }
.c-world[data-layout="group"] li { display: contents; }
.c-world[data-layout="group"] .w-time { font-size: calc(1.75rem * var(--wk)); text-align: right; align-self: center; padding: calc(0.3rem * var(--wk)) 0; }
.c-world[data-layout="group"] .w-sites { display: flex; flex-flow: row wrap; align-content: center; column-gap: calc(1rem * var(--wk)); min-width: 0;
    padding: calc(0.3rem * var(--wk)) 0 calc(0.3rem * var(--wk)) calc(0.6rem * var(--wk)); border-left: 2px solid var(--border); }
.c-world[data-layout="group"] .w-site { font-size: calc(1.125rem * var(--wk)); line-height: 1.25; max-width: 100%; flex: 0 1 auto; }
.c-world[data-layout="group"] li + li .w-time, .c-world[data-layout="group"] li + li .w-sites { border-top: 1px solid var(--border); }
/* rows: one row per site, the name on the left and the time on the right */
.c-world[data-layout="rows"] li { display: flex; align-items: baseline; justify-content: space-between; gap: calc(0.875rem * var(--wk)); padding: calc(0.375rem * var(--wk)) 0; }
.c-world[data-layout="rows"] li + li { border-top: 1px solid var(--border); }
.c-world[data-layout="rows"] .w-name { font-size: calc(1.3rem * var(--wk)); flex: 1 1 auto; }
.c-world[data-layout="rows"] .w-time { font-size: calc(1.7rem * var(--wk)); flex: none; }
.c-skew { margin: 0; font-size: calc(0.95rem * var(--k)); color: #ffd58a; }
body.wall-light .c-skew { color: #b45309; }
/* the weather alerts line: all clear (quiet), alerts active, or can't check (amber) */
.c-alerts { align-self: center; max-width: 100%; margin: 0; padding: .3em .85em; border-radius: .9em;
    font-size: calc(1.05rem * max(var(--k), 0.8 * var(--wk))); font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none; }
.c-alerts:hover, .c-alerts:focus-visible { text-decoration: underline; }
.c-alerts.ok { color: #9be7b4; background: rgba(34, 197, 94, .14); }
body.wall-light .c-alerts.ok, body:not(.wall) .c-alerts.ok { color: #15803d; }
.c-alerts.wait { color: var(--muted); background: rgba(127, 127, 127, .12); }
.c-alerts.on { color: #1a1a1a; background: #f59e0b; }
.c-alerts.down { color: #1a1a1a; background: #fbbf24; }
.look-preview { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; padding: 12px; margin-bottom: 14px; border-radius: 10px;
    background: var(--lp-bg); color: var(--lp-text); font-family: var(--lp-font, inherit); }
.lp-tile { background: var(--lp-panel); border-radius: 8px; padding: 10px 12px; text-align: center; min-width: 0; }
.lp-day { font-weight: 800; font-size: 1.1rem; }
.lp-time { color: var(--lp-clock); font-weight: 800; font-size: 2.6rem; line-height: 1.05; font-family: var(--lp-clock-font, inherit); }
.lp-time small, .lp-wt small { font-size: .45em; margin-left: .2em; }
.lp-world { font-size: .9rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-wt { font-weight: 800; font-family: var(--lp-clock-font, inherit); }
.lp-world b { color: var(--lp-code); }
.lp-text { display: flex; flex-direction: column; gap: 6px; text-align: left; justify-content: center; }
.lp-muted { opacity: .7; font-size: .85rem; }
.look-colors { border: 0; padding: 0; margin: 14px 0 6px; }
.look-colors legend { font-weight: 600; padding: 0; }
.look-color { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.look-color .check { margin: 0; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.look-color input[type=color] { width: 54px; height: 32px; padding: 0; }
.look-color input[type=color]:disabled { opacity: .55; }
.font-samples h3 { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.font-samples p { margin: 4px 0; font-size: 1.15rem; }
.font-samples .muted { display: inline-block; min-width: 190px; font-size: .85rem; font-family: ui-sans-serif, system-ui, sans-serif; }
.logo-preview img { max-height: 60px; max-width: 100%; background: rgba(127, 127, 127, .15); padding: 6px; border-radius: 8px; }
.logo-preview.square img { width: 60px; height: 60px; object-fit: contain; }

/* Calendar events */
.month .daynum { display: block; }
.month td.today .chip { font-weight: 400; }
.chip { display: block; padding: 1px 6px; margin: 2px 0; border-radius: 4px; font-size: calc(0.78rem * var(--fit, 1)); line-height: 1.35; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.done { text-decoration: line-through; opacity: 0.7; }
/* Event type icons: drawn in the text color, the size of the text around them. */
svg.ti { width: 1em; height: 1em; flex: none; vertical-align: -0.14em; }
.chip svg.ti { margin-right: .3em; }
.cal-ic { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 4px; background: var(--c); color: var(--t, #fff); }
.cal-ic svg.ti { width: .9em; height: .9em; }
.agenda-ic { color: var(--c); margin-right: .35em; }
.chip-time { font-variant-numeric: tabular-nums; margin-right: 4px; opacity: 0.9; }
.chip-repeat { margin-left: 4px; opacity: 0.8; }
.more { display: block; font-size: calc(0.75rem * var(--fit, 1)); color: var(--muted); }
.tile-link { color: inherit; text-decoration: none; }
/* Week view: one column a day, events that run several days drawn across them, like TeamCal. */
.week { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); grid-template-rows: auto repeat(var(--lanes), auto) 1fr; column-gap: 0; row-gap: 3px; min-height: 100%; }
.week-col { grid-row: 1 / -1; border-left: 1px solid var(--border); }
.week-col:first-child { border-left: 0; }
.week-col.today { background: var(--today); }
.week-head { grid-row: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 6px; white-space: nowrap; padding: 4px 8px 6px; border-bottom: 1px solid var(--border); }
.week-name { text-transform: uppercase; letter-spacing: 0.06em; font-size: calc(0.78rem * var(--fit, 1)); color: var(--muted); font-weight: 600; }
.week-head.today .week-name { color: var(--accent); }
.week-date { font-weight: 700; font-size: calc(1rem * var(--fit, 1)); }
.week-span, .week-day { padding: 0 4px; min-width: 0; }
.week .chip { font-size: calc(1.05rem * var(--fit, 1)); padding: 3px 8px; margin: 0 0 3px; border-radius: 5px; }

/* Across the top of a calendar tile: title, view buttons and the color key, on one line when there is room. */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: calc(6px * var(--fit, 1)) calc(14px * var(--fit, 1)); margin: 0 0 calc(8px * var(--fit, 1)); }
.cal-head h2 { margin: 0; }
.cal-views { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cal-views button { border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(0.78rem * var(--fit, 1)); font-weight: 600;
    padding: calc(3px * var(--fit, 1)) calc(10px * var(--fit, 1)); cursor: pointer; }
.cal-views button + button { border-left: 1px solid var(--border); }
.cal-views button:hover { color: var(--text); background: rgba(127, 127, 127, .14); }
.cal-views button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text, #fff); }
body.wall-dark .cal-views button[aria-pressed="true"] { color: #0b1a26; }
.cal-legend { display: flex; flex-wrap: wrap; gap: calc(4px * var(--fit, 1)) calc(12px * var(--fit, 1)); margin: 0 0 0 auto; padding: 0; list-style: none;
    font-size: calc(0.78rem * var(--fit, 1)); color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; }
.cal-dot { width: .8em; height: .8em; border-radius: 3px; background: var(--c); flex: none; }
.tile[aria-busy="true"] .body { opacity: .6; transition: opacity .2s; }
/* Board: a column for each of the next seven days, a card for each event. */
.board { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); min-height: 100%; }
.board-col { border-left: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; }
.board-col:first-child { border-left: 0; }
.board-col.today { background: var(--today); }
.board-cards { padding: calc(4px * var(--fit, 1)); }
.board .chip { font-size: calc(0.95rem * var(--fit, 1)); padding: calc(3px * var(--fit, 1)) calc(7px * var(--fit, 1)); margin: 0 0 calc(3px * var(--fit, 1)); border-radius: 5px; white-space: normal; }
.board-sub { display: block; margin: calc(-2px * var(--fit, 1)) 0 calc(5px * var(--fit, 1)) calc(7px * var(--fit, 1)); font-size: calc(0.72rem * var(--fit, 1)); color: var(--muted); }

/* Agenda: upcoming events grouped by day. */
.agenda-day { font-size: calc(0.78rem * var(--fit, 1)); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 12px 0 6px; }
.agenda-day:first-child { margin-top: 0; }
.agenda-day.today { color: var(--accent); }
.agenda-item { border-left: 3px solid var(--type); padding: 1px 0 1px 9px; margin: 0 0 8px; }
.agenda-when { display: block; font-size: calc(0.78rem * var(--fit, 1)); color: var(--muted); }
.agenda-title { display: block; font-size: calc(1rem * var(--fit, 1)); color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-title.done { text-decoration: line-through; opacity: 0.7; }
.agenda-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; align-items: center; padding: 3px 0; }
.agenda-date { color: var(--muted); font-size: 0.8rem; }
.calendar-page .month td { height: 110px; }
.calendar-page .month td a.add-day { color: inherit; text-decoration: none; }
.calendar-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.calendar-nav h1 { margin: 0 auto 0 0; }
.weekday-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.weekday-picks label { font-weight: 400; margin: 0; }
.type-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.type-row:first-of-type { border-top: 0; }
.type-row input[type=color] { width: 44px; height: 32px; padding: 0; }
.type-row input[type=text] { width: auto; flex: 1; min-width: 140px; }
.type-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.type-tools label { margin: 0; font-weight: 400; color: var(--muted); }
.type-tools select { width: auto; }
.type-form { display: flex; flex: 1; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.type-form input[type=color] { width: 44px; height: 32px; padding: 0; }
.type-form input[type=text] { width: auto; flex: 1; min-width: 140px; }
.icon-pick { display: grid; place-items: center; width: 34px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px;
    background: var(--c); color: var(--t); font: inherit; cursor: pointer; }
.icon-pick svg.ti { width: 18px; height: 18px; }
.swatches { display: inline-flex; gap: 3px; }
.swatch { width: 18px; height: 18px; padding: 0; border: 1px solid rgba(0, 0, 0, .2); border-radius: 4px; background: var(--c); cursor: pointer; }
.swatch:hover, .swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.palette-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); margin: 0; flex-wrap: wrap; }
.palette-swatches { display: inline-flex; }
.palette-swatches i { width: 16px; height: 22px; background: var(--c); }
.palette-swatches i:first-child { border-radius: 4px 0 0 4px; }
.palette-swatches i:last-child { border-radius: 0 4px 4px 0; }
.palette-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; font-size: 0.9rem; }
.icon-dialog { width: min(640px, 92vw); max-height: 80vh; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); }
.icon-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.icon-dialog-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); }
.icon-dialog-head input { flex: 1; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; padding: 12px; overflow: auto; max-height: calc(80vh - 70px); }
.icon-grid button { display: grid; place-items: center; height: 44px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.icon-grid button:hover, .icon-grid button:focus-visible { border-color: var(--accent); background: rgba(127, 127, 127, .1); }
.icon-grid button[hidden] { display: none; }
.icon-grid svg.ti { width: 22px; height: 22px; }
@media (max-width: 720px) { .calendar-page .month td { height: 70px; } .calendar-page .chip-time { display: none; } }
