:root {
  --bg: #130f1f;
  --panel: rgba(18, 24, 38, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: rgba(232, 237, 247, 0.7);
  --accent-color: #ff7a18;
  --shadow: 0 24px 80px rgba(5, 8, 18, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --transition-ms: 1400ms;
  --motion-state: running;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #09070d;
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Frame (kiosk) must lock to viewport — no scroll, no bottom gap */
html:has(body.frame-shell),
body.frame-shell {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
body.frame-shell .frame-stage {
  height: 100vh;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 30%),
    radial-gradient(circle at right 20%, rgba(74, 222, 128, 0.16), transparent 28%),
    linear-gradient(160deg, #0c0914 0%, #141826 50%, #0c111a 100%);
  z-index: -3;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.55;
  z-index: -2;
  animation: float 18s ease-in-out infinite;
}

.ambient-one {
  width: 16rem;
  height: 16rem;
  top: 6%;
  right: -3rem;
  background: rgba(249, 115, 22, 0.22);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  bottom: 8%;
  left: -4rem;
  background: rgba(59, 130, 246, 0.2);
  animation-duration: 23s;
}

.app-grid {
  width: min(1180px, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.hero-card,
.panel {
  background: var(--panel);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.hero-card {
  grid-column: span 12;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.hero-card h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.92;
}

.hero-copy,
.helper-copy,
.slide-card p,
.inline-message,
.frame-subtitle {
  color: var(--muted);
}

.eyebrow,
.slide-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.58);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.studio-toolbar {
  grid-column: span 12;
  display: grid;
  gap: 0.85rem;
}

.studio-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-card {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.56);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.stat-card strong {
  font-size: clamp(1.05rem, 4vw, 1.5rem);
}

.mobile-nav {
  position: sticky;
  top: 0.7rem;
  z-index: 15;
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(8, 11, 20, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.nav-chip {
  white-space: nowrap;
  border: 0;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

.nav-chip.is-active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(251, 113, 133, 0.28));
  color: #fff8f2;
}

.status-pill,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.card-actions button {
  border-radius: 999px;
  padding: 0.88rem 1.2rem;
  border: 1px solid transparent;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font: inherit;
}

.status-pill.is-live {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.24);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent-color), #fb7185);
  color: #fff8f2;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.09);
}

.danger-button {
  background: rgba(239, 68, 68, 0.18);
}

.panel {
  padding: 1.25rem;
}

.panel-priority {
  position: relative;
  overflow: hidden;
}

.panel-badge {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.16);
  color: rgba(255, 244, 237, 0.92);
  font-size: 0.78rem;
}

.panel-badge.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
}

.panel:nth-of-type(2),
.panel:nth-of-type(3) {
  grid-column: span 6;
}

.panel-wide {
  grid-column: span 12;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.stack-form {
  display: grid;
  gap: 0.9rem;
}

.stack-form label,
.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
}

.stack-form span {
  display: block;
  margin-bottom: 0.35rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 8, 18, 0.38);
  color: var(--text);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

textarea {
  resize: vertical;
}

.dropzone {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 9.2rem;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  cursor: pointer;
  padding: 1rem;
}

.upload-preview-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 4 / 5;
  background: rgba(0, 0, 0, 0.18);
}

.preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-overlay-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.42) 72%, rgba(0, 0, 0, 0.62));
}

.preview-overlay-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.preview-subtitle,
.preview-title {
  margin: 0;
}

.preview-title {
  font-size: clamp(1.35rem, 5vw, 2.1rem);
}

.preview-subtitle {
  color: rgba(255, 255, 255, 0.74);
  margin-bottom: 0.4rem;
}

.preview-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-inline-button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 0;
}

.dropzone input {
  display: none;
}

.split-fields,
.toggle-grid,
.card-actions,
.mini-fields {
  display: grid;
  gap: 0.8rem;
}

.split-fields,
.mini-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.toggle-card input {
  width: auto;
  margin: 0;
}

.slides-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.empty-state {
  min-height: 10rem;
  place-items: center;
  display: grid;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.slide-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.slide-card-media {
  position: relative;
}

.slide-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.slide-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.22) 58%, rgba(0, 0, 0, 0.64));
}

.slide-card-overlay[data-style="solid"] {
  inset: auto 0 0 0;
  min-height: 42%;
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.04), rgba(12, 14, 20, 0.78) 50%, rgba(12, 14, 20, 0.96));
}

.slide-card-overlay[data-style="minimal"] {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.16) 68%, rgba(0, 0, 0, 0.52));
}

.slide-card-overlay[data-align="center"] {
  text-align: center;
}

.slide-card-overlay[data-align="right"] {
  text-align: right;
}

.slide-card-overlay h3,
.slide-card-overlay p {
  margin: 0;
}

.slide-card-overlay p {
  color: rgba(255, 255, 255, 0.74);
  margin-bottom: 0.28rem;
}

.slide-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.slide-meta-chips.is-empty {
  display: none;
}

.slide-meta-chips span {
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.76rem;
}

.slide-card-body {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.slide-card-headline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.slide-order-badge {
  flex-shrink: 0;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
}

.slide-card-body h3 {
  margin: 0.35rem 0;
}

.card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-actions .danger-button,
.card-actions .secondary-button {
  grid-column: span 2;
}

.inline-message {
  min-height: 1.2rem;
  margin: 0;
}

.inline-message.is-error {
  color: #fca5a5;
}

.admin-shell .hidden {
  display: none;
}

.admin-shell {
  --admin-card-bg: linear-gradient(180deg, rgba(17, 22, 35, 0.96), rgba(10, 15, 24, 0.9));
  --admin-soft-border: rgba(255, 255, 255, 0.09);
}

.admin-shell .hero-card,
.admin-shell .panel,
.admin-shell .stat-card {
  background: var(--admin-card-bg);
  border-color: var(--admin-soft-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-shell .hero-copy-wrap,
.admin-shell .hero-side {
  display: grid;
  gap: 1rem;
}

.admin-shell .hero-copy-wrap {
  max-width: 44rem;
}

.admin-shell .hero-side {
  justify-items: end;
}

.admin-shell .hero-actions {
  justify-content: flex-end;
}

.admin-shell .hero-note-card {
  max-width: 19rem;
  padding: 1rem 1.1rem;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-shell .hero-note-label {
  display: block;
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.admin-shell .hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.admin-shell .hero-chip {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(245, 247, 251, 0.9);
  font-size: 0.84rem;
}

.admin-shell .studio-stats {
  gap: 1rem;
}

.admin-shell .stat-card {
  padding: 1.05rem 1.1rem;
  border-radius: 24px;
}

.admin-shell .mobile-nav {
  padding: 0.45rem;
  background: rgba(10, 14, 24, 0.86);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 40px rgba(3, 8, 16, 0.3);
}

.admin-shell .nav-chip {
  padding: 0.95rem 1.1rem;
  font-weight: 600;
}

.admin-shell .panel {
  padding: 1.3rem;
}

.admin-shell .panel-header {
  align-items: start;
  margin-bottom: 1.2rem;
}

.admin-shell .panel-header h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

.admin-shell .stack-form {
  gap: 1rem;
}

.admin-shell .field-shell {
  display: grid;
  gap: 0.55rem;
}

.admin-shell .field-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.admin-shell .field-row output {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 15, 0.44);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-shell input:focus,
.admin-shell select:focus,
.admin-shell textarea:focus,
.admin-shell button:focus-visible,
.admin-shell .nav-chip:focus-visible,
.admin-shell .ghost-inline-button:focus-visible,
.admin-shell .slide-editor-shell summary:focus-visible {
  outline: 2px solid rgba(255, 122, 24, 0.55);
  outline-offset: 2px;
}

.admin-shell .form-block {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-shell .form-block-accent {
  background: linear-gradient(180deg, rgba(255, 122, 24, 0.08), rgba(255, 122, 24, 0.03));
  border-color: rgba(255, 122, 24, 0.18);
}

.admin-shell .form-block-head h3 {
  margin: 0;
  font-size: 1.03rem;
}

.admin-shell .form-block-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-shell .dropzone {
  min-height: 10rem;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 122, 24, 0.08), rgba(255, 255, 255, 0.03));
  padding: 1.2rem;
}

.admin-shell .ghost-inline-button {
  padding: 0.3rem 0.1rem;
  font-weight: 600;
}

.admin-shell .toggle-grid-modern {
  grid-template-columns: 1fr;
}

.admin-shell .modern-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  align-items: start;
  padding: 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.admin-shell .modern-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-shell .toggle-switch {
  width: 3.1rem;
  height: 1.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  flex-shrink: 0;
  transition: background 180ms ease;
  margin-top: 0.05rem;
}

.admin-shell .toggle-switch::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.52rem;
  height: 1.52rem;
  border-radius: 999px;
  background: #fff;
  transition: transform 180ms ease;
}

.admin-shell .modern-toggle input:checked + .toggle-switch {
  background: linear-gradient(135deg, var(--accent-color), #fb7185);
}

.admin-shell .modern-toggle input:checked + .toggle-switch::after {
  transform: translateX(1.2rem);
}

.admin-shell .toggle-copy {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
  grid-column: 1 / -1;
}

.admin-shell .toggle-copy strong,
.admin-shell .toggle-copy small {
  display: block;
}

.admin-shell .toggle-copy strong {
  font-size: 1.02rem;
  line-height: 1.18;
  max-width: 24ch;
}

.admin-shell .toggle-copy small {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
  max-width: 34ch;
}

.admin-shell input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 0.5rem;
  border-radius: 999px;
  padding: 0;
  border: 0;
  background: linear-gradient(90deg, var(--accent-color) 0, #fb7185 var(--range-percent, 50%), rgba(255, 255, 255, 0.12) var(--range-percent, 50%), rgba(255, 255, 255, 0.12) 100%);
  box-shadow: none;
}

.admin-shell input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(255, 122, 24, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.admin-shell input[type="range"]::-moz-range-track {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.admin-shell input[type="range"]::-moz-range-progress {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color), #fb7185);
}

.admin-shell input[type="range"]::-moz-range-thumb {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(255, 122, 24, 0.95);
}

.admin-shell .slide-card {
  background: linear-gradient(180deg, rgba(17, 22, 35, 0.98), rgba(10, 15, 24, 0.9));
  border-radius: 26px;
}

.admin-shell .slide-card-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-shell .toolbar-button {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.78rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  white-space: normal;
}

.admin-shell .toolbar-button-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.admin-shell .slide-editor-shell {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8rem;
}

.admin-shell .slide-editor-shell summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.admin-shell .slide-editor-shell summary::-webkit-details-marker {
  display: none;
}

.admin-shell .slide-editor-shell[open] summary {
  margin-bottom: 0.9rem;
}

.admin-shell .card-actions {
  grid-template-columns: 1fr;
}

.admin-shell .card-actions .danger-button,
.admin-shell .card-actions .secondary-button {
  grid-column: span 1;
}

.admin-shell .card-actions button,
.admin-shell .primary-button,
.admin-shell .secondary-button,
.admin-shell .danger-button,
.admin-shell .ghost-button {
  min-width: 0;
  white-space: normal;
  text-align: center;
}

.admin-shell .primary-button,
.admin-shell .secondary-button,
.admin-shell .danger-button,
.admin-shell .ghost-button,
.admin-shell .status-pill {
  padding: 0.94rem 1.2rem;
  font-weight: 600;
}

.frame-shell {
  overflow: hidden;
}

.frame-background {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.frame-background.aurora {
  background: radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.18), transparent 28%), radial-gradient(circle at 80% 30%, rgba(59, 130, 246, 0.16), transparent 25%), #06070b;
}

.frame-background.paper {
  background: linear-gradient(145deg, #ddd4c5, #bcae98);
}

.frame-background.midnight {
  background: linear-gradient(160deg, #040509 0%, #0b1322 45%, #141d31 100%);
}

.frame-stage {
  position: relative;
  min-height: 100vh;
}

.frame-stage[data-view="photo"] #framePhotoView {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.frame-stage[data-view="photo"] #frameCalendarView {
  opacity: 0;
  pointer-events: none;
  transform: translateX(28px) scale(0.99);
}

.frame-stage[data-view="calendar"] #framePhotoView {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28px) scale(0.99);
}

.frame-stage[data-view="calendar"] #frameCalendarView {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.frame-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-ms) ease;
}

.frame-layer.is-visible {
  opacity: 1;
}

.frame-image {
  width: 100%;
  height: 100vh;
  object-fit: cover;
  animation: kenburns 18s ease-in-out infinite alternate;
  animation-play-state: var(--motion-state);
  filter: saturate(1) contrast(1) brightness(1);
}

.frame-image[data-filter="cinematic"] {
  filter: saturate(0.96) contrast(1.08) brightness(0.92) sepia(0.08);
}

.frame-image[data-filter="vivid"] {
  filter: saturate(1.18) contrast(1.04) brightness(1.02);
}

.frame-image[data-filter="mono"] {
  filter: grayscale(1) contrast(1.06) brightness(0.96);
}

.frame-image[data-filter="dream"] {
  filter: saturate(1.06) contrast(0.98) brightness(1.05) blur(0.2px);
}

.frame-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, var(--overlay-opacity, 0.32)) 72%, rgba(0, 0, 0, calc(var(--overlay-opacity, 0.32) + 0.18)) 100%);
}

