:root {
    --bg: #f5f6f8;
    --card: rgba(255,255,255,.86);
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(17,24,39,.10);
    --shadow: 0 22px 60px rgba(15,23,42,.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--text); }

.widget-body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

.occupancy-widget {
    position: relative;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 22px;
    isolation: isolate;
}

.occupancy-widget:before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
}

.occupancy-widget:after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 21px;
    background: linear-gradient(145deg, rgba(255,255,255,.74), rgba(255,255,255,.28));
    z-index: -1;
    border: 1px solid rgba(255,255,255,.46);
}

.status-green:before { background: radial-gradient(circle at 80% 10%, #d8ffe5 0, transparent 45%), linear-gradient(135deg, #dff8e8, #a7e7bd); }
.status-orange:before { background: radial-gradient(circle at 80% 10%, #fff3c4 0, transparent 45%), linear-gradient(135deg, #fff0ba, #f3b65c); }
.status-red:before { background: radial-gradient(circle at 80% 10%, #ffd7d7 0, transparent 45%), linear-gradient(135deg, #ffd3d3, #e15858); }

.widget-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.widget-title { font-size: 22px; line-height: 1.1; font-weight: 760; letter-spacing: -.04em; }
.widget-subtitle { margin-top: 6px; font-size: 14px; color: rgba(17,24,39,.68); font-weight: 560; }
.widget-dot { width: 18px; height: 18px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 8px 20px rgba(0,0,0,.13); background: rgba(255,255,255,.62); }

.widget-main { text-align: center; margin: 10px 0 0; }
.widget-count { font-size: 78px; line-height: .95; font-weight: 820; letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.widget-unit { margin-top: 10px; font-size: 17px; color: rgba(17,24,39,.74); font-weight: 650; }

.widget-status { font-size: 18px; font-weight: 780; letter-spacing: -.02em; }
.widget-text { margin-top: 7px; font-size: 14px; line-height: 1.35; color: rgba(17,24,39,.72); max-width: 510px; }
.widget-updated { margin-top: 11px; font-size: 12px; color: rgba(17,24,39,.58); font-weight: 600; }

.occupancy-tall { padding: 30px 24px; text-align: center; align-items: stretch; }
.occupancy-tall .widget-topline { display: block; text-align: center; }
.occupancy-tall .widget-title { font-size: 25px; }
.occupancy-tall .widget-subtitle { font-size: 15px; }
.occupancy-tall .widget-dot { margin: 18px auto 0; width: 24px; height: 24px; }
.occupancy-tall .widget-count { font-size: 88px; }
.occupancy-tall .widget-unit { max-width: 200px; margin-left: auto; margin-right: auto; }
.occupancy-tall .widget-status { font-size: 23px; }
.occupancy-tall .widget-text { font-size: 15px; margin-left: auto; margin-right: auto; }

.preview-body { background: var(--bg); min-height: 100vh; }
.preview-wrap { max-width: 1180px; margin: 0 auto; padding: 42px 24px 60px; }
.preview-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 26px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); font-weight: 750; }
h1 { margin: 6px 0 10px; font-size: 42px; letter-spacing: -.06em; line-height: 1; }
p { margin: 0; color: var(--muted); line-height: 1.45; }
.preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); gap: 24px; align-items: start; }
.preview-card { background: var(--card); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(18px); }
.preview-card-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 16px; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; text-transform: lowercase; }
.preview-card-head p { font-size: 13px; margin-top: 4px; }
button { border: 0; border-radius: 999px; padding: 10px 14px; background: #111827; color: #fff; font-weight: 700; cursor: pointer; font-family: inherit; }
iframe { display: block; border: 0; border-radius: 22px; box-shadow: 0 12px 34px rgba(15,23,42,.14); background: transparent; }
.frame-wide { width: 600px; height: 300px; max-width: 100%; }
.frame-tall { width: 300px; height: 600px; max-width: 100%; margin-left: auto; margin-right: auto; }
textarea { width: 100%; min-height: 92px; margin-top: 16px; border: 1px solid var(--border); border-radius: 16px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #374151; background: rgba(255,255,255,.68); resize: vertical; }

@media (max-width: 960px) {
    .preview-grid { grid-template-columns: 1fr; }
    .preview-card { overflow-x: auto; }
}
