:root {
  --ink: #14212d;
  --muted: #657180;
  --line: #dce2e8;
  --soft: #f5f7fa;
  --paper: #ffffff;
  --paper-soft: #f8fafb;
  --field: #ffffff;
  --primary: #0d766f;
  --primary-dark: #075f59;
  --accent: #e65b4f;
  --gold: #d49a25;
  --blue: #245c8f;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(22, 31, 43, 0.12);
}

html[data-theme="dark"] {
  --ink: #edf4f7;
  --muted: #a9b7c3;
  --line: #334452;
  --soft: #0d1721;
  --paper: #152331;
  --paper-soft: #101b27;
  --field: #0f1b27;
  --primary: #21a79b;
  --primary-dark: #168c83;
  --accent: #f07165;
  --gold: #e0ad45;
  --blue: #7eb8ee;
  --danger: #ff8a80;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  background: linear-gradient(90deg, #112333 0%, #112333 38%, var(--soft) 38%, var(--soft) 100%);
}

.auth-brand {
  color: #fff;
  padding: 56px;
  display: flex;
  gap: 22px;
  align-items: center;
  align-self: stretch;
  flex-wrap: wrap;
}

.brand-logo {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.hero-logo {
  width: min(390px, 45vw);
  max-height: 190px;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.28));
}

.brand-logo.compact {
  width: 236px;
  height: 84px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-brand .eyebrow {
  color: #81d7cf;
}

.auth-brand h1,
.brand h1 {
  margin: 0;
}

.auth-brand h1 {
  font-size: 56px;
  line-height: 1;
}

.auth-copy {
  max-width: 430px;
  color: #d9e5ec;
  font-size: 18px;
  line-height: 1.55;
}

.auth-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: center;
  padding: 42px;
}

.auth-forms.single {
  grid-template-columns: minmax(280px, 460px);
  justify-content: center;
}

.auth-form,
.calendar-panel,
.event-panel,
.stats-panel,
.event-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form {
  padding: 28px;
}

.form-heading h2,
.panel-toolbar h2,
.event-panel-head h2,
.dialog-head h2 {
  margin: 0;
}

.form-heading p {
  margin: 6px 0 22px;
  color: var(--muted);
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 118, 111, 0.15);
}

.button,
.tab,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #fff3d8;
  color: #6b4a00;
  border: 1px solid #e4bd61;
}

.button.ghost {
  background: #eef3f6;
  color: #263543;
}

.button.danger {
  background: #fff0ee;
  color: var(--danger);
  border: 1px solid #f0aaa3;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #eaf0f4;
  color: #263543;
}