body[data-overlay-theme="cinema"] .frame-overlay {
  background: linear-gradient(180deg, rgba(1, 1, 1, 0.12), rgba(1, 1, 1, calc(var(--overlay-opacity, 0.32) + 0.12)) 70%, rgba(1, 1, 1, 0.78));
}

body[data-overlay-theme="soft"] .frame-overlay {
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.05), rgba(28, 22, 34, calc(var(--overlay-opacity, 0.32) + 0.12)) 70%, rgba(20, 16, 26, 0.78));
}

.frame-copy {
  width: min(55rem, calc(100vw - 6rem));
  padding: 0 0 3.6rem 3.6rem;
}

.frame-copy[data-card="solid"] {
  margin: 0 0 1.25rem 1.5rem;
  padding: 1.2rem 1.35rem;
  max-width: min(44rem, calc(100vw - 4rem));
  border-radius: 28px;
  background: rgba(12, 16, 24, 0.52);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.frame-copy[data-card="minimal"] {
  max-width: min(48rem, calc(100vw - 5rem));
}

.frame-copy[data-align="center"] {
  margin: 0 auto;
  text-align: center;
  padding-left: 0;
}

.frame-copy[data-align="right"] {
  margin-left: auto;
  text-align: right;
  padding-right: 3.6rem;
  padding-left: 0;
}

.frame-title,
.frame-subtitle {
  max-width: 28ch;
  text-wrap: balance;
}

.frame-title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  line-height: 0.95;
}

.frame-subtitle {
  margin: 0 0 0.9rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.frame-copy[data-size="sm"] .frame-title {
  font-size: clamp(2rem, 4vw, 4rem);
}

.frame-copy[data-size="lg"] .frame-title {
  font-size: clamp(3rem, 7vw, 6.6rem);
}

.frame-slide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.frame-slide-meta span,
.frame-counter {
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.frame-meta {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  right: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  z-index: 10;
  color: rgba(255, 255, 255, 0.72);
}

.frame-meta > * {
  flex-shrink: 0;
}

.frame-empty {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.frame-empty.is-visible {
  display: grid;
}

.hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 0.7s ease forwards;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

.delay-3 {
  animation-delay: 0.24s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -18px, 0) scale(1.05);
  }
}

@keyframes kenburns {
  from {
    transform: scale(var(--slide-zoom, 1)) translate3d(0, 0, 0);
  }
  to {
    transform: scale(calc(var(--slide-zoom, 1) * 1.08)) translate3d(-1.5%, -1.5%, 0);
  }
}

@media (max-width: 900px) {
  .app-grid {
    width: min(100vw - 1rem, 46rem);
    padding-top: 0.75rem;
  }

  .panel:nth-of-type(2),
  .panel:nth-of-type(3),
  .panel-wide,
  .hero-card {
    grid-column: span 12;
  }

  .studio-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toggle-grid,
  .split-fields,
  .mini-fields,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.15rem;
  }

  .admin-shell .hero-side {
    justify-items: stretch;
  }

  .admin-shell .hero-actions {
    justify-content: stretch;
  }

  .admin-shell .hero-note-card {
    max-width: none;
  }

  .panel {
    padding: 1rem;
  }

  .preview-meta-row,
  .slide-card-headline {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-nav {
    top: 0.45rem;
  }

  .admin-shell .slide-card-toolbar,
  .admin-shell .toggle-grid-modern {
    grid-template-columns: 1fr;
  }

  .frame-copy {
    width: calc(100vw - 2rem);
    padding: 0 1rem 2rem;
  }

  .frame-copy[data-align="right"] {
    padding-right: 1rem;
  }
}

@media (max-width: 560px) {
  .studio-stats {
    grid-template-columns: 1fr;
  }

  .admin-shell .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-card h1 {
    font-size: clamp(2.1rem, 12vw, 3.6rem);
  }

  .dropzone {
    min-height: 8rem;
  }

  .slides-list {
    grid-template-columns: 1fr;
  }
}

.calendar-shell {
  color: #f7f0df;
}

.calendar-shell::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(245, 158, 11, 0.2), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(250, 204, 21, 0.18), transparent 28%),
    linear-gradient(160deg, #050506 0%, #0f121a 42%, #0b0f15 100%);
}

.calendar-ambient {
  position: fixed;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.42;
  z-index: -2;
}

.calendar-ambient.one {
  top: -4rem;
  right: -4rem;
  background: rgba(245, 158, 11, 0.28);
}

.calendar-ambient.two {
  left: -5rem;
  bottom: -6rem;
  background: rgba(212, 175, 55, 0.25);
}

.calendar-app {
  width: min(1160px, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  display: grid;
  gap: 1rem;
}

.calendar-hero,
.calendar-card {
  border-radius: 30px;
  border: 1px solid rgba(250, 204, 21, 0.22);
  background: linear-gradient(170deg, rgba(15, 18, 26, 0.92), rgba(7, 9, 14, 0.94));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(250, 204, 21, 0.12);
}

.calendar-hero {
  padding: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.calendar-hero h1 {
  margin: 0.3rem 0 0.4rem;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 0.96;
}

.calendar-hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.calendar-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.1fr 0.9fr;
}

.calendar-card {
  padding: 1.15rem;
  display: grid;
  gap: 0.9rem;
}

.calendar-card h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.calendar-card-wide {
  grid-column: 1 / 2;
}

.calendar-form {
  display: grid;
  gap: 0.85rem;
}

.calendar-two-col {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-actions {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-inline-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.calendar-inline-toggle input {
  width: auto;
  margin: 0;
}

.category-list,
.event-list,
.frame-calendar-timeline {
  display: grid;
  gap: 0.75rem;
}

.category-item,
.event-item,
.frame-calendar-event,
.photo-event-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.78rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-icon,
.event-leading,
.photo-event-icon,
.frame-calendar-event span {
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #0f0f0f;
  background: var(--cat-color, #f59e0b);
}

.ff-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.category-item-actions,
.event-item-actions {
  display: flex;
  gap: 0.45rem;
}

.category-item-actions button,
.event-item-actions button {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f0df;
  padding: 0.5rem 0.7rem;
}

.event-item p,
.event-item small,
.category-item small,
.photo-event-item small,
.frame-calendar-event small {
  margin: 0.2rem 0 0;
  color: rgba(247, 240, 223, 0.72);
}

.calendar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.calendar-segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.22);
  background: rgba(10, 12, 18, 0.7);
}

.calendar-segmented button {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  color: rgba(247, 240, 223, 0.78);
  background: transparent;
}

.calendar-segmented button.is-active {
  color: #161616;
  background: linear-gradient(135deg, #f59e0b, #facc15);
  font-weight: 700;
}

.calendar-nav-row,
.calendar-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.calendar-nav-row {
  justify-content: space-between;
  flex-wrap: wrap;
}

.calendar-view-content {
  position: relative;
  overflow: hidden;
  min-height: 12rem;
}

.calendar-view-content.from-left,
.calendar-view-content.from-right {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-fill-mode: both;
}

.calendar-view-content.from-left {
  animation-name: calendarSlideFromLeft;
}

.calendar-view-content.from-right {
  animation-name: calendarSlideFromRight;
}

.calendar-day-column,
.calendar-week-events {
  display: grid;
  gap: 0.6rem;
}

.calendar-week-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-week-day {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem;
}

.calendar-week-day > header {
  margin-bottom: 0.55rem;
  color: rgba(250, 204, 21, 0.95);
  font-size: 0.86rem;
  font-weight: 700;
}

.event-item-compact {
  grid-template-columns: auto 1fr;
}

.event-item-compact .event-item-actions,
.event-item-compact p {
  display: none;
}

.event-item-compact small {
  margin-top: 0.25rem;
}

.calendar-month-head,
.calendar-month-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-month-head span {
  text-align: center;
  color: rgba(247, 240, 223, 0.6);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.calendar-month-cell {
  min-height: 5.7rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.45rem;
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.calendar-month-cell.is-muted {
  opacity: 0.4;
}

.calendar-month-cell.is-today {
  border-color: rgba(250, 204, 21, 0.62);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.2);
}

.calendar-month-cell header {
  display: flex;
  justify-content: flex-end;
}

.calendar-month-cell header span {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
}

.calendar-month-events {
  display: grid;
  gap: 0.3rem;
}

.calendar-dot-event {
  border: 0;
  text-align: left;
  border-radius: 10px;
  padding: 0.32rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--cat-color, #f59e0b);
  color: rgba(247, 240, 223, 0.95);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-shell {
  color: #f7f0df;
}

.frame-shell::before {
  background:
    radial-gradient(circle at 10% 14%, rgba(245, 158, 11, 0.14), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(234, 179, 8, 0.14), transparent 24%),
    linear-gradient(160deg, #060607 0%, #0b0d12 44%, #0a0c10 100%);
}

.frame-mode-view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: opacity 380ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.frame-mode-view.is-active {
  opacity: 1;
  pointer-events: auto;
}

.frame-calendar-view {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.frame-calendar-shell {
  width: min(66rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  border-radius: 28px;
  border: 1px solid rgba(250, 204, 21, 0.24);
  background: linear-gradient(160deg, rgba(13, 16, 22, 0.92), rgba(7, 9, 14, 0.95));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(250, 204, 21, 0.12);
  padding: 1rem;
}

.frame-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.frame-calendar-head h2 {
  margin: 0.3rem 0 0;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
}

.frame-calendar-switch {
  display: flex;
  gap: 0.5rem;
}

.frame-calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.frame-calendar-range {
  display: block;
  color: rgba(250, 204, 21, 0.95);
  margin-bottom: 0.65rem;
}

.frame-calendar-switch .ghost-button.is-active {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #101012;
}

.frame-calendar-day {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.7rem;
}

.frame-calendar-day > header {
  color: rgba(250, 204, 21, 0.95);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.photo-event-widget {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  width: min(23rem, calc(100vw - 2rem));
  border-radius: 20px;
  border: 1px solid rgba(250, 204, 21, 0.2);
  background: linear-gradient(160deg, rgba(10, 12, 18, 0.72), rgba(5, 7, 10, 0.9));
  backdrop-filter: blur(14px);
  padding: 0.75rem;
}

.photo-event-widget > header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.frame-view-indicator {
  position: fixed;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 12, 19, 0.8);
}

.dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: rgba(247, 240, 223, 0.32);
  transition: transform 220ms ease, background 220ms ease;
}

.dot.is-active {
  transform: scale(1.22);
  background: linear-gradient(135deg, #f59e0b, #facc15);
}

@keyframes calendarSlideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes calendarSlideFromRight {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-card-wide {
    grid-column: auto;
  }

  .calendar-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-actions,
  .calendar-two-col,
  .category-item,
  .event-item,
  .photo-event-item {
    grid-template-columns: 1fr;
  }

  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .calendar-month-head,
  .calendar-month-grid {
    min-width: 34rem;
  }

  .calendar-view-content {
    overflow: auto;
  }

  .frame-calendar-head {
    flex-direction: column;
  }

  .frame-calendar-controls,
  .calendar-nav-row {
    align-items: stretch;
  }
}
/* ========== APPLE-STYLE CALENDAR v2 ========== */
.cal-shell {
  min-height: 100vh;
  color: #f7f0df;
  background: radial-gradient(circle at 12% 8%, rgba(245, 158, 11, 0.18), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(250, 204, 21, 0.14), transparent 32%),
    linear-gradient(160deg, #070709 0%, #0c0e14 48%, #05070b 100%);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Aptos", "Segoe UI", sans-serif;
}
.cal-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}
.cal-glow-one { top: -10rem; left: -10rem; background: #f59e0b; }
.cal-glow-two { bottom: -12rem; right: -10rem; background: #0ea5e9; opacity: 0.25; }

.cal-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.85);
  font-weight: 600;
}

.cal-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: rgba(8, 10, 16, 0.78);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-topbar h1 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 700;
}
.cal-topbar-left { display: flex; align-items: center; gap: 0.9rem; }
.cal-topbar-right { display: flex; justify-content: flex-end; gap: 0.5rem; }

.cal-topbar-tabs {
  display: inline-flex;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
.cal-topbar-tabs button {
  border: 0;
  background: transparent;
  color: rgba(247, 240, 223, 0.75);
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}
.cal-topbar-tabs button:hover { color: #fff; }
.cal-topbar-tabs button.is-active {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #111;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.cal-chip-link {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(247, 240, 223, 0.85);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: background 200ms ease, transform 200ms ease;
}
.cal-chip-link:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }

.cal-icon-button {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f7f0df;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background 200ms ease;
}
.cal-icon-button:hover { background: rgba(255, 255, 255, 0.1); }
.cal-icon-button span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.cal-main {
  flex: 1;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 1.4rem 1.4rem 4rem;
}
.cal-panel { display: none; animation: calFade 280ms ease; }
.cal-panel.is-active { display: block; }
@keyframes calFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cal-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cal-segmented {
  display: inline-flex;
  padding: 0.22rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.cal-segmented button {
  border: 0;
  background: transparent;
  color: rgba(247, 240, 223, 0.75);
  padding: 0.42rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.cal-segmented button.is-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(250, 204, 21, 0.92));
  color: #111;
}

.cal-nav-group { display: inline-flex; gap: 0.4rem; align-items: center; }
.cal-round-button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f7f0df;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}
.cal-round-button:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.cal-pill-button {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f7f0df;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}
.cal-pill-button:hover { background: rgba(255, 255, 255, 0.12); }

.cal-primary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.56rem 1.1rem;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: #111;
  cursor: pointer;
  background: linear-gradient(135deg, #f59e0b, #facc15);
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.35);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.cal-primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(245, 158, 11, 0.45); }
.cal-primary-button span { font-size: 1.1em; line-height: 1; }

.cal-ghost-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #f7f0df;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}
.cal-ghost-button:hover { background: rgba(255, 255, 255, 0.08); }

.cal-danger-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}
.cal-danger-button:hover { background: rgba(248, 113, 113, 0.22); }
.cal-danger-button.hidden { display: none; }

.cal-surface {
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(13, 16, 22, 0.85), rgba(6, 8, 12, 0.95));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: auto;
  max-height: calc(100vh - 14rem);
}
.cal-view-content { position: relative; }
.cal-view-content.from-right { animation: calSlideR 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.cal-view-content.from-left { animation: calSlideL 320ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes calSlideR { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes calSlideL { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* Day view */
.cal-day-shell { padding: 0 0 1rem; }
.cal-allday-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-allday-label { font-size: 0.72rem; color: rgba(250, 204, 21, 0.8); letter-spacing: 0.08em; text-transform: uppercase; }
.cal-allday-events { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cal-chip-event {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color) 20%, transparent);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--cat-color) 55%, transparent);
  font-size: 0.8rem;
}
.cal-chip-event .ff-icon { width: 0.95rem; height: 0.95rem; color: var(--cat-color); }

.cal-day-grid {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  padding: 0.25rem 1rem 0.25rem 0;
}
.cal-hour-labels {
  display: grid;
  grid-auto-rows: var(--hour-height, 54px);
  padding-top: 0;
  font-size: 0.72rem;
  color: rgba(247, 240, 223, 0.5);
}
.cal-hour-labels span {
  display: block;
  transform: translateY(-0.5em);
  padding-right: 0.6rem;
  text-align: right;
}
.cal-day-track {
  position: relative;
  display: grid;
  grid-auto-rows: var(--hour-height, 54px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-hour-slot {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 180ms ease;
}
.cal-hour-slot:hover { background: rgba(245, 158, 11, 0.05); }
.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 3;
  pointer-events: none;
}
.cal-now-line span {
  position: absolute;
  left: -7px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.cal-event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cat-color, #f59e0b) 28%, rgba(10, 12, 18, 0.85));
  border: 1px solid color-mix(in srgb, var(--cat-color, #f59e0b) 60%, transparent);
  border-left: 3px solid var(--cat-color, #f59e0b);
  color: #fff;
  font-size: 0.78rem;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  z-index: 2;
}
.cal-event-block:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35); }
.cal-event-block-icon { display: inline-flex; align-items: center; color: var(--cat-color, #f59e0b); }
.cal-event-block-icon .ff-icon { width: 1rem; height: 1rem; }
.cal-event-block-body { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cal-event-block-body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-block-body small { font-size: 0.7rem; color: rgba(247, 240, 223, 0.7); }

/* Week view */
.cal-week-shell { padding: 0 0 1rem; }
.cal-week-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 4.5rem repeat(7, 1fr);
  gap: 0;
  padding: 0.5rem 1rem 0.6rem 0;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-week-head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0;
  color: rgba(247, 240, 223, 0.7);
  font-size: 0.78rem;
}
.cal-week-head-cell strong {
  font-size: 1.05rem;
  font-weight: 700;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
}
.cal-week-head-cell.is-today strong {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #111;
}
.cal-week-body { display: grid; grid-template-columns: 4.5rem 1fr; padding: 0 1rem 0 0; }
.cal-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week-day-track {
  position: relative;
  display: grid;
  grid-auto-rows: var(--hour-height, 54px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-week-day-track .cal-hour-slot { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

/* Month view */
.cal-month-shell { padding: 0.25rem 0.5rem 0.75rem; }
.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 0.5rem 0.25rem;
  color: rgba(247, 240, 223, 0.6);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(5.2rem, 1fr);
}
.cal-month-cell {
  padding: 0.4rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  transition: background 180ms ease;
  min-height: 0;
  overflow: hidden;
}
.cal-month-cell:hover { background: rgba(255, 255, 255, 0.03); }
.cal-month-cell.is-muted { opacity: 0.45; }
.cal-month-cell header { display: flex; justify-content: flex-end; }
.cal-month-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(247, 240, 223, 0.85);
}
.cal-month-cell.is-today .cal-month-day-number {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #111;
}
.cal-month-events { display: flex; flex-direction: column; gap: 0.22rem; overflow: hidden; }
.cal-month-event {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  font-size: 0.72rem;
  background: color-mix(in srgb, var(--cat-color, #f59e0b) 22%, transparent);
  border-left: 3px solid var(--cat-color, #f59e0b);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-month-event .ff-icon { width: 0.82rem; height: 0.82rem; color: var(--cat-color, #f59e0b); flex: 0 0 auto; }

/* Panels */
.cal-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cal-panel-head h2 { margin: 0; font-size: 1.4rem; }
.cal-panel-head p { margin: 0.2rem 0 0; color: rgba(247, 240, 223, 0.65); }

.cal-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.8rem;
}
.cal-category-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(20, 24, 34, 0.7), rgba(8, 10, 14, 0.85));
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease;
}
.cal-category-card:hover { transform: translateY(-2px); border-color: rgba(250, 204, 21, 0.3); }
.cal-category-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cat-color) 28%, transparent);
  color: var(--cat-color);
}
.cal-category-icon .ff-icon { width: 1.4rem; height: 1.4rem; }
.cal-category-card strong { display: block; font-size: 0.98rem; }
.cal-category-card small { color: rgba(247, 240, 223, 0.55); font-size: 0.78rem; }

.cal-category-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cal-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f7f0df;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.cal-category-chip .ff-icon { width: 0.95rem; height: 0.95rem; color: var(--cat-color, #f59e0b); }
.cal-category-chip.is-active {
  background: color-mix(in srgb, var(--cat-color, #f59e0b) 28%, transparent);
  border-color: color-mix(in srgb, var(--cat-color, #f59e0b) 70%, transparent);
}

/* Settings & fields */
.cal-settings-form {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
  padding: 1.25rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(15, 18, 26, 0.78), rgba(7, 9, 14, 0.9));
}
.cal-field { display: flex; flex-direction: column; gap: 0.35rem; }
.cal-field > span { font-size: 0.78rem; color: rgba(247, 240, 223, 0.7); font-weight: 600; letter-spacing: 0.04em; }
.cal-field input[type="text"],
.cal-field input[type="number"],
.cal-field input[type="datetime-local"],
.cal-field input[type="search"],
.cal-field textarea {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 18, 0.7);
  color: #f7f0df;
  font: inherit;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.cal-field input:focus,
.cal-field textarea:focus {
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}
.cal-field input[type="color"] {
  width: 3.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 18, 0.7);
  cursor: pointer;
}
.cal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.cal-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}
.cal-toggle-row input[type="checkbox"] {
  width: 2.6rem;
  height: 1.5rem;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  cursor: pointer;
  transition: background 200ms ease;
}
.cal-toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #fff;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cal-toggle-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #f59e0b, #facc15);
}
.cal-toggle-row input[type="checkbox"]:checked::after { transform: translateX(1.1rem); }
.cal-toggle-row span { flex: 1; font-size: 0.9rem; }

.cal-helper { color: rgba(247, 240, 223, 0.55); font-size: 0.8rem; }

/* Dialogs */
.cal-dialog {
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: 90vh;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(16, 20, 28, 0.96), rgba(6, 8, 12, 0.98));
  color: #f7f0df;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.cal-dialog-wide { width: min(38rem, calc(100vw - 1.5rem)); }
.cal-dialog::backdrop { background: rgba(5, 6, 10, 0.75); backdrop-filter: blur(8px); }
.cal-dialog[open] { animation: calDialog 260ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes calDialog { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.cal-dialog-body {
  display: grid;
  gap: 0.85rem;
  padding: 1.2rem 1.3rem 1.3rem;
  max-height: 90vh;
  overflow: auto;
}
.cal-dialog-body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}
.cal-dialog-body > header h3 { margin: 0; font-size: 1.15rem; }
.cal-dialog-body > footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}
.cal-dialog-body > footer .cal-danger-button { margin-right: auto; }

.cal-icon-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 18, 0.7);
  color: #f7f0df;
  cursor: pointer;
  text-align: left;
  transition: border-color 200ms ease, background 200ms ease;
}
.cal-icon-picker-trigger:hover { border-color: rgba(250, 204, 21, 0.5); }
.cal-icon-picker-trigger small { display: block; color: rgba(247, 240, 223, 0.5); font-size: 0.75rem; }
.cal-icon-picker-preview {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.14);
  color: #facc15;
  flex: 0 0 auto;
}
.cal-icon-picker-preview .ff-icon { width: 1.3rem; height: 1.3rem; }

.cal-search-field input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 18, 0.7);
  color: #f7f0df;
  font: inherit;
  outline: none;
}
.cal-search-field input:focus { border-color: rgba(250, 204, 21, 0.6); box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18); }

.cal-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr));
  gap: 0.45rem;
  max-height: 22rem;
  overflow: auto;
  padding-right: 0.2rem;
}
.cal-icon-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #f7f0df;
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease;
}
.cal-icon-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(250, 204, 21, 0.08);
}
.cal-icon-tile .ff-icon { width: 1.9rem; height: 1.9rem; color: #facc15; }
.cal-icon-tile.is-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(250, 204, 21, 0.35));
  border-color: rgba(250, 204, 21, 0.8);
}