html[data-theme="dark"] .button.ghost,
html[data-theme="dark"] .icon-button {
  background: #263747;
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(210px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 24px;
  background: #112333;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand p {
  margin: 3px 0 0;
  color: #c7d4df;
  font-size: 13px;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.tab {
  background: transparent;
  color: #dbe7ef;
}

.tab.is-active {
  background: #fff;
  color: #112333;
}

html[data-theme="dark"] .tab.is-active {
  background: var(--paper);
  color: var(--ink);
}

.user-area {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.theme-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.workspace {
  display: none;
  padding: 24px;
}

.workspace.is-active {
  display: block;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.calendar-panel,
.event-panel,
.stats-panel {
  padding: 20px;
}

.panel-toolbar,
.event-panel-head,
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-picker {
  width: 158px;
  min-height: 42px;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.weekdays span {
  text-align: center;
}

.day-cell {
  min-width: 0;
  aspect-ratio: 1 / 0.9;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  text-align: left;
}

.day-cell:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(13, 118, 111, 0.12);
}

.day-cell.is-muted {
  background: var(--paper-soft);
  color: #83909c;
}

.day-cell.is-selected {
  border: 2px solid var(--accent);
}

.day-cell.has-events .day-number {
  color: var(--primary);
}

.day-number {
  font-weight: 900;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.event-chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px;
  padding: 3px 6px;
  background: #e6f4f1;
  color: #075f59;
  font-size: 11px;
  font-weight: 800;
}

.event-chip.more {
  background: #f8ead1;
  color: #72500a;
}

.event-list,
.rank-list,
.user-vote-list {
  display: grid;
  gap: 14px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.event-card.is-linked {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 91, 79, 0.18), 0 14px 28px rgba(17, 35, 51, 0.12);
}

.visual-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #163043, #0d766f 55%, #e65b4f);
  color: #fff;
  font-size: 54px;
  font-weight: 900;
}

.compact-placeholder {
  height: 142px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.photo-thumb {
  min-width: 0;
  height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #102333;
}

.photo-thumb:hover {
  border-color: var(--primary);
}

.photo-thumb img,
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photo-thumb img {
  background: #102333;
}

.event-body {
  padding: 16px;
}

.event-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.event-title-row h3 {
  margin: 0;
  font-size: 22px;
}

.event-title-row p,
.event-notes,
.participant-line span,
.rank-main p,
.rank-main small,
.user-vote-item p,
.muted {
  color: var(--muted);
}

.event-title-row p {
  margin: 4px 0 0;
}

.vote-count {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3d8;
  color: #6b4a00;
  font-size: 20px;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.detail-grid span {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  overflow-wrap: anywhere;
}

.detail-grid b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #53616f;
  text-transform: uppercase;
}

.tag-row,
.mini-event-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maps-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e6f4f1;
  color: #075f59;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.maps-link:hover {
  background: #d3eee9;
}

.tag-row span {
  border-radius: 999px;
  padding: 6px 10px;
  background: #e9f2fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.event-notes {
  margin: 14px 0;
  line-height: 1.5;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  height: 82px;
  margin: 14px 0;
}

.photo-strip img {
  border-radius: 8px;
}

.participant-line {
  display: grid;
  gap: 5px;
  margin: 14px 0 16px;
}

.card-actions {
  justify-content: flex-start;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #b8c5d0;
  border-radius: 8px;
  padding: 22px;
  background: var(--paper-soft);
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.form-row {
  display: grid;
  gap: 12px;
}

.form-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smtp-test-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}

.check-line input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.form-hint {
  min-height: 20px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rank-item,
.user-vote-item {
  display: grid;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
}

.rank-item {
  grid-template-columns: 38px minmax(0, 1fr) 48px;
}

.rank-number,
.rank-votes,
.user-badge {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.rank-number {
  height: 38px;
  background: #e9f2fb;
  color: var(--blue);
}

.rank-votes {
  min-height: 48px;
  background: #fff3d8;
  color: #6b4a00;
  font-size: 22px;
}

.rank-main p {
  margin: 5px 0 10px;
}

.rank-main small {
  display: block;
  margin-top: 8px;
}

.history-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  overflow: hidden;
}

.history-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.history-details summary::marker {
  color: var(--muted);
}

.history-details summary strong {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
  background: #e9f2fb;
  color: var(--blue);
}

.history-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.link-button,
.mini-event {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  text-align: left;
  font-weight: 900;
}

.mini-event {
  border: 1px solid #b9d9d5;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eff8f6;
  font-size: 12px;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #e7edf2;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.availability-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.availability-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) 34px minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper-soft);
}

.availability-row strong {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 8px;
  background: #fff3d8;
  color: #6b4a00;
}

.availability-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.user-vote-item {
  grid-template-columns: 46px minmax(0, 1fr);
}

.user-vote-item h3,
.user-vote-item p {
  margin: 0;
}

.user-vote-item p {
  margin-top: 3px;
}

.user-badge {
  width: 46px;
  height: 46px;
  background: #e6f4f1;
  color: #075f59;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff3d8;
  color: #6b4a00;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.user-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.user-card-head h3 {
  min-width: 0;
}

.small-icon {
  width: 34px;
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 18px;
}

.user-email {
  color: var(--primary);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mini-event-row {
  margin-top: 10px;
}

.event-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 28px));
  padding: 0;
  border: 0;
}

.small-dialog {
  width: min(520px, calc(100vw - 28px));
}

.options-dialog {
  width: min(680px, calc(100vw - 28px));
}

.options-section {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.options-section h3 {
  margin: 0;
  font-size: 16px;
}

.dialog-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.dialog-note strong {
  color: var(--ink);
}

.event-dialog::backdrop {
  background: rgba(9, 20, 31, 0.58);
}

.event-form {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.wide {
  grid-column: 1 / -1;
}

.activity-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.activity-box legend {
  padding: 0 8px;
}

.activity-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.activity-box input {
  width: auto;
}

.photo-uploader {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.photo-uploader legend {
  padding: 0 8px;
}

.photo-drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 140px;
  border: 2px dashed #b8c5d0;
  border-radius: 8px;
  padding: 18px;
  background: var(--paper-soft);
  color: var(--muted);
  text-align: center;
  outline: none;
}

.photo-drop-zone strong {
  color: var(--ink);
}

.photo-drop-zone.is-dragging,
.photo-drop-zone:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 118, 111, 0.15);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-preview {
  position: relative;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #102333;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 32px;
  width: 32px;
  color: #fff;
  background: rgba(17, 35, 51, 0.78);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.dialog-actions.split {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
}

.lightbox-dialog {
  width: min(1100px, calc(100vw - 24px));
  height: min(860px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #07131f;
  box-shadow: var(--shadow);
}

.lightbox-dialog[open] {
  display: grid;
  place-items: center;
}

.lightbox-dialog::backdrop {
  background: rgba(4, 10, 16, 0.82);
}

.lightbox-dialog img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 13px 16px;
  background: #112333;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

html[data-theme="dark"] .auth-shell {
  background: linear-gradient(90deg, #07131f 0%, #07131f 38%, var(--soft) 38%, var(--soft) 100%);
}

html[data-theme="dark"] .auth-brand,
html[data-theme="dark"] .topbar {
  background: #07131f;
}

html[data-theme="dark"] .event-chip,
html[data-theme="dark"] .maps-link,
html[data-theme="dark"] .user-badge {
  background: #173b3a;
  color: #8fe7df;
}

html[data-theme="dark"] .tag-row span,
html[data-theme="dark"] .rank-number,
html[data-theme="dark"] .history-details summary strong {
  background: #17304a;
  color: #a9d4ff;
}

html[data-theme="dark"] .vote-count,
html[data-theme="dark"] .rank-votes,
html[data-theme="dark"] .availability-row strong,
html[data-theme="dark"] .role-badge {
  background: #4a3412;
  color: #ffd889;
}

html[data-theme="dark"] .button.secondary {
  background: #4a3412;
  color: #ffd889;
  border-color: #8a6722;
}

html[data-theme="dark"] .button.danger {
  background: #4a1d1a;
  color: #ffaaa3;
  border-color: #91443d;
}

@media (max-width: 1050px) {
  .auth-shell {
    grid-template-columns: 1fr;
    background: var(--soft);
  }

  .auth-brand {
    background: #112333;
    padding: 34px;
  }

  .calendar-layout,
  .stats-layout,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .form-row.two {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tabs,
  .user-area {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .auth-forms {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .auth-brand {
    align-items: flex-start;
    padding: 24px;
  }

  .auth-brand h1 {
    font-size: 42px;
  }

  .workspace {
    padding: 14px;
  }

  .calendar-panel,
  .event-panel,
  .stats-panel {
    padding: 14px;
  }

  .panel-toolbar,
  .event-panel-head,
  .dialog-head {
    display: grid;
  }

  .toolbar-actions {
    justify-content: start;
  }

  .month-picker {
    width: 148px;
  }

  .weekdays,
  .calendar-grid {
    gap: 5px;
  }

  .day-cell {
    min-height: 66px;
    padding: 6px;
  }

  .event-chip {
    display: none;
  }

  .day-cell.has-events::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--primary);
    align-self: end;
  }

  .detail-grid,
  .form-grid,
  .activity-box {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .rank-votes {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  .availability-row {
    grid-template-columns: 1fr 34px;
  }

  .availability-row span {
    grid-column: 1 / -1;
  }

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

  .photo-thumb {
    height: 104px;
  }

  .compact-placeholder {
    height: 118px;
  }
}

/* Ottimizzazione barra superiore su smartphone: desktop invariato */
@media (max-width: 720px) {
  .topbar {
    position: static;
    min-height: 0;
    padding: 10px 14px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo.compact {
    width: 82px;
    height: 30px;
  }

  .brand h1 {
    font-size: 22px;
    line-height: 1.05;
  }

  .brand p {
    font-size: 11px;
    line-height: 1.2;
  }

  .tabs {
    gap: 4px;
    padding: 4px;
  }

  .tab,
  .button,
  .icon-button {
    min-height: 34px;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 13px;
  }

  .icon-button {
    width: 34px;
    padding: 0;
  }

  .user-area {
    gap: 6px;
    font-size: 13px;
  }

  .theme-switch {
    min-height: 34px;
    padding: 0 9px;
    gap: 6px;
    font-size: 13px;
  }

  .theme-switch input {
    width: 15px;
    height: 15px;
  }
}