/* Frame fullscreen calendar */
.frame-calendar-fullscreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.16), transparent 38%),
    radial-gradient(circle at 90% 10%, rgba(250, 204, 21, 0.12), transparent 34%),
    linear-gradient(160deg, #06070b 0%, #0a0d14 50%, #05070b 100%);
}
.frame-cal-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  background: rgba(6, 8, 12, 0.7);
}
.frame-cal-title h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 700;
}
.frame-cal-nav { display: flex; justify-content: flex-end; gap: 0.45rem; align-items: center; }
.frame-cal-surface {
  flex: 1;
  overflow: auto;
  position: relative;
}
.frame-cal-content { position: relative; min-height: 100%; }
.frame-cal-content.from-right { animation: calSlideR 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.frame-cal-content.from-left { animation: calSlideL 320ms cubic-bezier(0.22, 1, 0.36, 1); }

.frame-stage[data-view="calendar"] .frame-meta { display: none !important; }

.frame-cal-surface,
.cal-surface,
.cal-icon-grid {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.frame-cal-surface::-webkit-scrollbar,
.cal-surface::-webkit-scrollbar,
.cal-icon-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .cal-topbar { grid-template-columns: auto auto; padding: 0.7rem 1rem; }
  .cal-topbar-right { display: none; }
  .cal-topbar-tabs { grid-column: 1 / -1; justify-self: center; }
  .cal-main { padding: 1rem 0.75rem 3rem; }
  .cal-control-bar { gap: 0.5rem; }
  .cal-two-col { grid-template-columns: 1fr; }
  .cal-week-head-cell strong { width: 1.6rem; height: 1.6rem; font-size: 0.88rem; }
  .cal-hour-labels { font-size: 0.62rem; }
  .cal-allday-row { grid-template-columns: 3.5rem 1fr; }
  .cal-day-grid { grid-template-columns: 3.5rem 1fr; }
  .cal-week-head { grid-template-columns: 3.5rem repeat(7, 1fr); }
  .cal-week-body { grid-template-columns: 3.5rem 1fr; }
  .cal-month-grid { grid-auto-rows: minmax(3.6rem, 1fr); }
  .cal-month-event span:last-child { display: none; }
  .frame-cal-topbar { grid-template-columns: 1fr 1fr; padding: 0.7rem 0.9rem; }
  .frame-cal-nav { grid-column: 1 / -1; justify-self: center; }
}
@media (max-width: 560px) {
  .cal-surface { max-height: calc(100vh - 16rem); }
  .cal-primary-button span { display: none; }
}

.hidden { display: none !important; }

/* ========== PREMIUM CALENDAR v3: icons, menu, polish ========== */

.cal-round-button svg,
.cal-icon-button svg,
.cal-primary-button svg,
.cal-danger-button svg,
.cal-search-field svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
.cal-icon-button.cal-icon-svg {
  flex-direction: row;
  gap: 0;
}
.cal-icon-button.cal-icon-svg svg { width: 1rem; height: 1rem; }
.cal-icon-button.cal-icon-svg span { display: none; }

.cal-primary-button.cal-icon-only {
  padding: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  justify-content: center;
}
.cal-primary-button.cal-icon-only svg { width: 1.2rem; height: 1.2rem; }

.cal-round-button {
  color: #facc15;
  background: linear-gradient(160deg, rgba(26, 20, 8, 0.9), rgba(8, 9, 13, 0.9));
  border-color: rgba(250, 204, 21, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(250, 204, 21, 0.08);
}
.cal-round-button:hover {
  border-color: rgba(250, 204, 21, 0.5);
  color: #fde68a;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(250, 204, 21, 0.2);
}

.cal-pill-button {
  background: linear-gradient(160deg, rgba(26, 20, 8, 0.9), rgba(8, 9, 13, 0.9));
  border-color: rgba(250, 204, 21, 0.22);
  color: #fde68a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.cal-pill-button:hover {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.3);
}

.cal-primary-button {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 45%, #b45309 100%);
  color: #1a0f00;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(120, 53, 15, 0.4);
  position: relative;
  overflow: hidden;
}
.cal-primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms ease;
  pointer-events: none;
}
.cal-primary-button:hover::before { transform: translateX(120%); }
.cal-primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Event block polish */
.cal-event-block {
  border: 0;
  text-align: left;
  font: inherit;
  width: calc(100% - 8px);
  cursor: pointer;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--cat-color, #f59e0b) 42%, rgba(10, 12, 18, 0.85)),
    color-mix(in srgb, var(--cat-color, #f59e0b) 18%, rgba(6, 8, 12, 0.95))
  );
  border: 1px solid color-mix(in srgb, var(--cat-color, #f59e0b) 55%, transparent);
  border-left: 3px solid var(--cat-color, #f59e0b);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.cal-event-block:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--cat-color, #f59e0b) 80%, transparent);
}
.cal-event-block:active { transform: scale(0.99); }

.cal-hour-slot { position: relative; }
.cal-hour-slot::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.cal-hour-slot:hover {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.03), rgba(250, 204, 21, 0.09));
}
.cal-hour-slot:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

.cal-month-cell { transition: background 200ms ease, transform 200ms ease; }
.cal-month-cell:hover { background: rgba(250, 204, 21, 0.05); }
.cal-month-event { border: 0; font: inherit; cursor: pointer; text-align: left; }
.cal-month-event:hover { filter: brightness(1.2); }

.cal-chip-event { border: 1px solid color-mix(in srgb, var(--cat-color, #f59e0b) 55%, transparent); font: inherit; cursor: pointer; }
.cal-chip-event:hover { filter: brightness(1.2); }

/* Frame topbar polish */
.frame-calendar-fullscreen {
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.18), transparent 38%),
    radial-gradient(circle at 90% 12%, rgba(250, 204, 21, 0.12), transparent 34%),
    linear-gradient(160deg, #05060a 0%, #0a0d14 50%, #04060a 100%);
}
.frame-cal-topbar {
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.9), rgba(6, 8, 12, 0.65));
  border-bottom: 1px solid rgba(250, 204, 21, 0.18);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}
.frame-cal-nav { gap: 0.4rem; flex-wrap: wrap; }

/* Segmented polish */
.cal-segmented {
  background: linear-gradient(160deg, rgba(20, 16, 8, 0.85), rgba(6, 8, 12, 0.92));
  border-color: rgba(250, 204, 21, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(250, 204, 21, 0.06);
}
.cal-segmented button.is-active {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 50%, #d97706 100%);
  color: #1a0f00;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Search field with icon */
.cal-search-field {
  position: relative;
  display: block;
}
.cal-search-field svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(250, 204, 21, 0.7);
  pointer-events: none;
}
.cal-search-field input {
  padding-left: 2.5rem;
}

/* Icon tile polish */
.cal-icon-tile {
  background: linear-gradient(160deg, rgba(16, 14, 8, 0.8), rgba(6, 8, 12, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cal-icon-tile:hover {
  border-color: rgba(250, 204, 21, 0.6);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.04));
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.2);
}
.cal-icon-tile.is-active {
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.35), rgba(245, 158, 11, 0.25));
  border-color: rgba(250, 204, 21, 0.9);
}

/* Category card polish */
.cal-category-card {
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(20, 24, 34, 0.75), rgba(6, 8, 12, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f7f0df;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}
.cal-category-card:hover {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.2);
}

/* Menu dialog */
.cal-menu-dialog { width: min(42rem, calc(100vw - 1.5rem)); }
.cal-menu-tabs {
  display: flex;
  padding: 0.25rem;
  background: linear-gradient(160deg, rgba(18, 14, 8, 0.9), rgba(6, 8, 12, 0.95));
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 999px;
  width: max-content;
  margin-bottom: 0.3rem;
}
.cal-menu-tabs button {
  border: 0;
  background: transparent;
  color: rgba(247, 240, 223, 0.75);
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 220ms ease;
}
.cal-menu-tabs button:hover { color: #fde68a; }
.cal-menu-tabs button.is-active {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #1a0f00;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}
.cal-menu-panel { display: none; animation: calFade 280ms ease; }
.cal-menu-panel.is-active { display: block; }

/* Dialog polish: black+gold */
.cal-dialog {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 50%),
    linear-gradient(160deg, rgba(16, 20, 28, 0.98), rgba(4, 6, 10, 0.99));
  border: 1px solid rgba(250, 204, 21, 0.25);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(250, 204, 21, 0.08),
    inset 0 1px 0 rgba(250, 204, 21, 0.12);
}
.cal-dialog-body > header h3 {
  background: linear-gradient(135deg, #fde68a, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* Now-line glow */
.cal-now-line {
  background: linear-gradient(90deg, transparent, #ef4444 20%, #f87171 50%, #ef4444 80%, transparent);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

/* Hide old /calendar route styles from showing on frame (safety, no-op if not present) */

/* Weekday today chip extra glow */
.cal-week-head-cell.is-today strong {
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.cal-month-cell.is-today .cal-month-day-number {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Mobile tweaks for frame cal */
@media (max-width: 900px) {
  .frame-cal-topbar { grid-template-columns: 1fr; padding: 0.6rem 0.8rem; gap: 0.5rem; }
  .frame-cal-title { text-align: center; }
  .cal-segmented { justify-self: center; }
  .frame-cal-nav { justify-content: center; }
  .cal-primary-button.cal-icon-only { width: 2.2rem; height: 2.2rem; }
  .cal-round-button { width: 2.2rem; height: 2.2rem; }
  .cal-pill-button { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
  .cal-menu-dialog { width: calc(100vw - 1rem); }
}



/* =========================================================
   FRAME TEXT READABILITY — guarantees legibility on any photo
   ========================================================= */
.frame-copy {
  position: relative;
}
.frame-copy::before {
  content: "";
  position: absolute;
  inset: -1.5rem -2rem -1.5rem -2rem;
  background: radial-gradient(ellipse at 30% 85%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.28) 45%, transparent 75%);
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
  border-radius: 30px;
}
.frame-copy[data-align="center"]::before {
  background: radial-gradient(ellipse at 50% 85%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.28) 45%, transparent 75%);
}
.frame-copy[data-align="right"]::before {
  background: radial-gradient(ellipse at 70% 85%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.28) 45%, transparent 75%);
}
.frame-copy[data-card="solid"]::before { display: none; }
.frame-title,
.frame-subtitle {
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.7),
    0 1px 3px rgba(0, 0, 0, 0.55),
    0 0 2px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}
.frame-slide-meta span {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   ADMIN v2 — matches calendar black+gold language
   ========================================================= */
body.admin-v2 {
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 158, 11, 0.12), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(250, 204, 21, 0.08), transparent 45%),
    linear-gradient(160deg, #05060a 0%, #0a0d14 50%, #04050a 100%);
  color: #f7f0df;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.admin-shell-v2 {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.admin-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(16, 20, 28, 0.95), rgba(5, 7, 12, 0.92));
  border: 1px solid rgba(250, 204, 21, 0.22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(250, 204, 21, 0.08);
  position: sticky;
  top: 0.5rem;
  z-index: 40;
  backdrop-filter: blur(18px);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.admin-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fde68a, #f59e0b, #b45309);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  color: #1a0f00;
}
.admin-brand-mark svg { width: 22px; height: 22px; }
.admin-brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fde68a, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.admin-brand-sub {
  font-size: 0.78rem;
  color: rgba(247, 240, 223, 0.55);
  margin-top: -2px;
}
.admin-tabs {
  display: flex;
  padding: 0.3rem;
  background: linear-gradient(160deg, rgba(12, 16, 24, 0.95), rgba(4, 6, 10, 0.98));
  border: 1px solid rgba(250, 204, 21, 0.18);
  border-radius: 999px;
  gap: 0.25rem;
  justify-self: center;
}
.admin-tab {
  border: 0;
  background: transparent;
  color: rgba(247, 240, 223, 0.72);
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 240ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab:hover { color: #fde68a; }
.admin-tab.is-active {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #1a0f00;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}
.admin-topbar-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.admin-status-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.admin-status-pill.is-live {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.4);
}
.admin-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.06);
  text-decoration: none;
  transition: all 220ms ease;
}
.admin-link-chip:hover {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.5);
}
.admin-link-chip svg { width: 14px; height: 14px; }

.admin-panel { display: none; animation: adminFade 320ms ease; }
.admin-panel.is-active { display: flex; flex-direction: column; gap: 1.25rem; }
@keyframes adminFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-card {
  background: linear-gradient(160deg, rgba(16, 20, 28, 0.92), rgba(5, 7, 12, 0.95));
  border: 1px solid rgba(250, 204, 21, 0.14);
  border-radius: 24px;
  padding: 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(250, 204, 21, 0.06);
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fde68a;
}
.admin-card-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: rgba(247, 240, 223, 0.55);
}

/* Upload layout: preview + form side by side on desktop */
.admin-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.35rem;
}
@media (max-width: 860px) {
  .admin-upload-grid { grid-template-columns: 1fr; }
}

/* Live preview stage — mirrors frame exactly */
.admin-preview-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(250, 204, 21, 0.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(250, 204, 21, 0.05), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.admin-preview-stage .frame-layer {
  position: absolute;
  inset: 0;
  opacity: 1;
}
.admin-preview-stage .frame-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--slide-zoom, 1));
  transform-origin: center;
  transition: transform 320ms ease, filter 320ms ease;
}
.admin-preview-stage .frame-image.is-empty {
  background: linear-gradient(135deg, #1a1d25, #0a0d14);
}
.admin-preview-stage .frame-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,var(--overlay-opacity,0.32)) 72%, rgba(0,0,0,calc(var(--overlay-opacity,0.32) + 0.18)) 100%);
}
.admin-preview-stage .frame-copy {
  position: relative;
  width: 100%;
  padding: 0 0 1.2rem 1.3rem;
  color: #fff;
}
.admin-preview-stage .frame-copy[data-align="center"] { text-align: center; padding-left: 0; padding-right: 0; }
.admin-preview-stage .frame-copy[data-align="right"] { text-align: right; padding-left: 0; padding-right: 1.3rem; }
.admin-preview-stage .frame-copy[data-card="solid"] {
  margin: 0 1rem 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: rgba(12, 16, 24, 0.52);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: auto;
}
.admin-preview-stage .frame-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.05;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,0.75), 0 1px 3px rgba(0,0,0,0.6);
}
.admin-preview-stage .frame-copy[data-size="sm"] .frame-title { font-size: 1.15rem; }
.admin-preview-stage .frame-copy[data-size="lg"] .frame-title { font-size: 1.75rem; }
.admin-preview-stage .frame-subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  opacity: 0.9;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.admin-preview-stage .frame-slide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}
.admin-preview-stage .frame-slide-meta span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.admin-preview-stage .frame-copy::before {
  content: "";
  position: absolute;
  inset: -0.8rem -1rem -0.8rem -1rem;
  background: radial-gradient(ellipse at 30% 85%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 45%, transparent 75%);
  filter: blur(6px);
  z-index: -1;
  pointer-events: none;
}
.admin-preview-stage .frame-copy[data-align="center"]::before {
  background: radial-gradient(ellipse at 50% 85%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 45%, transparent 75%);
}
.admin-preview-stage .frame-copy[data-align="right"]::before {
  background: radial-gradient(ellipse at 70% 85%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 45%, transparent 75%);
}
.admin-preview-stage .frame-copy[data-card="solid"]::before { display: none; }
.admin-preview-stage-label {
  position: absolute;
  top: 0.65rem;
  left: 0.85rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}
.admin-preview-stage-label svg { width: 13px; height: 13px; }

/* Dropzone */
.admin-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.6rem 1.1rem;
  border: 2px dashed rgba(250, 204, 21, 0.35);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.04), rgba(6, 8, 12, 0.6));
  cursor: pointer;
  text-align: center;
  transition: all 240ms ease;
}
.admin-dropzone:hover {
  border-color: rgba(250, 204, 21, 0.65);
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.08), rgba(6, 8, 12, 0.6));
}
.admin-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.admin-dropzone-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  display: grid;
  place-items: center;
  color: #1a0f00;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}
.admin-dropzone-icon svg { width: 22px; height: 22px; }
.admin-dropzone-title { font-size: 1rem; font-weight: 700; color: #fde68a; }
.admin-dropzone-hint { font-size: 0.82rem; color: rgba(247, 240, 223, 0.6); }

/* Form fields — reuse cal-field style */
.admin-form { display: flex; flex-direction: column; gap: 0.85rem; }
.admin-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
@media (max-width: 520px) { .admin-fields-grid { grid-template-columns: 1fr; } }
.admin-field { display: flex; flex-direction: column; gap: 0.35rem; }
.admin-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(247, 240, 223, 0.68);
  letter-spacing: 0.02em;
}
.admin-field input[type="text"],
.admin-field input[type="number"],
.admin-field input[type="color"],
.admin-field textarea,
.admin-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.18);
  background: rgba(6, 8, 12, 0.65);
  color: #f7f0df;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  outline: none;
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12);
}
.admin-field textarea { resize: vertical; min-height: 3rem; font-family: inherit; }
.admin-field input[type="color"] { height: 2.6rem; padding: 0.2rem; cursor: pointer; }

.admin-range-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(250, 204, 21, 0.14);
  border-radius: 12px;
  background: rgba(6, 8, 12, 0.5);
}
.admin-range-field .admin-range-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(247, 240, 223, 0.7);
}
.admin-range-field output {
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.admin-range-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #f59e0b 0%, #f59e0b var(--range-percent, 0%), rgba(250,204,21,0.12) var(--range-percent, 0%), rgba(250,204,21,0.12) 100%);
  outline: none;
}
.admin-range-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 3px 10px rgba(245,158,11,0.5);
  cursor: pointer;
  border: 2px solid #1a0f00;
}
.admin-range-field input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 3px 10px rgba(245,158,11,0.5);
  border: 2px solid #1a0f00;
  cursor: pointer;
}

.admin-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(250, 204, 21, 0.14);
  border-radius: 14px;
  background: rgba(6, 8, 12, 0.5);
  cursor: pointer;
}
.admin-toggle-row input[type="checkbox"] { display: none; }
.admin-toggle-switch {
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(247, 240, 223, 0.15);
  position: relative;
  transition: background 220ms ease;
  margin-top: 2px;
}
.admin-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 220ms ease;
}
.admin-toggle-row input:checked + .admin-toggle-switch {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
}
.admin-toggle-row input:checked + .admin-toggle-switch::after {
  transform: translateX(18px);
}
.admin-toggle-copy { display: flex; flex-direction: column; gap: 0.15rem; }
.admin-toggle-copy strong { font-size: 0.9rem; color: #fde68a; }
.admin-toggle-copy small { font-size: 0.76rem; color: rgba(247, 240, 223, 0.55); }
.admin-toggles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 620px) { .admin-toggles-grid { grid-template-columns: 1fr; } }

/* Primary gold button (shared pattern) */
.admin-primary-btn {
  position: relative;
  border: 0;
  padding: 0.85rem 1.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fde68a, #f59e0b, #b45309);
  color: #1a0f00;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 200ms ease, box-shadow 220ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.admin-primary-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 600ms ease;
}
.admin-primary-btn:hover::before { left: 100%; }
.admin-primary-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(245, 158, 11, 0.55); }
.admin-primary-btn:active { transform: translateY(0); }
.admin-primary-btn svg { width: 16px; height: 16px; }
.admin-primary-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.admin-ghost-btn {
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.06);
  color: #fde68a;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 220ms ease;
}
.admin-ghost-btn:hover { background: rgba(250, 204, 21, 0.14); border-color: rgba(250, 204, 21, 0.5); }
.admin-ghost-btn svg { width: 14px; height: 14px; }
.admin-danger-btn {
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 220ms ease;
}
.admin-danger-btn:hover { background: rgba(239, 68, 68, 0.18); color: #fecaca; }
.admin-danger-btn svg { width: 14px; height: 14px; }

.admin-actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.6rem;
}

.admin-inline-message {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #bbf7d0;
  transition: color 200ms ease;
}
.admin-inline-message.is-error { color: #fca5a5; }

/* Stats chips */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.admin-stat {
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(16, 20, 28, 0.9), rgba(5, 7, 12, 0.95));
  border: 1px solid rgba(250, 204, 21, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.admin-stat-label { font-size: 0.75rem; color: rgba(247, 240, 223, 0.55); letter-spacing: 0.04em; text-transform: uppercase; }
.admin-stat-value { font-size: 1.35rem; font-weight: 700; color: #fde68a; }

/* Gallery */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
}
.admin-gallery-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: rgba(247, 240, 223, 0.55);
  border: 1px dashed rgba(250, 204, 21, 0.2);
  border-radius: 18px;
}
.admin-gallery-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 5;
  background: #0a0d14;
  border: 1px solid rgba(250, 204, 21, 0.14);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
  display: block;
  text-align: left;
  padding: 0;
  color: inherit;
  font-family: inherit;
}
.admin-gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(250, 204, 21, 0.25);
  border-color: rgba(250, 204, 21, 0.35);
}
.admin-gallery-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.admin-gallery-card:hover .admin-gallery-card-img { transform: scale(1.05); }
.admin-gallery-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.7rem 0.85rem;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.3) 55%, rgba(0, 0, 0, 0.8) 100%);
  color: #fff;
}
.admin-gallery-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  margin: 0;
}
.admin-gallery-card-sub {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 0.15rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-gallery-card-badge {
  position: absolute;
  top: 0.55rem; left: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde68a;
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}
.admin-gallery-card-order {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  display: flex;
  gap: 0.3rem;
}
.admin-gallery-mini-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(250, 204, 21, 0.3);
  background: rgba(6, 8, 12, 0.8);
  color: #fde68a;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 200ms ease;
}
.admin-gallery-mini-btn:hover { background: rgba(250, 204, 21, 0.2); }
.admin-gallery-mini-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.admin-gallery-mini-btn svg { width: 14px; height: 14px; }

/* Edit dialog */
.admin-dialog {
  max-width: min(820px, calc(100vw - 1.5rem));
  width: 100%;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  overflow: hidden;
}
.admin-dialog::backdrop {
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(8px);
}
.admin-dialog-body {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 50%),
    linear-gradient(160deg, rgba(16, 20, 28, 0.98), rgba(4, 6, 10, 0.99));
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 26px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.admin-dialog-body::-webkit-scrollbar { display: none; }
.admin-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.95), rgba(6, 8, 12, 0.8));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(250, 204, 21, 0.14);
}
.admin-dialog-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fde68a, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.admin-dialog-close {
  border: 1px solid rgba(250, 204, 21, 0.25);
  background: rgba(6, 8, 12, 0.6);
  color: #fde68a;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
}
.admin-dialog-close svg { width: 16px; height: 16px; }
.admin-dialog-content { padding: 1rem 1.35rem 1.35rem; display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 720px) {
  .admin-topbar { grid-template-columns: 1fr; gap: 0.6rem; padding: 0.75rem; }
  .admin-tabs { justify-self: stretch; justify-content: center; }
  .admin-topbar-actions { justify-content: center; flex-wrap: wrap; }
  .admin-stats-row { grid-template-columns: repeat(3, 1fr); }
  .admin-brand-sub { display: none; }
}

/* =========================================================
   KIOSK DISPLAY SCALING (1024x600) — everything +~200%
   Applied to .frame-shell so /admin stays compact.
   ========================================================= */
.frame-shell { font-size: 20px; }

/* Clock / meta top strip */
.frame-meta {
  top: 1.6rem;
  left: 1.6rem;
  right: 1.6rem;
  font-size: 1.35rem;
  color: rgba(255,255,255,0.88);
  font-weight: 600;
}
.frame-counter {
  font-size: 1.15rem;
  padding: 0.55rem 0.95rem;
}

/* Photo title/subtitle bigger (clamps were tuned for large desktops) */
.frame-shell .frame-title {
  font-size: clamp(3.6rem, 9vw, 7rem);
}
.frame-shell .frame-copy[data-size="sm"] .frame-title {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}
.frame-shell .frame-copy[data-size="lg"] .frame-title {
  font-size: clamp(4.4rem, 11vw, 8.5rem);
}
.frame-shell .frame-subtitle {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  margin-bottom: 1.1rem;
}
.frame-shell .frame-slide-meta span {
  font-size: 1.05rem;
  padding: 0.5rem 0.9rem;
}
.frame-shell .frame-copy { padding: 0 0 4.6rem 4.6rem; }
.frame-shell .frame-copy[data-align="right"] { padding-right: 4.6rem; }

/* Calendar topbar */
.frame-shell .frame-cal-topbar {
  padding: 1.3rem 1.9rem;
  gap: 1.2rem;
}
.frame-shell .cal-eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
}
.frame-shell .frame-cal-title h2 {
  font-size: 2.1rem;
}

/* Segmented tabs (Tag/Woche/Monat) */
.frame-shell .cal-segmented {
  padding: 0.4rem;
  border-radius: 999px;
}
.frame-shell .cal-segmented button {
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 5rem;
}

/* Round + pill buttons in topbar */
.frame-shell .cal-round-button {
  width: 3.3rem;
  height: 3.3rem;
}
.frame-shell .cal-round-button svg { width: 1.6rem; height: 1.6rem; }
.frame-shell .cal-pill-button {
  padding: 0.75rem 1.35rem;
  font-size: 1.05rem;
  border-radius: 999px;
}
.frame-shell .cal-icon-button,
.frame-shell .cal-primary-button {
  width: 3.3rem;
  height: 3.3rem;
}
.frame-shell .cal-icon-button svg,
.frame-shell .cal-primary-button svg { width: 1.6rem; height: 1.6rem; }
/* Day view — hour labels bigger */
.frame-shell .cal-day-grid {
  grid-template-columns: 6rem 1fr;
  padding: 0.4rem 1.6rem 0.4rem 0;
}
.frame-shell .cal-hour-labels { font-size: 1rem; }
.frame-shell .cal-hour-labels span { padding-right: 0.9rem; }

/* Event blocks */
.frame-shell .cal-event-block {
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 1.05rem;
  border-left-width: 5px;
}
.frame-shell .cal-event-block-body small { font-size: 0.88rem; }
.frame-shell .cal-event-block-icon .ff-icon { width: 1.4rem; height: 1.4rem; }

/* Week + month cells */
.frame-shell .cal-week-day-head,
.frame-shell .cal-month-weekday-head {
  font-size: 1rem;
  padding: 0.7rem 0.5rem;
}
.frame-shell .cal-month-day {
  padding: 0.6rem;
  min-height: 5.5rem;
}
.frame-shell .cal-month-day-number { font-size: 1.1rem; font-weight: 600; }
.frame-shell .cal-month-dot { width: 8px; height: 8px; }
.frame-shell .cal-chip-event {
  font-size: 0.95rem;
  padding: 0.3rem 0.55rem;
}

/* Now line pulse dot bigger */
.frame-shell .cal-now-line { height: 3px; }
.frame-shell .cal-now-line span { width: 18px; height: 18px; left: -10px; top: -8px; }

/* Dialogs on kiosk — bigger and easier to tap */
.frame-shell .cal-dialog {
  max-width: min(820px, calc(100vw - 2rem));
  padding: 0;
}
.frame-shell .cal-dialog-body {
  padding: 1.6rem 1.8rem 1.8rem;
}
.frame-shell .cal-dialog-body header h3 { font-size: 1.6rem; }
.frame-shell .cal-dialog-body label > span,
.frame-shell .cal-field > span {
  font-size: 0.95rem;
}
.frame-shell .cal-dialog-body input[type="text"],
.frame-shell .cal-dialog-body input[type="date"],
.frame-shell .cal-dialog-body input[type="time"],
.frame-shell .cal-dialog-body input[type="color"],
.frame-shell .cal-dialog-body textarea,
.frame-shell .cal-dialog-body select,
.frame-shell .cal-field input,
.frame-shell .cal-field textarea,
.frame-shell .cal-field select {
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  border-radius: 14px;
}
.frame-shell .cal-dialog-body button {
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
}
.frame-shell .cal-icon-tile {
  padding: 0.7rem;
}
.frame-shell .cal-icon-tile .ff-icon { width: 2.2rem; height: 2.2rem; }
.frame-shell .cal-menu-tabs button {
  padding: 0.65rem 1.3rem;
  font-size: 1rem;
}

/* Category chips */
.frame-shell .cal-category-card {
  padding: 0.8rem 1rem;
  font-size: 1rem;
}

/* Photo event widget bigger */
.frame-shell .photo-event-widget {
  font-size: 1.1rem;
  padding: 1.1rem 1.3rem;
}
.frame-shell .photo-event-widget header strong { font-size: 1.3rem; }
.frame-shell .photo-event-widget header small { font-size: 0.95rem; }

/* Hour slot +-hint bigger */
.frame-shell .cal-hour-slot::after {
  font-size: 1.4rem !important;
}

/* =========================================================
   FRAME META v2 — readable over ANY photo (white/bright)
   ========================================================= */
.frame-shell .frame-meta {
  top: 1.4rem;
  left: 1.4rem;
  right: 1.4rem;
  align-items: flex-start;
}
.frame-shell .frame-clock {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.75);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(250, 204, 21, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.frame-shell .frame-counter {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.7);
  color: #fff;
  border: 1px solid rgba(250, 204, 21, 0.25);
  font-weight: 600;
  font-size: 1.05rem;
  backdrop-filter: blur(12px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Weather widget */
.frame-weather {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.05rem 0.6rem 0.75rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.78);
  border: 1px solid rgba(250, 204, 21, 0.28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  color: #fff;
}
.frame-weather.hidden { display: none; }
.frame-weather-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-grid;
  place-items: center;
  color: #fde68a;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}
.frame-weather-icon svg { width: 100%; height: 100%; }
.frame-weather-body {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 2px;
}
.frame-weather-body strong {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.frame-weather-body small {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Local sensor widget (DHT22 + CCS811) */
.frame-meta-weather-group {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.frame-sensors {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.frame-sensors.hidden { display: none; }
.frame-sensors.is-stale { opacity: 0.55; }

.frame-sensor {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.25rem;
}
.frame-sensor + .frame-sensor {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 0.6rem;
}

.frame-sensor-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.frame-sensor--temp .frame-sensor-icon { color: #fb923c; filter: drop-shadow(0 0 4px rgba(251,146,60,0.45)); }
.frame-sensor--hum  .frame-sensor-icon { color: #38bdf8; filter: drop-shadow(0 0 4px rgba(56,189,248,0.45)); }

.frame-sensor strong {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* AQI: show exactly one icon based on data-aqi of the parent */
.frame-sensor--aqi .aqi-icon { display: none; }
.frame-sensors[data-aqi="fresh"]   .aqi-icon--fresh { display: inline-block; color: #4ade80; filter: drop-shadow(0 0 5px rgba(74,222,128,0.55)); }
.frame-sensors[data-aqi="stale"]   .aqi-icon--stale { display: inline-block; color: #facc15; filter: drop-shadow(0 0 5px rgba(250,204,21,0.55)); animation: sensor-wave 2.2s ease-in-out infinite; }
.frame-sensors[data-aqi="toxic"]   .aqi-icon--toxic { display: inline-block; color: #f87171; filter: drop-shadow(0 0 6px rgba(248,113,113,0.65)); animation: sensor-pulse 1.4s ease-in-out infinite; }
.frame-sensors[data-aqi="unknown"] .aqi-icon--stale { display: inline-block; color: rgba(255,255,255,0.45); }

.frame-sensors[data-aqi="fresh"] .frame-sensor--aqi strong { color: #86efac; }
.frame-sensors[data-aqi="stale"] .frame-sensor--aqi strong { color: #fde68a; }
.frame-sensors[data-aqi="toxic"] .frame-sensor--aqi strong { color: #fecaca; }

@keyframes sensor-wave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}
@keyframes sensor-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.75; }
}

/* Kiosk (photo view) — match weather widget size */
.frame-stage[data-view="photo"] .frame-sensors,
.frame-shell .frame-stage[data-view="photo"] .frame-sensors {
  padding: 1.2rem 1.8rem;
  gap: 1.1rem;
  border-radius: 999px;
  border-width: 2px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.frame-stage[data-view="photo"] .frame-sensor + .frame-sensor,
.frame-shell .frame-stage[data-view="photo"] .frame-sensor + .frame-sensor {
  padding-left: 1.1rem;
}
.frame-stage[data-view="photo"] .frame-sensor-icon,
.frame-shell .frame-stage[data-view="photo"] .frame-sensor-icon {
  width: 2.8rem;
  height: 2.8rem;
}
.frame-stage[data-view="photo"] .frame-sensor strong,
.frame-shell .frame-stage[data-view="photo"] .frame-sensor strong {
  font-size: 2.4rem;
  line-height: 1;
}
.frame-shell .frame-meta-weather-group { gap: 1rem; }

/* =========================================================
   CALENDAR SEGMENTED (Tag/Woche/Monat) — box 30% smaller
   Text stays, padding shrinks.
   ========================================================= */
.frame-shell .cal-segmented {
  padding: 0.22rem;
}
.frame-shell .cal-segmented button {
  padding: 0.45rem 0.95rem;
  font-size: 1.05rem;
  min-width: 3.6rem;
}

/* =========================================================
   EVENT BLOCKS + PHOTO EVENT PREVIEW — bold, legible
   ========================================================= */
.frame-shell .cal-event-block {
  padding: 0.75rem 1.05rem;
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.2;
  background: color-mix(in srgb, var(--cat-color, #f59e0b) 38%, rgba(10, 12, 18, 0.92));
}
.frame-shell .cal-event-block-body strong {
  font-weight: 800;
  font-size: 1.38rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.frame-shell .cal-event-block-body small {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.frame-shell .cal-event-block-icon .ff-icon {
  width: 1.8rem;
  height: 1.8rem;
}

/* Photo event widget — date/day + events bold */
.frame-shell .photo-event-widget {
  font-size: 1.15rem;
  padding: 1.15rem 1.35rem;
  background: rgba(6, 8, 12, 0.82);
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 22px;
  color: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
}
.frame-shell .photo-event-widget header {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(250, 204, 21, 0.18);
}
.frame-shell .photo-event-widget header strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fde68a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.frame-shell .photo-event-widget header small {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.frame-shell .photo-event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.frame-shell .photo-event-item:last-child { border-bottom: 0; }
.frame-shell .photo-event-item strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  line-height: 1.2;
}
.frame-shell .photo-event-item small {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fde68a;
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}
.frame-shell .photo-event-icon {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cat-color, #f59e0b) 30%, rgba(6, 8, 12, 0.7));
  color: var(--cat-color, #f59e0b);
  border: 1px solid color-mix(in srgb, var(--cat-color, #f59e0b) 50%, transparent);
}
.frame-shell .photo-event-icon .ff-icon { width: 1.4rem; height: 1.4rem; }

/* =========================================================
   PHOTO VIEW — Upcoming-events widget 2× to match clock size
   ========================================================= */
.frame-stage[data-view="photo"] .photo-event-widget {
  padding: 1.55rem 2rem !important;
  border-radius: 26px;
  border-width: 2px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.65);
  max-width: min(575px, calc(100vw - 3rem));
  width: min(575px, calc(100vw - 3rem));
}
.frame-stage[data-view="photo"] .photo-event-widget header {
  gap: 1rem !important;
  margin-bottom: 0.9rem !important;
  padding-bottom: 0.7rem !important;
  padding-right: 4rem !important;
}
.frame-stage[data-view="photo"] .photo-event-widget header strong {
  font-size: 2.4rem !important;
}
.frame-stage[data-view="photo"] .photo-event-widget header small {
  font-size: 1.55rem !important;
}
.frame-stage[data-view="photo"] .photo-event-item {
  gap: 1rem !important;
  padding: 0.72rem 0 !important;
}
.frame-stage[data-view="photo"] .photo-event-item strong {
  font-size: 1.78rem !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame-stage[data-view="photo"] .photo-event-item small {
  font-size: 1.48rem !important;
  margin-top: 3px !important;
  white-space: nowrap;
}
.frame-stage[data-view="photo"] .photo-event-icon {
  width: 3.2rem !important;
  height: 3.2rem !important;
  border-radius: 12px !important;
}
.frame-stage[data-view="photo"] .photo-event-icon .ff-icon {
  width: 2rem !important;
  height: 2rem !important;
}

/* Toggle: hide widget + floating show button */
.photo-event-toggle {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.78);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fde68a;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 140ms ease, background 140ms ease;
  padding: 0;
  z-index: 2;
}
.photo-event-toggle:hover { background: rgba(20, 16, 8, 0.85); transform: scale(1.05); }
.photo-event-toggle svg { width: 1.3rem; height: 1.3rem; display: block; }

.photo-event-show {
  position: absolute;
  right: 1.6rem;
  bottom: 1.6rem;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.8);
  border: 2px solid rgba(250, 204, 21, 0.42);
  color: #fde68a;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  transition: transform 140ms ease, background 140ms ease;
  padding: 0;
  z-index: 6;
}
.photo-event-show.hidden { display: none; }
.photo-event-show:hover { background: rgba(20, 16, 8, 0.9); transform: scale(1.06); }
.photo-event-show svg { width: 2rem; height: 2rem; display: block; }

/* Kiosk: hide button in top-right corner of widget at clock size */
.frame-shell .photo-event-toggle {
  width: 3.4rem;
  height: 3.4rem;
  top: 1rem;
  right: 1rem;
}
.frame-shell .photo-event-toggle svg { width: 1.7rem; height: 1.7rem; }

/* Title truncation: flex child needs min-width:0 */
.photo-event-item .photo-event-body,
.photo-event-item > div {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.photo-event-item strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

/* =========================================================
   BUTTON ICON CENTERING FIX — all round/icon/pill/primary
   Force flex centering so SVG/text sit dead-center.
   ========================================================= */
.cal-round-button,
.cal-icon-button,
.cal-pill-button,
.cal-primary-button,
.cal-ghost-button,
.cal-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}
.cal-round-button { padding: 0 !important; }
.cal-icon-button { padding: 0 !important; }
.cal-primary-button.cal-icon-only { padding: 0 !important; }
.cal-pill-button { padding: 0.5rem 1.1rem; }

/* Kill the legacy column/gap on .cal-icon-button so it centers a single SVG */
.cal-icon-button {
  flex-direction: row !important;
  gap: 0 !important;
}
.cal-icon-button > span { display: none !important; }

/* All SVGs inside action buttons render as centered block */
.cal-round-button svg,
.cal-icon-button svg,
.cal-primary-button svg,
.cal-pill-button svg,
.cal-ghost-button svg,
.cal-danger-button svg {
  display: block;
  flex-shrink: 0;
  margin: 0;
}

/* Segmented tab buttons — keep text centered when shrunk */
.cal-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Frame-kiosk sizes stay consistent with button boxes */
.frame-shell .cal-round-button {
  width: 3.3rem;
  height: 3.3rem;
  padding: 0 !important;
}
.frame-shell .cal-primary-button.cal-icon-only,
.frame-shell .cal-icon-button {
  width: 3.3rem;
  height: 3.3rem;
  padding: 0 !important;
}
.frame-shell .cal-round-button svg,
.frame-shell .cal-icon-button svg,
.frame-shell .cal-primary-button.cal-icon-only svg {
  width: 1.6rem;
  height: 1.6rem;
}
.frame-shell .cal-pill-button {
  padding: 0 1.35rem;
  height: 3.3rem;
}

/* Dialog close "X" (cal-icon-svg) — perfect centering */
.cal-icon-button.cal-icon-svg {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0 !important;
}
.cal-icon-button.cal-icon-svg svg {
  width: 1.1rem;
  height: 1.1rem;
}
.frame-shell .cal-icon-button.cal-icon-svg {
  width: 3rem;
  height: 3rem;
}
.frame-shell .cal-icon-button.cal-icon-svg svg {
  width: 1.4rem;
  height: 1.4rem;
}

/* Admin dialog close button — same fix */
.admin-dialog-close {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}
.admin-dialog-close svg { display: block; }

/* Admin tabs: center SVG + text baseline */
.admin-tab {
  line-height: 1;
}
.admin-tab svg { display: block; }

/* Gallery mini buttons — SVG crisply centered */
.admin-gallery-mini-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}
.admin-gallery-mini-btn svg { display: block; }

/* Admin primary/ghost/danger buttons — ensure icon+label baseline */
.admin-primary-btn,
.admin-ghost-btn,
.admin-danger-btn {
  line-height: 1;
}
.admin-primary-btn svg,
.admin-ghost-btn svg,
.admin-danger-btn svg { display: block; }

/* =========================================================
   FIX: kiosk primary-button was forced square (3.3×3.3) —
   that clipped "Speichern". Scope square sizing to icon-only.
   ========================================================= */
.frame-shell .cal-primary-button {
  width: auto;
  height: auto;
}
.frame-shell .cal-icon-button {
  width: 3.3rem;
  height: 3.3rem;
}

/* =========================================================
   HOUR-SLOT HOVER "+" — perfectly centered, no scale jump
   ========================================================= */
.cal-hour-slot::after {
  content: "+";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 0; /* optical center: "+" char sits slightly high */
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.cal-hour-slot:hover::after { opacity: 1; transform: translateY(-50%); }
.frame-shell .cal-hour-slot::after {
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  right: 12px;
}

/* =========================================================
   EVENT DIALOG — Apple-Calendar grade
   Readable on dark, clear hierarchy, pill buttons with icons.
   ========================================================= */
.cal-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 7rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.cal-action-button svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}
.cal-action-button > span {
  line-height: 1;
  display: inline-block;
}
.cal-action-button:active { transform: translateY(1px); }

/* Primary (Speichern) — gold gradient */
.cal-primary-button.cal-action-button {
  background: linear-gradient(135deg, #f59e0b, #eab308 55%, #facc15);
  color: #0a0d14;
  border: 1px solid rgba(250, 204, 21, 0.8);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.cal-primary-button.cal-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Ghost (Abbrechen) — subtle dark */
.cal-ghost-button.cal-action-button {
  background: rgba(255, 255, 255, 0.06);
  color: #f7f0df;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.cal-ghost-button.cal-action-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(250, 204, 21, 0.3);
}

/* Danger (Löschen) — red */
.cal-danger-button.cal-action-button {
  background: linear-gradient(135deg, #991b1b, #b91c1c);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.55);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.4);
  margin-right: auto; /* push Abbrechen/Speichern to right */
}
.cal-danger-button.cal-action-button:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

/* Dialog footer layout */
.cal-dialog-body footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

/* Inputs — much more legible on dark bg */
.cal-dialog-body .cal-field > span,
.cal-dialog-body label > span:first-child {
  color: rgba(253, 230, 138, 0.85);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
  display: block;
}
.cal-dialog-body input[type="text"],
.cal-dialog-body input[type="date"],
.cal-dialog-body input[type="time"],
.cal-dialog-body input[type="datetime-local"],
.cal-dialog-body input[type="color"],
.cal-dialog-body input[type="search"],
.cal-dialog-body textarea,
.cal-dialog-body select,
.cal-field input,
.cal-field textarea,
.cal-field select {
  width: 100%;
  background: linear-gradient(180deg, rgba(24, 20, 12, 0.75), rgba(14, 12, 8, 0.85));
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  color-scheme: dark;
}
.cal-dialog-body input:focus,
.cal-dialog-body textarea:focus,
.cal-dialog-body select:focus,
.cal-field input:focus,
.cal-field textarea:focus,
.cal-field select:focus {
  outline: none;
  border-color: rgba(250, 204, 21, 0.65);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
  background: linear-gradient(180deg, rgba(30, 24, 14, 0.9), rgba(18, 14, 10, 0.95));
}
.cal-dialog-body input::placeholder,
.cal-dialog-body textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.cal-dialog-body input[type="color"] {
  padding: 4px;
  height: 3rem;
  cursor: pointer;
}

/* Two-column layout gap */
.cal-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

/* Toggle switch (iOS-style) replacing plain checkbox row */
.cal-toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(24, 20, 12, 0.6), rgba(14, 12, 8, 0.7));
  border: 1px solid rgba(250, 204, 21, 0.18);
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
}
.cal-toggle-switch-label {
  font-weight: 600;
  color: #f7f0df;
  font-size: 0.98rem;
}
.cal-toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cal-toggle-switch-track {
  position: relative;
  width: 3.2rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 180ms ease, border-color 180ms ease;
  flex-shrink: 0;
}
.cal-toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cal-toggle-switch input:checked ~ .cal-toggle-switch-track {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  border-color: rgba(250, 204, 21, 0.8);
}
.cal-toggle-switch input:checked ~ .cal-toggle-switch-track .cal-toggle-switch-thumb {
  transform: translateX(1.4rem);
}
.cal-toggle-switch:hover .cal-toggle-switch-track {
  border-color: rgba(250, 204, 21, 0.45);
}

/* Category chips — better contrast on dark */
.cal-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cal-category-chips button,
.cal-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f7f0df;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}
.cal-category-chips button:hover,
.cal-category-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(250, 204, 21, 0.4);
}
.cal-category-chips button.is-active,
.cal-category-chip.is-active,
.cal-category-chips button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chip-color, #f59e0b) 22%, rgba(10, 12, 18, 0.85));
  border-color: var(--chip-color, #f59e0b);
  color: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip-color, #f59e0b) 30%, transparent);
}

/* Icon picker trigger — cleaner */
.cal-icon-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.95rem;
  background: linear-gradient(180deg, rgba(24, 20, 12, 0.6), rgba(14, 12, 8, 0.7));
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 14px;
  color: #f7f0df;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 140ms ease;
}
.cal-icon-picker-trigger:hover {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(180deg, rgba(30, 24, 14, 0.75), rgba(18, 14, 10, 0.85));
}
.cal-icon-picker-preview {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.15);
  display: inline-grid;
  place-items: center;
  color: #fde68a;
  flex-shrink: 0;
}
.cal-icon-picker-preview .ff-icon { width: 1.4rem; height: 1.4rem; }
.cal-icon-picker-trigger small {
  margin-left: auto;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* Dialog header polish */
.cal-dialog-body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(250, 204, 21, 0.14);
}
.cal-dialog-body > header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fef3c7, #facc15 60%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.01em;
}

/* Dialog base background — glassy dark */
.cal-dialog {
  background: linear-gradient(160deg, rgba(14, 12, 8, 0.96), rgba(6, 8, 12, 0.98));
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 22px;
  color: #f7f0df;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
}
.cal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}
.cal-dialog-body {
  padding: 1.4rem 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Hide scrollbar in dialogs while keeping scroll functional */
.cal-dialog::-webkit-scrollbar,
.cal-dialog-body::-webkit-scrollbar,
.cal-dialog *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent;
}
.cal-dialog,
.cal-dialog-body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.cal-dialog *,
.cal-dialog-body * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cal-dialog *::-webkit-scrollbar-thumb,
.cal-dialog *::-webkit-scrollbar-track {
  background: transparent;
}

/* =========================================================
   PHOTO VIEW — 2× large weather widget + clock
   Applies only when photo view is active.
   ========================================================= */
.frame-shell [data-view="photo"] ~ .frame-meta .frame-weather,
.frame-shell [data-view="photo"] .frame-meta .frame-weather,
.frame-shell .frame-stage[data-view="photo"] .frame-weather,
.frame-stage[data-view="photo"] .frame-weather {
  padding: 1.2rem 2.1rem 1.2rem 1.5rem;
  gap: 1.5rem;
  border-radius: 999px;
  border-width: 2px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.frame-shell .frame-stage[data-view="photo"] .frame-weather-icon,
.frame-stage[data-view="photo"] .frame-weather-icon {
  width: 4.4rem;
  height: 4.4rem;
}
.frame-shell .frame-stage[data-view="photo"] .frame-weather-body strong,
.frame-stage[data-view="photo"] .frame-weather-body strong {
  font-size: 2.9rem;
  line-height: 1;
}
.frame-shell .frame-stage[data-view="photo"] .frame-weather-body small,
.frame-stage[data-view="photo"] .frame-weather-body small {
  font-size: 1.76rem;
  margin-top: 0.15rem;
}

.frame-shell .frame-stage[data-view="photo"] .frame-clock,
.frame-stage[data-view="photo"] .frame-clock {
  padding: 1.1rem 2rem;
  font-size: 2.8rem;
  border-radius: 999px;
  border-width: 2px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.frame-shell .frame-stage[data-view="photo"] .frame-counter,
.frame-stage[data-view="photo"] .frame-counter {
  padding: 1rem 1.9rem;
  font-size: 2.1rem;
}

/* Frame-kiosk: bigger tap targets on action buttons */
.frame-shell .cal-action-button {
  min-width: 8.5rem;
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
  border-radius: 999px;
}
.frame-shell .cal-action-button svg {
  width: 1.35rem;
  height: 1.35rem;
}
.frame-shell .cal-toggle-switch {
  padding: 1rem 1.2rem;
}
.frame-shell .cal-toggle-switch-label { font-size: 1.1rem; }
.frame-shell .cal-toggle-switch-track {
  width: 3.6rem;
  height: 2rem;
}
.frame-shell .cal-toggle-switch-thumb {
  width: 1.6rem;
  height: 1.6rem;
}
.frame-shell .cal-toggle-switch input:checked ~ .cal-toggle-switch-track .cal-toggle-switch-thumb {
  transform: translateX(1.6rem);
}
.frame-shell .cal-dialog-body .cal-field > span,
.frame-shell .cal-dialog-body label > span:first-child {
  font-size: 0.82rem;
}
.frame-shell .cal-icon-picker-trigger {
  padding: 0.9rem 1.1rem;
}
.frame-shell .cal-icon-picker-preview {
  width: 2.6rem;
  height: 2.6rem;
}
.frame-shell .cal-icon-picker-preview .ff-icon { width: 1.6rem; height: 1.6rem; }

/* =========================================================
   KIOSK FIT — dialog must fit 1024×600 without being cut off.
   Overrides the earlier oversize kiosk dialog rules.
   ========================================================= */
.frame-shell .cal-dialog {
  max-width: min(760px, calc(100vw - 1.6rem)) !important;
  max-height: calc(100vh - 1rem) !important;
  margin: auto;
}
.frame-shell .cal-dialog-body {
  padding: 0.85rem 1.1rem 1rem !important;
  gap: 0.5rem !important;
  max-height: calc(100vh - 1rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.frame-shell .cal-dialog-body > header {
  margin-bottom: 0.45rem;
  padding-bottom: 0.45rem;
}
.frame-shell .cal-dialog-body > header h3 { font-size: 1.15rem !important; }

.frame-shell .cal-dialog-body .cal-field > span,
.frame-shell .cal-dialog-body label > span:first-child {
  font-size: 0.66rem !important;
  margin-bottom: 0.18rem !important;
}
.frame-shell .cal-dialog-body input[type="text"],
.frame-shell .cal-dialog-body input[type="datetime-local"],
.frame-shell .cal-dialog-body input[type="date"],
.frame-shell .cal-dialog-body input[type="time"],
.frame-shell .cal-dialog-body input[type="color"],
.frame-shell .cal-dialog-body input[type="search"],
.frame-shell .cal-dialog-body textarea,
.frame-shell .cal-dialog-body select,
.frame-shell .cal-field input,
.frame-shell .cal-field textarea,
.frame-shell .cal-field select {
  padding: 0.5rem 0.7rem !important;
  font-size: 0.88rem !important;
  border-radius: 10px !important;
}
.frame-shell .cal-dialog-body textarea { min-height: 2rem; }
.frame-shell .cal-dialog-body input[type="color"] { height: 2.2rem !important; padding: 3px !important; }

.frame-shell .cal-toggle-switch {
  padding: 0.5rem 0.75rem !important;
}
.frame-shell .cal-toggle-switch-label { font-size: 0.88rem !important; }
.frame-shell .cal-toggle-switch-track {
  width: 2.4rem !important;
  height: 1.35rem !important;
}
.frame-shell .cal-toggle-switch-thumb {
  width: 1.05rem !important;
  height: 1.05rem !important;
}
.frame-shell .cal-toggle-switch input:checked ~ .cal-toggle-switch-track .cal-toggle-switch-thumb {
  transform: translateX(1.05rem) !important;
}

.frame-shell .cal-icon-picker-trigger {
  padding: 0.5rem 0.7rem !important;
  gap: 0.55rem;
}
.frame-shell .cal-icon-picker-preview {
  width: 1.8rem !important;
  height: 1.8rem !important;
  border-radius: 8px;
}
.frame-shell .cal-icon-picker-preview .ff-icon { width: 1.1rem !important; height: 1.1rem !important; }
.frame-shell .cal-icon-picker-trigger small { font-size: 0.7rem; }

.frame-shell .cal-category-chips { gap: 0.3rem; }
.frame-shell .cal-category-chips button,
.frame-shell .cal-category-chip {
  padding: 0.32rem 0.65rem !important;
  font-size: 0.78rem !important;
}

.frame-shell .cal-action-button {
  min-width: 5.4rem !important;
  padding: 0.5rem 0.9rem !important;
  font-size: 0.82rem !important;
  gap: 0.35rem !important;
}
.frame-shell .cal-action-button svg {
  width: 0.95rem !important;
  height: 0.95rem !important;
}
.frame-shell .cal-dialog-body > footer,
.frame-shell .cal-dialog-body footer {
  margin-top: 0.45rem !important;
  padding-top: 0.5rem !important;
  gap: 0.4rem !important;
}

.frame-shell .cal-icon-button.cal-icon-svg {
  width: 2.2rem !important;
  height: 2.2rem !important;
}
.frame-shell .cal-icon-button.cal-icon-svg svg {
  width: 1rem !important;
  height: 1rem !important;
}

.frame-shell .cal-two-col { gap: 0.55rem !important; }

/* =========================================================
   CALENDAR TOPBAR — scale 2× to match the enlarged clock.
   Allows wrapping so it fits on 1024px.
   ========================================================= */
.frame-shell .frame-cal-topbar {
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.4rem;
}
.frame-shell .frame-cal-title h2 {
  font-size: 3.2rem !important;
}
.frame-shell .frame-cal-title .cal-eyebrow {
  font-size: 1.1rem !important;
}

/* Segmented Tag/Woche/Monat — 2× */
.frame-shell .cal-segmented {
  padding: 0.55rem !important;
  border-radius: 999px;
}
.frame-shell .cal-segmented button {
  padding: 0.95rem 2rem !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  min-width: 7.5rem !important;
  border-radius: 999px;
}

/* < > round nav + + / menu dots — 2× */
.frame-shell .frame-cal-nav {
  gap: 0.7rem !important;
}
.frame-shell .frame-cal-nav .cal-round-button,
.frame-shell .frame-cal-nav .cal-icon-button,
.frame-shell .frame-cal-nav .cal-primary-button.cal-icon-only {
  width: 5.2rem !important;
  height: 5.2rem !important;
}
.frame-shell .frame-cal-nav .cal-round-button svg,
.frame-shell .frame-cal-nav .cal-icon-button svg,
.frame-shell .frame-cal-nav .cal-primary-button.cal-icon-only svg {
  width: 2.4rem !important;
  height: 2.4rem !important;
}

/* "Heute" pill — 2× */
.frame-shell .frame-cal-nav .cal-pill-button {
  padding: 0 2rem !important;
  height: 5.2rem !important;
  font-size: 1.9rem !important;
  font-weight: 700;
  border-radius: 999px;
}




/* --- All-day banner: sticky in day + week view (P7m) --- */
.cal-allday-row {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.cal-week-sticky-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.cal-week-sticky-head .cal-week-head {
  position: static;
  background: transparent;
  backdrop-filter: none;
}
.cal-week-allday-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0;
  padding: 0.4rem 1rem 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: start;
}
.cal-week-allday-row .cal-allday-label {
  align-self: center;
  text-align: center;
  padding-left: 0.25rem;
}
.cal-week-allday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}
.cal-week-allday-cell {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  padding: 0 0.25rem;
}
.cal-week-allday-cell .cal-chip-event {
  width: 100%;
  justify-content: flex-start;
  font-size: 0.72rem;
  padding: 0.22rem 0.5rem;
}
.cal-week-allday-cell .cal-chip-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Kiosk scaling for the all-day banner */
.frame-shell .cal-allday-row,
.frame-shell .cal-week-allday-row { padding-top: 0.65rem; padding-bottom: 0.75rem; }
.frame-shell .cal-allday-label { font-size: 1rem; letter-spacing: 0.1em; }
.frame-shell .cal-chip-event { font-size: 1rem; padding: 0.38rem 0.85rem; }
.frame-shell .cal-chip-event .ff-icon { width: 1.15rem; height: 1.15rem; }
.frame-shell .cal-week-allday-cell .cal-chip-event { font-size: 0.9rem; padding: 0.3rem 0.6rem; }

/* --- P7n: month-view "+N weitere" badge & day-view all-day label spacing --- */
.cal-month-more {
  align-self: flex-start;
  margin-top: 0.1rem;
  padding: 0.1rem 0.4rem;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 999px;
  color: #facc15;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.cal-month-more:hover { background: rgba(250, 204, 21, 0.22); }
.frame-shell .cal-month-more { font-size: 0.95rem; padding: 0.2rem 0.6rem; }

/* Wider label column in kiosk so "GANZTÄGIG" cannot overlap chips */
.frame-shell .cal-allday-row { grid-template-columns: 8rem 1fr; gap: 1rem; padding: 0.7rem 1rem 0.85rem; align-items: center; }
.frame-shell .cal-week-allday-row { grid-template-columns: 8rem 1fr; gap: 1rem; }
.frame-shell .cal-allday-events { flex-wrap: wrap; gap: 0.55rem; min-width: 0; }

/* --- P7o: Center the photo counter (1/3) between weather (left) and clock (right) --- */
.frame-shell .frame-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
.frame-shell .frame-meta > .frame-weather,
.frame-shell .frame-meta > .frame-meta-weather-group { justify-self: start; grid-column: 1; }
.frame-shell .frame-meta > .frame-counter { justify-self: center; grid-column: 2; }
.frame-shell .frame-meta > .frame-clock   { justify-self: end;    grid-column: 3; }
/* Make sure the clock never accidentally disappears when the weather-group
   wrapper is present. */
.frame-shell .frame-clock:not(.hidden) { display: inline-flex !important; }

/* --- P7p: Safety net so bare SVG paths/circles never render black ---
   SVG default fill is black. For icons whose <path>/<circle>/<rect>
   elements omit both fill and stroke attributes, this forced them to
   paint solid black (Highlight, Liebe, Favorit). Inherit currentColor. */
svg.ff-icon { color: var(--cat-color, #facc15); }
svg.ff-icon path:not([fill]):not([stroke]),
svg.ff-icon circle:not([fill]):not([stroke]),
svg.ff-icon rect:not([fill]):not([stroke]),
svg.ff-icon polygon:not([fill]):not([stroke]),
svg.ff-icon polyline:not([fill]):not([stroke]) {
  fill: currentColor;
}

/* =========================================================
   P7q: Animated weather icons (frame header, top-left)
   ========================================================= */
.wx-svg { width: 100%; height: 100%; overflow: visible; transform-origin: center; }

/* Sun — rotating rays + gentle core pulse */
@keyframes wx-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes wx-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.wx-sun .wx-rays { transform-origin: 12px 12px; transform-box: view-box; animation: wx-rotate 18s linear infinite; }
.wx-sun .wx-sun-core { transform-origin: 12px 12px; transform-box: view-box; animation: wx-pulse 3s ease-in-out infinite; }

/* Partly cloudy — sun rays spin, cloud drifts */
@keyframes wx-cloud-drift { 0%,100% { transform: translateX(0); } 50% { transform: translateX(1.2px); } }
.wx-partly .wx-rays-small { transform-origin: 8px 9px; transform-box: view-box; animation: wx-rotate 22s linear infinite; }
.wx-partly .wx-cloud-drift { transform-origin: 14px 13px; transform-box: view-box; animation: wx-cloud-drift 4.5s ease-in-out infinite; }

/* Cloud — gentle float */
.wx-cloud .wx-cloud-drift { transform-origin: center; transform-box: fill-box; animation: wx-cloud-drift 4s ease-in-out infinite; }

/* Rain — cloud floats, drops fall staggered */
@keyframes wx-drop {
  0%   { transform: translateY(-2.5px); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(3.5px); opacity: 0; }
}
.wx-rain .wx-cloud-drift { transform-origin: center; transform-box: fill-box; animation: wx-cloud-drift 4s ease-in-out infinite; }
.wx-rain .wx-drop { transform-box: fill-box; transform-origin: center; animation: wx-drop 1.3s ease-in infinite; }
.wx-rain .wx-drop-1 { animation-delay: 0s;    }
.wx-rain .wx-drop-2 { animation-delay: 0.35s; }
.wx-rain .wx-drop-3 { animation-delay: 0.7s;  }

/* Snow — flakes drift down with rotation */
@keyframes wx-flake {
  0%   { transform: translateY(-3px) rotate(0deg);    opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(5px)  rotate(120deg);  opacity: 0; }
}
.wx-snow .wx-cloud-drift { transform-origin: center; transform-box: fill-box; animation: wx-cloud-drift 4s ease-in-out infinite; }
.wx-snow .wx-flake { transform-box: fill-box; transform-origin: center; animation: wx-flake 2.6s ease-in-out infinite; }
.wx-snow .wx-flake-1 { animation-delay: 0s;    }
.wx-snow .wx-flake-2 { animation-delay: 0.9s;  }
.wx-snow .wx-flake-3 { animation-delay: 1.7s;  }

/* Storm — cloud jitters, bolt flashes */
@keyframes wx-shake {
  0%,100% { transform: translate(0,0); }
  25%     { transform: translate(-0.6px, 0.4px); }
  50%     { transform: translate(0.6px, -0.3px); }
  75%     { transform: translate(-0.3px, 0.5px); }
}
@keyframes wx-bolt-flash {
  0%, 60%, 100% { opacity: 0.4; filter: drop-shadow(0 0 0 transparent); }
  65%  { opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
  70%  { opacity: 0.5; }
  75%  { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
  80%  { opacity: 0.6; }
}
.wx-storm .wx-storm-cloud { transform-origin: center; transform-box: fill-box; animation: wx-shake 0.7s ease-in-out infinite; }
.wx-storm .wx-bolt        { transform-origin: center; transform-box: fill-box; animation: wx-bolt-flash 3s ease-in-out infinite; }

/* Fog — bars drift side-to-side out of phase */
@keyframes wx-fog-drift {
  0%,100% { transform: translateX(-1.2px); }
  50%     { transform: translateX(1.2px); }
}
.wx-fog .wx-fog-bar { transform-box: fill-box; transform-origin: center; animation: wx-fog-drift 3.6s ease-in-out infinite; }
.wx-fog .wx-fog-1 { animation-delay: 0s;   }
.wx-fog .wx-fog-2 { animation-delay: 0.4s; }
.wx-fog .wx-fog-3 { animation-delay: 0.8s; }
.wx-fog .wx-fog-4 { animation-delay: 1.2s; }

@media (prefers-reduced-motion: reduce) {
  .wx-svg *, .wx-svg { animation: none !important; }
}
