:root {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #075a9c;
  --accent-2: #117a4f;
  --danger: #b42318;
  --on-accent: #ffffff;
  --link: #075a9c;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-flat: none;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --control-bg: #ffffff;
  --control-border: #cbd5e1;
  --warning-bg: #fff7d6;
  --warning-text: #7a3f00;
  --warning-border: #b76e00;
  --overlay: rgba(15, 23, 42, 0.58);
  --slot-bg: #eef6ff;
  --slot-border: #c8def7;
  --chip-bg: #e8f2ff;
  --chip-text: #0f172a;
  --chip-muted: #475569;
  --fixed-bg: #e7f8ee;
  --fixed-border: #b9e8cb;
  --flex-bg: #edf0ff;
  --flex-border: #cfd7ff;
}

@media (prefers-color-scheme: dark) {
  .theme-system {
    --bg: #0b1220;
    --bg-alt: #111827;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #0b65a6;
    --accent-2: #168a5b;
    --danger: #c2413a;
    --on-accent: #ffffff;
    --link: #8bd5ff;
    --border: #1f2937;
    --surface: #111827;
    --surface-2: #172033;
    --control-bg: #111827;
    --control-border: #2a3850;
    --warning-bg: #392900;
    --warning-text: #ffda7a;
    --warning-border: #7a5200;
    --overlay: rgba(3, 7, 18, 0.72);
    --slot-bg: #172033;
    --slot-border: #26354d;
    --chip-bg: #172033;
    --chip-text: #e2e8f0;
    --chip-muted: #94a3b8;
    --fixed-bg: #14301f;
    --fixed-border: #24663e;
    --flex-bg: #191f3a;
    --flex-border: #334083;
  }
}

.theme-dark {
  --bg: #0b1220;
  --bg-alt: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #0b65a6;
  --accent-2: #168a5b;
  --danger: #c2413a;
  --on-accent: #ffffff;
  --link: #8bd5ff;
  --border: #1f2937;
  --control-bg: #111827;
  --control-border: #2a3850;
  --warning-bg: #392900;
  --warning-text: #ffda7a;
  --warning-border: #7a5200;
  --overlay: rgba(3, 7, 18, 0.72);
  --slot-bg: #172033;
  --slot-border: #26354d;
  --chip-bg: #172033;
  --chip-text: #e2e8f0;
  --chip-muted: #94a3b8;
  --fixed-bg: #14301f;
  --fixed-border: #24663e;
  --flex-bg: #191f3a;
  --flex-border: #334083;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }

.btn {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-height: 44px;
}
.btn-ghost { background: transparent; color: var(--link); border: 1px solid var(--border); }

.landing { max-width: 960px; margin: 0 auto; padding: 60px 20px; }
.landing-hero { text-align: center; padding: 60px 20px; background: var(--surface); border-radius: 8px; box-shadow: none; border: 1px solid var(--border); }
.landing-features { margin-top: 30px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
.feature { background: var(--surface); padding: 18px; border-radius: 8px; border: 1px solid var(--border); }

.auth-page { display: flex; align-items: flex-start; justify-content: center; min-height: 100vh; padding: 20px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 520px; background: var(--surface); padding: 30px; border-radius: 8px; box-shadow: none; border: 1px solid var(--border); margin: 10px 0 40px; }
.auth-card label { display: block; margin-bottom: 12px; }
.auth-card input, .auth-card textarea, .auth-card select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--control-border); }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 10px; }
.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
}
.error { color: var(--danger); }
.success { color: var(--accent-2); }

.app-shell { display: flex; gap: 10px; min-height: 100vh; align-items: stretch; }
.sidebar { background: var(--bg-alt); border-right: 1px solid var(--border); padding: 20px; width: 220px; flex: 0 0 220px; position: sticky; top: 0; align-self: flex-start; height: 100vh; }
.right-wrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.view.hidden { display: none !important; }
.logo { font-weight: 700; margin-bottom: 20px; }
.nav .nav-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; background: transparent; border: none; color: var(--text); cursor: pointer; min-height: 44px; }
.nav .nav-item.active { background: var(--accent); color: var(--on-accent); }

.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); background: var(--bg-alt); position: sticky; top: 0; z-index: 10; }
.calendar-controls { display: flex; gap: 10px; align-items: center; }
.view-toggle button { margin-right: 6px; }

.content { padding: 16px; position: relative; z-index: 1; flex: 1; min-width: 0; }
.view { background: transparent; color: var(--text); padding: 0; border-radius: 0; border: 0; min-height: 60vh; display: block; visibility: visible; opacity: 1; }
.hidden { display: none !important; }
.flex-only { display: none; }

.entry-list { display: grid; gap: 10px; }
.entry-card { padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.entry-title { font-weight: 700; color: var(--text); }
.entry-meta { color: var(--muted); font-size: 12px; }
.entry-actions button { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; min-height: 38px; }
.entry-card.conflict { outline: 2px dashed var(--danger); }
.entry-actions button { margin-right: 6px; }

.flex-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.flex-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  margin: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-flat);
  user-select: none;
  touch-action: pan-y;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.flex-item:active { cursor: pointer; }
.flex-item.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  transform: scale(1.005);
}

.flex-list.is-reordering {
  cursor: grabbing;
}

.day-slots { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 12px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.day-header { font-weight: 700; padding: 6px 2px; color: var(--text); }
.day-slot { background: var(--slot-bg); padding: 8px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--slot-border); }
.time-label { color: var(--text); font-weight: 600; }
.day-header .now-btn { margin-left: 8px; font-size: 12px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); min-height: 38px; }
.slot-entry { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--chip-bg); color: var(--chip-text); font-weight: 600; border: 1px solid var(--slot-border); }
.slot-entry.fixed { background: var(--fixed-bg); border-color: var(--fixed-border); }
.slot-entry.flex { background: var(--flex-bg); border-color: var(--flex-border); }

.settings-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); }
.card { padding: 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* Forms readability */
form { display: grid; gap: 10px; }
label { display: grid; gap: 6px; color: var(--text); font-size: 14px; font-weight: 600; }
input, select, textarea, button { font-size: 14px; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  min-height: 44px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }

.remember-me,
.auth-card .remember-me {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--text);
  cursor: pointer;
}

.remember-me input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--accent);
}

.settings-grid { align-items: start; }
.settings-grid .card h3 { margin: 0 0 8px; color: var(--text); font-weight: 700; }
.settings-grid .btn { justify-self: start; }

.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-weight: 600;
}

.modal { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9999; }
.modal.hidden { display: none; }
.modal-content { background: var(--surface); padding: 20px; border-radius: 8px; width: 100%; max-width: 420px; color: var(--text); }

.bottom-tabs { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-alt); border-top: 1px solid var(--border); padding: 8px; gap: 6px; z-index: 1000; }
.bottom-tabs .tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  background: var(--surface-2);
  color: var(--text);
}
.bottom-tabs .tab.active { background: var(--accent); color: var(--on-accent); }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .bottom-tabs { display: flex; }
  .content { padding-bottom: 70px; }
}

/* Production polish pass */
.theme-light {
  --bg: #f4f6f8;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --accent: #075a9c;
  --accent-2: #117a4f;
  --danger: #b42318;
  --on-accent: #ffffff;
  --link: #075a9c;
  --border: #d7dde6;
  --shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  --control-bg: #ffffff;
  --control-border: #cbd5e1;
  --warning-bg: #fff7d6;
  --warning-text: #7a3f00;
  --warning-border: #b76e00;
  --overlay: rgba(15, 23, 42, 0.58);
  --slot-bg: #eef6ff;
  --slot-border: #c8def7;
  --chip-bg: #e8f2ff;
  --chip-text: #0f172a;
  --chip-muted: #475569;
  --fixed-bg: #e7f8ee;
  --fixed-border: #b9e8cb;
  --flex-bg: #edf0ff;
  --flex-border: #cfd7ff;
}

.theme-dark {
  --surface: #111827;
  --surface-2: #172033;
  --accent: #0b65a6;
  --accent-2: #168a5b;
  --danger: #c2413a;
  --on-accent: #ffffff;
  --link: #8bd5ff;
  --control-bg: #111827;
  --control-border: #2a3850;
  --warning-bg: #392900;
  --warning-text: #ffda7a;
  --warning-border: #7a5200;
  --overlay: rgba(3, 7, 18, 0.72);
  --slot-bg: #172033;
  --slot-border: #26354d;
  --chip-bg: #172033;
  --chip-text: #e2e8f0;
  --chip-muted: #94a3b8;
  --fixed-bg: #14301f;
  --fixed-border: #24663e;
  --flex-bg: #191f3a;
  --flex-border: #334083;
}

body {
  background: var(--bg);
  letter-spacing: 0;
}

.app-shell {
  gap: 0;
  background: var(--bg);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.logo {
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
}

.nav .nav-item,
.bottom-tabs .tab,
.view-toggle button,
.entry-actions button,
.day-header .now-btn {
  border-radius: 8px;
}

.nav .nav-item {
  font-weight: 650;
}

.topbar {
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
  box-shadow: 0 1px 0 var(--border);
}

.calendar-controls select,
.view-toggle button,
.topbar .btn {
  min-height: 40px;
}

.view-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.view-toggle button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.content {
  padding: 18px;
  min-width: 0;
}

.view {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.entry-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.entry-card,
.card,
.feature,
.auth-card,
.modal-content {
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: none;
}

.entry-card {
  border-left: 5px solid var(--accent);
}

.entry-title,
.settings-grid .card h3,
label,
.time-label {
  color: var(--text);
}

.entry-meta {
  color: var(--muted);
}

.entry-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.entry-actions button {
  margin: 0;
  cursor: pointer;
}

.btn,
.bottom-tabs .tab.active,
.nav .nav-item.active {
  background: var(--accent);
  color: var(--on-accent);
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-danger {
  background: var(--danger);
}

.btn-ghost {
  background: var(--surface);
  color: var(--link);
  border-color: var(--border);
  box-shadow: none;
}

.icon-btn {
  width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

input,
select,
textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  border-radius: 8px;
  min-width: 0;
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.settings-grid .card,
.settings-grid form,
.settings-grid label {
  min-width: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.availability-day {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.availability-day:last-child {
  border-bottom: 0;
}

.availability-day .day-label {
  padding-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.availability-day > button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--link);
  font-weight: 800;
  cursor: pointer;
}

.day-windows {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.window-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.settings-grid label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.settings-grid input[type="checkbox"] {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  margin: 0;
  accent-color: var(--accent);
}

.password-field {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.password-field input {
  min-width: 0;
}

.password-toggle {
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--link);
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

.auth-help {
  color: var(--muted);
  line-height: 1.5;
}

.auth-success {
  display: grid;
  gap: 12px;
}

.auth-success h2 {
  margin: 0;
}

.auth-primary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  width: 100%;
}

.entry-detail-content {
  max-width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding-top: 46px;
}

.entry-detail-content .entry-edit-actions,
.entry-create-content .entry-create-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  display: grid;
  align-items: stretch;
  gap: 10px;
  margin: 16px -18px -18px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 18px 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, transparent), var(--panel) 28%),
    color-mix(in srgb, var(--panel) 96%, var(--accent) 4%);
  box-shadow: 0 -12px 28px color-mix(in srgb, var(--bg) 44%, transparent);
  backdrop-filter: blur(14px);
}

.entry-detail-content .entry-edit-actions {
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr);
}

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

.entry-detail-content .entry-edit-actions .btn,
.entry-create-content .entry-create-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  justify-content: center;
}

.entry-delete-icon {
  width: 52px !important;
  padding-inline: 0;
}

.modal-close-icon {
  position: sticky;
  top: 0;
  left: 100%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -34px 0 -4px auto;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--link);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.modal-close-icon:hover,
.modal-close-icon:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  outline: none;
}

#entry-error,
.entry-edit-message {
  margin: 10px 0 0;
  min-height: 0;
}

#entry-error:not(:empty),
.entry-edit-message.is-visible:not(:empty) {
  display: block;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--hairline));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

#entry-error.error:not(:empty),
.entry-edit-message.error.is-visible:not(:empty) {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--hairline));
  background: color-mix(in srgb, var(--panel) 84%, var(--danger) 16%);
  color: var(--danger);
}

.entry-edit-message.success.is-visible:not(:empty) {
  border-color: color-mix(in srgb, var(--ok) 36%, var(--hairline));
  background: color-mix(in srgb, var(--panel) 88%, var(--ok) 12%);
  color: var(--ok);
}

.inline-progress-status {
  display: grid !important;
  gap: 8px;
}

.inline-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-progress-head strong,
.inline-progress-head span {
  color: var(--text);
}

.inline-progress-head span {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
}

.inline-progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.inline-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.inline-progress-status p,
.inline-progress-status small {
  margin: 0;
  line-height: 1.35;
}

.inline-progress-status small {
  color: var(--muted);
  font-weight: 750;
}

.entry-create-content {
  max-width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
}

.entry-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.entry-detail-header h3 {
  margin: 0;
  font-size: 24px;
}

.entry-detail-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.entry-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.entry-detail-summary span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}

.entry-detail-summary strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

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

.entry-detail-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.reminders-form {
  display: grid;
  gap: 10px;
}

.reminders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reminders-head h4 {
  margin: 0;
}

.reminders-copy {
  margin: 4px 0 0;
  color: var(--muted);
  max-width: 56ch;
}

.reminder-empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
}

.reminder-empty-state.hidden {
  display: none;
}

.reminder-empty-state i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent);
}

.reminder-empty-state strong,
.reminder-empty-state p {
  display: block;
}

.reminder-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminders-save-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.reminder-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--panel);
}

.reminder-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.reminder-row-actions {
  display: grid;
  gap: 8px;
}

.reminder-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.reminder-row-copy {
  display: grid;
  gap: 5px;
}

.reminder-row-copy strong {
  font-size: 15px;
}

.reminder-row-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.reminder-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reminder-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reminder-pill.alarm {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 36%, var(--hairline) 64%);
  background: color-mix(in srgb, var(--danger) 12%, var(--panel) 88%);
}

.reminder-pill.notification {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--hairline) 72%);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel) 90%);
}

.reminder-pill.email {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 28%, var(--hairline) 72%);
  background: color-mix(in srgb, var(--ok) 10%, var(--panel) 90%);
}

.reminder-row button,
.plain-list button,
.reminder-compose button,
.reminders-head button {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--link);
  font-weight: 700;
  cursor: pointer;
}

.reminder-compose {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 93%, var(--accent) 7%);
}

.reminder-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reminder-compose-head .reminder-compose-cancel {
  width: auto !important;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.reminder-compose-head h5 {
  margin: 0;
  font-size: 16px;
}

.reminder-kind-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reminder-kind-picker button {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px 10px;
  text-align: left;
  background: var(--panel);
  color: var(--text);
}

.reminder-kind-picker button span {
  font-weight: 800;
}

.reminder-kind-picker button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reminder-kind-picker button.active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border) 56%);
  background: color-mix(in srgb, var(--panel) 80%, var(--accent) 20%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.reminder-offset-builder {
  display: grid;
  gap: 10px;
}

.reminder-offset-head {
  display: grid;
  gap: 4px;
}

.reminder-offset-head small {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 850;
}

.reminder-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reminder-presets button {
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

.reminder-presets button.active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border) 56%);
  background: color-mix(in srgb, var(--panel) 76%, var(--accent) 24%);
  color: var(--accent);
}

.reminder-custom-offset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reminder-custom-offset.hidden {
  display: none;
}

.reminder-custom-offset label {
  display: grid;
  gap: 6px;
}

.reminder-custom-offset label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reminder-delivery-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--panel);
}

.reminder-delivery-note i {
  color: var(--accent);
  margin-top: 2px;
}

.reminder-mode-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.reminder-compose-actions {
  display: grid;
}

.reminder-compose-actions .btn {
  width: 100%;
}

.repeat-builder {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.repeat-builder-head,
.repeat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.repeat-builder-head > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
}

.repeat-state,
.repeat-frequency,
.repeat-end {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.repeat-state button,
.repeat-frequency button,
.repeat-end button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.repeat-state button.active,
.repeat-frequency button.active,
.repeat-end button.active {
  background: var(--accent);
  color: var(--on-accent);
}

.repeat-panel {
  display: grid;
  gap: 10px;
}

.repeat-row label,
.repeat-end-field label,
.repeat-first-due {
  margin: 0;
}

.repeat-row label {
  display: grid;
  gap: 5px;
}

.repeat-row input,
.repeat-end-field input,
.repeat-first-due input {
  min-height: 38px;
}

.repeat-end {
  grid-auto-flow: unset;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.repeat-end button {
  white-space: normal;
}

.repeat-summary {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.repeat-scope-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.repeat-scope-card h4,
.repeat-scope-card p {
  margin: 0;
}

.repeat-scope-card h4 {
  font-size: 13px;
  color: var(--text);
}

.repeat-scope-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.repeat-scope-actions,
.repeat-delete-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.repeat-scope-actions button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.repeat-scope-actions button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.repeat-delete-content {
  display: grid;
  gap: 12px;
  max-width: min(460px, calc(100vw - 32px));
}

.repeat-delete-content h3,
.repeat-delete-content p {
  margin: 0;
}

.repeat-delete-content p {
  color: var(--muted);
  line-height: 1.45;
}

.repeat-delete-actions .btn {
  justify-content: center;
  min-height: 46px;
  gap: 12px;
}

.slot-entry {
  cursor: pointer;
}

.plain-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
  overflow-wrap: anywhere;
}

#mail-queue-list,
#unavailability-list {
  min-width: 0;
  overflow-wrap: anywhere;
}

#mail-queue-list li,
#unavailability-list li {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.day-slots {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.day-slot {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  min-height: 44px;
}

.slot-entry {
  border-radius: 6px;
}

.warning {
  border-radius: 8px;
}

.landing {
  max-width: 1120px;
}

.landing-hero {
  text-align: left;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(22,119,200,0.10), rgba(22,138,91,0.08)),
    var(--surface);
}

.landing-hero h1 {
  font-size: clamp(38px, 6vw, 72px);
  margin: 0 0 12px;
}

.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .entry-detail-header,
  .entry-detail-grid {
    grid-template-columns: 1fr;
  }

  .entry-detail-header {
    display: grid;
  }

  .detail-close {
    width: auto;
    justify-self: start;
  }

  .reminders-head,
  .reminder-compose-head,
  .reminder-row-main,
  .reminder-custom-offset,
  .reminder-kind-picker {
    grid-template-columns: 1fr;
    display: grid;
  }

  .reminders-head .btn,
  .reminder-compose-actions .btn {
    width: 100%;
  }

  .reminder-compose-head .reminder-compose-cancel {
    justify-self: start;
  }

  .entry-detail-content .modal-actions,
  .entry-create-content .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .entry-detail-content .modal-actions .btn,
  .entry-create-content .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

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

  .topbar {
    position: static;
  }

  .topbar,
  .calendar-controls {
    align-items: stretch;
  }

  .calendar-controls,
  .view-toggle {
    width: 100%;
  }

  .calendar-controls select {
    flex: 1;
    min-width: 0;
  }

  .view-toggle button {
    flex: 1;
  }

  .topbar .icon-btn {
    width: 100%;
    min-height: 44px;
  }

  .bottom-tabs {
    gap: 4px;
    padding: 6px;
  }

  .bottom-tabs .tab {
    padding: 6px 2px;
    font-size: 12px;
  }

  .content {
    padding: 12px 12px 96px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .availability-day {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .availability-day .day-label {
    padding-top: 0;
  }

  .availability-day > button {
    width: 100%;
  }

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

  .day-slots {
    padding-bottom: 84px;
  }
}

.calendar-board {
  display: grid;
  gap: 10px;
}

.week-board {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.week-column,
.month-cell,
.year-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.week-column {
  min-height: 520px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.week-column header,
.year-month header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.week-column header i,
.year-month header i {
  color: var(--muted);
  font-size: 11px;
}

.week-column header span,
.year-month header span {
  color: var(--muted);
  font-size: 12px;
}

.month-board {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.month-heading {
  color: var(--muted);
  font-weight: 800;
  padding: 0 6px;
  font-size: 12px;
}

.month-cell {
  min-height: 126px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 5px;
  cursor: pointer;
}

.month-cell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.month-cell header em {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  font-size: 10px;
  font-style: normal;
}

.month-cell header em:empty {
  display: none;
}

.muted-cell {
  opacity: 0.48;
}

.year-board {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.year-month {
  min-height: 180px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 6px;
  cursor: pointer;
}

.week-column:hover,
.month-cell:hover,
.year-month:hover,
.week-column:focus-visible,
.month-cell:focus-visible,
.year-month:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--hairline));
  background: color-mix(in srgb, var(--panel) 90%, var(--accent) 10%);
  outline: none;
}

.week-column.is-today,
.month-cell.is-today,
.year-month.is-this-month {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--hairline));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.week-column.is-active-day,
.month-cell.is-active-day,
.year-month.is-active-month {
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
}

.cal-chip {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  border: 1px solid var(--slot-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  min-height: 38px;
  line-height: 1.25;
  min-width: 0;
}

.view-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.view-summary span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
}

.view-summary strong,
.view-summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-summary strong {
  font-size: 14px;
  font-weight: 900;
}

.view-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-insight {
  margin-bottom: 10px;
}

.entry-mode-tiles,
.quick-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.entry-mode-tiles button,
.quick-presets button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.entry-mode-tiles button {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 82px;
  padding: 12px;
  text-align: left;
}

.entry-mode-tiles button span {
  font-size: 16px;
  line-height: 1.1;
}

.entry-mode-tiles button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.entry-mode-tiles button i {
  color: var(--muted);
  font-size: 18px;
}

.quick-presets button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-presets button i {
  color: var(--muted);
}

.entry-mode-tiles button:hover,
.entry-mode-tiles button.active,
.quick-presets button:hover,
.quick-presets button.active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.entry-mode-tiles button.active i,
.quick-presets button.active i {
  color: var(--accent);
}

.entry-mode-tiles button.active small {
  color: var(--text);
}

@media (max-width: 560px) {
  .entry-mode-tiles {
    grid-template-columns: 1fr;
  }
}

.actionable-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 14px;
}

.actionable-empty strong {
  color: var(--text);
}

.actionable-empty span {
  color: var(--muted);
  font-weight: 750;
}

.actionable-empty .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.native-app-card {
  display: grid;
  gap: 12px;
}

.native-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 7px;
}

.native-status-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
}

.native-status-grid strong,
.native-status-grid small,
.native-origin span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-status-grid strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.native-status-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.native-origin {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--muted);
  font-weight: 800;
}

.native-origin i {
  color: var(--accent);
}

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

.native-action-grid .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
}

.native-action-grid .btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-action-grid .btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--hairline));
}

.native-action-grid .btn.is-busy {
  opacity: 0.72;
  cursor: wait;
}

.native-alert-settings {
  display: grid;
  gap: 10px;
  margin: 4px 0;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, var(--accent) 4%);
}

.native-alert-settings h4 {
  margin: 0;
  color: var(--text);
}

.cal-chip.flex {
  background: var(--flex-bg);
  border-color: var(--flex-border);
}

.cal-chip.fixed {
  background: var(--fixed-bg);
  border-color: var(--fixed-border);
}

.cal-chip strong,
.cal-chip span,
.cal-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip em {
  color: var(--chip-muted);
  font-style: normal;
  font-size: 11px;
}

.cal-chip.conflict {
  outline: 2px dashed var(--danger);
}

.empty-state,
.more-count {
  color: var(--muted);
  font-size: 12px;
}

#agenda-list {
  display: grid;
  gap: 8px;
  max-width: 920px;
}

.agenda-date {
  margin: 16px 0 4px;
  color: var(--text);
}

.agenda-item {
  width: 100%;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4px 14px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  cursor: pointer;
}

.agenda-item.fixed {
  border-left-color: var(--accent-2);
}

.agenda-item span {
  color: var(--muted);
  font-weight: 800;
  grid-row: span 2;
}

.agenda-item strong {
  overflow-wrap: anywhere;
}

.agenda-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

@media (max-width: 640px) {
  .agenda-item {
    grid-template-columns: 1fr;
  }

  .agenda-item span {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .week-board,
  .month-board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .week-column {
    min-height: 360px;
  }

  .month-heading {
    display: none;
  }

  .month-cell {
    min-height: 82px;
  }
}

/* Native app polish pass */
:root,
.theme-light {
  --app-bg: #eef2f6;
  --chrome: #ffffff;
  --chrome-2: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --hairline: #d8e0ea;
  --control-ring: rgba(7, 90, 156, 0.22);
  --soft-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.theme-dark {
  --app-bg: #080d16;
  --chrome: #0f1724;
  --chrome-2: #151f30;
  --panel: #111a29;
  --panel-2: #162235;
  --hairline: #253247;
  --control-ring: rgba(139, 213, 255, 0.2);
  --soft-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

@media (prefers-color-scheme: dark) {
  .theme-system {
    --app-bg: #080d16;
    --chrome: #0f1724;
    --chrome-2: #151f30;
    --panel: #111a29;
    --panel-2: #162235;
    --hairline: #253247;
    --control-ring: rgba(139, 213, 255, 0.2);
    --soft-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  }
}

body {
  background: var(--app-bg);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

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

button,
.btn,
.nav-item,
.tab,
.cal-chip,
.agenda-item,
.entry-card,
.flex-item {
  -webkit-tap-highlight-color: transparent;
}

button.tap-confirmed,
.btn.tap-confirmed {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.04);
}

button.is-action-busy,
.btn.is-action-busy {
  position: relative;
  opacity: 0.96;
  cursor: progress;
  pointer-events: none;
}

.btn:disabled,
.btn.is-action-busy {
  color: var(--on-accent);
  -webkit-text-fill-color: var(--on-accent);
}

.btn.btn-ghost:disabled,
.btn.btn-ghost.is-action-busy {
  color: var(--link);
  -webkit-text-fill-color: var(--link);
}

button.is-action-busy::after,
.btn.is-action-busy::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: app-button-spin 0.75s linear infinite;
  vertical-align: -2px;
}

@keyframes app-button-spin {
  to { transform: rotate(360deg); }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.cal-chip:focus-visible,
.agenda-item:focus-visible {
  outline: 3px solid var(--control-ring);
  outline-offset: 2px;
}

.app-shell {
  background: var(--app-bg);
}

.sidebar {
  width: 236px;
  flex-basis: 236px;
  padding: 16px 12px;
  background: var(--chrome);
}

.sidebar .logo {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0 4px 18px;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--on-accent);
  font-weight: 850;
  font-size: 13px;
  box-shadow: none;
}

.logo-mark img,
.app-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav .nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 700;
}

.nav .nav-icon,
.bottom-tabs .nav-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 850;
}

.logo-mark .fa-solid {
  font-size: 15px;
}

.nav .nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav .nav-item.active {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--text);
}

.nav .nav-item.active .nav-icon,
.bottom-tabs .tab.active .nav-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.nav .nav-item.active::after {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 8px;
  background: var(--accent);
}

.right-wrap {
  background: var(--app-bg);
}

.topbar {
  gap: 10px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--chrome) 92%, var(--accent) 8%);
  border-bottom-color: var(--hairline);
  backdrop-filter: blur(14px);
}

.calendar-controls {
  min-width: min(360px, 100%);
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
}

.calendar-controls select {
  min-width: 230px;
  min-height: 36px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  font-weight: 650;
}

.combined-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.combined-toggle input {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  accent-color: var(--accent);
}

.view-toggle {
  gap: 0;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  flex-wrap: nowrap;
}

.view-toggle button {
  min-height: 34px;
  padding: 0 13px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.view-toggle button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.view-toggle button.active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 14px rgba(7, 90, 156, 0.18);
}

.topbar .icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(7, 90, 156, 0.18);
}

.content {
  padding: 18px;
  overflow: hidden;
}

.content::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: translateX(-32%);
  pointer-events: none;
}

body[data-entries-loading="1"] .content::before {
  opacity: 0.85;
  animation: app-loading-bar 0.9s ease-in-out infinite;
}

@keyframes app-loading-bar {
  0% { transform: translateX(-42%); }
  100% { transform: translateX(42%); }
}

.view > h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
}

.entry-card,
.card,
.modal-content,
.week-column,
.month-cell,
.year-month,
.day-slots,
.agenda-item,
.flex-item {
  background: var(--panel);
  border-color: var(--hairline);
  box-shadow: none;
}

.card {
  padding: 16px;
}

.card h3 {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 12px;
  font-size: 16px;
}

form {
  gap: 9px;
}

label {
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 40px;
  padding: 8px 10px;
  background: var(--panel-2);
  border-color: var(--hairline);
}

textarea {
  line-height: 1.45;
}

.btn {
  min-height: 40px;
  padding: 8px 14px;
  box-shadow: none;
}

.btn:has(i),
.plain-list button:has(i),
#mail-queue-list button:has(i),
#unavailability-list button:has(i) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn i,
.plain-list button i,
#mail-queue-list button i,
#unavailability-list button i {
  flex: 0 0 auto;
}

.btn:hover,
.entry-actions button:hover,
.password-toggle:hover,
.reminder-row button:hover,
.plain-list button:hover,
.reminder-compose button:hover,
.reminders-head button:hover {
  filter: brightness(1.05);
}

.btn-ghost,
.entry-actions button,
.password-toggle,
.reminder-row button,
.plain-list button,
.reminder-compose button,
.reminders-head button {
  background: var(--panel-2);
  border-color: var(--hairline);
}

.entry-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.entry-card {
  position: relative;
  overflow: hidden;
  padding: 13px;
  border-left: 0;
  cursor: pointer;
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--entry-color, var(--accent));
}

.entry-card.fixed::before {
  background: var(--accent-2);
}

.entry-title {
  font-size: 15px;
  line-height: 1.25;
}

.entry-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.status-pill,
.duration-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.muted {
  background: var(--panel-2);
  color: var(--muted);
}

.entry-actions {
  margin-top: 12px;
}

.entry-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.flex-list {
  gap: 7px;
  max-width: 980px;
}

.flex-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-left: 0;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: -1px;
  cursor: grab;
  touch-action: none;
}

.dragging .drag-handle,
.drag-handle:active {
  cursor: grabbing;
}

.flex-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.flex-main strong,
.flex-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flex-empty {
  list-style: none;
  padding: 16px;
  border: 1px dashed var(--hairline);
  border-radius: 8px;
}

.day-slots {
  gap: 4px;
  margin-top: 14px;
  padding: 10px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
}

.day-header .now-btn {
  margin-left: 0;
  min-height: 34px;
  padding: 6px 10px;
}

.day-slot {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 46px;
  padding: 7px 9px;
  background: var(--panel-2);
  border-color: color-mix(in srgb, var(--hairline) 78%, transparent);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.day-slot:hover,
.day-slot:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--hairline));
  background: color-mix(in srgb, var(--panel-2) 88%, var(--accent) 12%);
  outline: none;
}

.slot-entry-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-self: stretch;
}

.now-line {
  position: absolute;
  left: 66px;
  right: 10px;
  top: var(--now-offset, 0%);
  z-index: 3;
  height: 0;
  pointer-events: none;
  border-top: 2px solid var(--danger);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--danger) 42%, transparent));
}

.now-line::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.now-line span {
  position: absolute;
  right: 0;
  top: -14px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.time-label {
  color: var(--muted);
  font-size: 12px;
}

.slot-entry {
  position: relative;
  display: grid;
  gap: 2px;
  margin-top: 0;
  padding: 7px 10px 7px 12px;
  border-left: 4px solid var(--entry-color, var(--accent));
  line-height: 1.25;
  min-width: 0;
  min-height: 46px;
}

.slot-entry strong,
.slot-entry span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-entry span {
  color: var(--chip-muted);
  font-size: 11px;
  font-weight: 700;
}

.slot-entry span .fa-regular,
#mail-queue-list strong .fa-solid,
#unavailability-list strong .fa-solid {
  margin-right: 8px;
}

.week-board,
.month-board {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow-x: visible;
}

.week-column {
  min-height: 500px;
  padding: 9px;
}

.month-cell {
  min-height: 112px;
}

.cal-chip {
  border-left-color: var(--entry-color, var(--accent));
  background: color-mix(in srgb, var(--panel-2) 86%, var(--entry-color, var(--accent)) 14%);
}

.cal-chip.fixed {
  border-left-color: var(--accent-2);
}

#agenda-list {
  max-width: 980px;
}

.agenda-date {
  margin: 18px 0 3px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.agenda-item {
  grid-template-columns: 116px minmax(0, 1fr);
  padding: 11px 12px;
  border-left-width: 4px;
}

#notifications-list,
#mail-queue-list,
#unavailability-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

#notifications-list li,
#mail-queue-list li,
#unavailability-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  min-width: 0;
}

#notifications-list li.notification-card {
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
}

.notification-card {
  position: relative;
}

.notification-card.unread::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.notification-card.urgent::before {
  background: var(--danger);
}

.notification-card-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  padding: 10px 10px 10px 13px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-card-panel:hover,
.notification-card-panel:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
  outline: none;
}

.notification-card-panel .notification-dot {
  width: 28px;
  height: 28px;
}

.notification-card-panel .notification-card-main {
  gap: 5px;
}

.notification-card-panel .notification-card-head {
  display: grid;
  gap: 6px;
}

.notification-card-panel .notification-card-copy {
  gap: 2px;
}

.notification-card-panel .notification-card-copy strong,
.notification-card-panel .notification-card-copy p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-card-panel .notification-card-copy p {
  -webkit-line-clamp: 1;
  font-size: 12px;
}

.notification-card-panel .notification-card-meta {
  gap: 4px;
}

.notification-card-panel .notification-pill {
  min-height: 23px;
  padding: 0 7px;
  font-size: 10px;
}

.notifications-help {
  margin: -4px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

#notifications-list li > span:last-child,
#mail-queue-list li > span,
#unavailability-list li > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#notifications-list strong,
#mail-queue-list strong,
#unavailability-list strong {
  overflow-wrap: anywhere;
}

#notifications-list small,
#mail-queue-list small,
#unavailability-list small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.notification-dot {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 18%, var(--panel));
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 26%, var(--hairline));
}

.notification-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

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

.notification-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-card-copy strong,
.notification-card-copy small,
.notification-card-copy p {
  overflow-wrap: anywhere;
}

.notification-card-copy p {
  margin: 0;
  color: var(--text);
  font-weight: 650;
}

.notification-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notification-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.notification-pill.unread {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
}

.notification-pill.urgent {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--hairline));
  background: color-mix(in srgb, var(--danger) 16%, var(--panel));
  color: var(--danger);
}

.notification-pill.native {
  border-color: color-mix(in srgb, var(--accent-2) 32%, var(--hairline));
  background: color-mix(in srgb, var(--accent-2) 12%, var(--panel));
  color: var(--accent-2);
}

.notification-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-card-actions .btn {
  min-height: 36px;
}

.notification-detail-content {
  max-width: 560px;
}

.about-app-content {
  max-width: 680px;
}

.about-app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.about-app-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.about-app-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.about-app-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-app-header h3 {
  margin: 0;
  font-size: 24px;
}

.about-app-summary {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 46ch;
}

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

.about-app-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--panel-2);
}

.about-app-card strong {
  font-size: 18px;
}

.about-app-card small {
  color: var(--muted);
}

.about-app-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.about-app-status {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--hairline));
  color: var(--text);
  font-weight: 700;
}

.about-app-status.update-available {
  background: color-mix(in srgb, var(--warning) 14%, var(--panel-2));
  border-color: color-mix(in srgb, var(--warning) 30%, var(--hairline));
}

.about-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.notification-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.notification-detail-body {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
}

.notification-detail-meta,
.notification-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-detail-actions {
  margin-top: 14px;
}

.create-choice-content,
.quick-calendar-content {
  max-width: 520px;
}

.create-choice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.create-choice-header h3 {
  margin: 0;
}

.create-action-grid {
  display: grid;
  gap: 10px;
}

.create-action-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.create-action-card:hover,
.create-action-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-2));
  outline: none;
}

.create-action-card > i {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--link);
  font-size: 20px;
}

.create-action-card span,
.quick-calendar-preview span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.create-action-card strong,
.quick-calendar-preview strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.create-action-card small,
.quick-calendar-preview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.create-action-card.muted > i {
  background: var(--panel);
  color: var(--muted);
}

.quick-calendar-form {
  gap: 12px;
}

.quick-calendar-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
}

#quick-calendar-preview-swatch {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, #fff 30%, var(--hairline));
  border-radius: 8px;
}

.settings-grid {
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.settings-grid .card {
  align-self: start;
}

.settings-grid h4 {
  margin: 18px 0 4px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.button-row {
  gap: 7px;
}

.availability-day {
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  gap: 7px;
  padding: 7px 0;
}

.availability-day > button {
  min-width: 38px;
  min-height: 38px;
}

.window-row {
  gap: 7px;
}

.window-row input {
  min-height: 38px;
}

.modal {
  padding: 18px;
  align-items: center;
}

.modal-content {
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.modal-content > h3,
.entry-detail-header h3 {
  margin: 0;
  font-size: 20px;
}

.entry-detail-header {
  position: sticky;
  top: -18px;
  z-index: 1;
  margin: -18px -18px 14px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
  border-bottom: 1px solid var(--hairline);
}

.entry-detail-summary span {
  background: var(--panel-2);
  border-color: var(--hairline);
}

.bottom-tabs {
  left: 8px;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--chrome) 90%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--soft-shadow);
}

.bottom-tabs .tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 50px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bottom-tabs .tab span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-tabs .tab.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}

@media (max-width: 900px) {
  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .right-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    overflow: hidden;
  }

  .app-header {
    flex: 0 0 auto;
  }

  .topbar {
    position: sticky;
    top: 62px;
    z-index: 29;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    padding: 10px 12px;
  }

  .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
  }

  .calendar-controls select {
    min-width: 0;
  }

  .combined-toggle span {
    display: none;
  }

  .combined-toggle {
    min-width: 42px;
    justify-content: center;
    padding: 0 8px;
  }

  .view-toggle {
    grid-column: 1;
    width: 100%;
    min-width: 0;
  }

  .view-toggle button {
    flex: 1;
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .repeat-builder-head,
  .repeat-row {
    grid-template-columns: 1fr;
  }

  .repeat-state,
  .repeat-frequency,
  .repeat-end {
    width: 100%;
  }

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

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

  .topbar .icon-btn {
    grid-column: 2;
    width: 42px;
  }

  .content {
    padding: 14px 12px 88px;
  }

  .week-board,
  .month-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 8px;
  }

  .content {
    padding-bottom: 92px;
  }

  .view > h2 {
    margin-bottom: 12px;
    font-size: 23px;
  }

  .settings-grid {
    gap: 10px;
  }

  .card,
  .modal-content {
    padding: 14px;
  }

  .about-app-header,
  .about-app-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .about-app-grid {
    grid-template-columns: 1fr;
  }

  .day-slot {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }

  .slot-entry-stack {
    gap: 8px;
  }

  .slot-entry {
    min-height: 48px;
  }

  .agenda-item {
    grid-template-columns: 1fr;
  }

  .flex-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .entry-detail-header {
    top: -14px;
    margin: -14px -14px 12px;
    padding: 14px;
  }

  .modal {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-content {
    max-width: 100%;
    max-height: calc(100vh - 20px);
  }

  .repeat-frequency,
  .repeat-end {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
  }

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

  .repeat-scope-actions,
  .repeat-delete-actions {
    grid-template-columns: 1fr;
  }

  .bottom-tabs .nav-icon {
    width: 24px;
    height: 24px;
  }
}

/* App header, menus, and unified entry actions */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--chrome) 94%, var(--accent) 6%);
  backdrop-filter: blur(16px);
}

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

.app-brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  color: var(--on-accent);
  box-shadow: none;
}

.app-brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.app-brand-copy strong,
.app-brand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-copy strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.app-brand-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.header-icon-btn:hover,
.header-icon-btn.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--text);
}

.header-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  border: 1px solid var(--chrome);
}

.notification-centre-wrap {
  position: relative;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 65;
  display: grid;
  width: min(430px, calc(100vw - 16px));
  max-height: min(680px, calc(100dvh - 78px));
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

.notifications-panel-head,
.notifications-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--hairline);
}

.notifications-panel-foot {
  border-top: 1px solid var(--hairline);
  border-bottom: 0;
}

.notifications-panel-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notifications-panel-head strong {
  font-size: 15px;
  font-weight: 900;
}

.notifications-panel-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notifications-panel-head .btn,
.notifications-panel-foot .btn {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.notification-panel-list {
  display: grid;
  gap: 7px;
  max-height: min(520px, calc(100dvh - 190px));
  overflow-y: auto;
  padding: 8px;
}

.notification-panel-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.notification-panel-empty i {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--accent-2);
}

.notification-panel-empty strong {
  color: var(--text);
}

.app-menu-wrap {
  position: relative;
}

.app-menu,
.entry-context-menu {
  z-index: 60;
  width: min(300px, calc(100vw - 16px));
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

.app-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
}

.entry-context-menu {
  position: fixed;
  z-index: 10020;
}

.app-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.app-menu-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2));
  color: var(--text);
  font-weight: 900;
}

.app-menu-header span:last-child {
  display: grid;
  min-width: 0;
}

.app-menu-header strong,
.app-menu-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-header small {
  color: var(--muted);
  font-weight: 700;
}

.menu-action,
.entry-context-menu button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}

.menu-action i,
.entry-context-menu button i {
  color: var(--muted);
  text-align: center;
}

.menu-action:hover,
.entry-context-menu button:hover {
  background: var(--panel-2);
}

.native-exit-action:not(.hidden) {
  margin-top: 5px;
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 8px 8px;
  color: var(--text);
}

.native-exit-action i {
  color: var(--accent-2);
}

.menu-action.danger,
.entry-context-menu button.danger {
  color: var(--danger);
}

.menu-action.danger i,
.entry-context-menu button.danger i {
  color: var(--danger);
}

.topbar {
  top: 62px;
}

.context-entry-preview {
  display: grid;
  gap: 2px;
  padding: 8px 9px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.context-entry-preview strong,
.context-entry-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-entry-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.entry-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}

.entry-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.entry-native-attention {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, var(--accent) 8%);
}

.entry-native-attention.hidden {
  display: none;
}

.entry-native-attention-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entry-native-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-native-attention-head h4 {
  margin: 0;
  font-size: 15px;
}

.entry-native-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 750;
}

.entry-native-summary {
  display: grid;
  gap: 10px;
}

.entry-native-profile {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
}

.entry-native-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.entry-native-profile-head strong {
  font-size: 14px;
}

.entry-native-profile-head small {
  color: var(--muted);
  font-weight: 800;
}

.entry-native-summary-card {
  display: grid;
  gap: 8px;
}

.entry-native-summary-card span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
}

.entry-native-summary-card strong {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.entry-native-summary-card small {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.entry-native-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-native-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.entry-native-chip.dim {
  color: var(--muted);
}

.entry-native-chip.alert {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--hairline));
  background: color-mix(in srgb, var(--danger) 14%, var(--panel));
  color: var(--danger);
}

.entry-native-chip.ready {
  border-color: color-mix(in srgb, var(--accent-2) 30%, var(--hairline));
  background: color-mix(in srgb, var(--accent-2) 12%, var(--panel));
  color: var(--accent-2);
}

.entry-native-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-native-actions .btn {
  min-height: 38px;
}

.alert-preview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 8px;
}

.alert-preview-actions .btn {
  width: 100%;
}

.critical-reminder-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  max-width: min(560px, calc(100vw - 28px));
  border: 1px solid color-mix(in srgb, var(--danger) 46%, var(--hairline));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--danger) 18%, transparent), transparent 32%),
    var(--panel);
}

.critical-reminder-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
  font-size: 22px;
}

.critical-reminder-copy {
  min-width: 0;
}

.critical-reminder-copy h3,
.critical-reminder-copy p {
  margin: 0;
}

.critical-reminder-copy h3 {
  margin-top: 4px;
  font-size: clamp(22px, 4.8vw, 30px);
  line-height: 1.05;
}

.critical-reminder-copy p {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(15px, 3.6vw, 17px);
  line-height: 1.45;
}

.critical-reminder-detail {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--hairline));
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-2));
  color: var(--danger);
  font-weight: 800;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.critical-reminder-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.critical-reminder-actions .btn {
  min-height: 46px;
}

.action-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 10080;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 24px));
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.offline-sync-banner {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.offline-sync-banner.hidden {
  display: none;
}

.offline-sync-banner i {
  color: var(--accent);
}

.offline-sync-banner.is-offline i {
  color: var(--warning, #f59e0b);
}

.offline-sync-banner.has-conflicts {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background:
    radial-gradient(circle at left, color-mix(in srgb, var(--danger) 16%, transparent), transparent 34%),
    color-mix(in srgb, var(--panel) 95%, transparent);
}

.offline-sync-banner.has-conflicts i {
  color: var(--danger);
}

.offline-sync-banner span {
  flex: 1;
  font-weight: 700;
}

.offline-sync-banner .btn-mini {
  padding: 8px 10px;
  min-height: 0;
  white-space: nowrap;
}

.offline-sync-banner.is-syncing .btn-mini {
  opacity: .7;
  pointer-events: none;
}

.month-mobile-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  overflow: visible;
}

.month-mobile-day {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 54%),
    var(--panel);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  min-width: 0;
}

.month-mobile-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.month-mobile-day header div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.month-mobile-day header strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.month-mobile-day header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.month-mobile-day header em {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.month-mobile-day.is-today {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--hairline));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 18%, transparent), var(--soft-shadow);
}

.month-mobile-day.is-active-day {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 14%, transparent), transparent 44%),
    var(--panel);
}

.month-mobile-day .cal-chip {
  min-height: 44px;
  border-radius: 8px;
}

.month-mobile-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.month-mobile-more {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 900;
}

.offline-conflict-content {
  max-width: min(620px, calc(100vw - 24px));
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 38%, var(--hairline));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent), transparent 32%),
    var(--panel);
}

.offline-conflict-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.offline-conflict-head > i {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--warning, #f59e0b);
  background: color-mix(in srgb, var(--warning, #f59e0b) 16%, transparent);
  flex: 0 0 auto;
}

.offline-conflict-head p,
.offline-conflict-head h3,
.offline-conflict-copy {
  margin: 0;
}

.offline-conflict-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.offline-conflict-head h3 {
  font-size: clamp(22px, 4.6vw, 30px);
  line-height: 1.05;
}

.offline-conflict-copy {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.offline-conflict-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.offline-conflict-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--panel-2);
}

.offline-conflict-item span,
.offline-conflict-empty {
  color: var(--muted);
  margin: 0;
}

.offline-conflict-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.offline-conflict-compare > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}

.offline-conflict-compare small {
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.offline-conflict-compare code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.offline-conflict-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.offline-conflict-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.action-toast.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 48%, var(--hairline));
  background: color-mix(in srgb, var(--panel) 88%, var(--danger) 12%);
}

.action-toast.success {
  border-color: color-mix(in srgb, var(--ok) 34%, var(--hairline));
  background: color-mix(in srgb, var(--panel) 90%, var(--ok) 10%);
}

.timesheet-hero,
.timesheet-layout {
  display: grid;
  gap: 14px;
}

.timesheet-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.timesheet-hero h2,
.timesheet-list-head h3,
.timesheet-detail-head h3,
.timesheet-form-head h3 {
  margin: 0;
}

.timesheet-hero > div > span,
.timesheet-list-head p,
.timesheet-detail-head small,
.timesheet-empty span,
.timesheet-card small,
.timesheet-notes {
  color: var(--muted);
}

.timesheet-hero-actions,
.timesheet-list-head,
.timesheet-detail-head,
.timesheet-detail-actions,
.timesheet-row-actions,
.timesheet-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.timesheet-hero-actions,
.timesheet-detail-actions,
.timesheet-form-actions {
  justify-content: flex-end;
}

.timesheet-layout {
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
}

.timesheet-list-card,
.timesheet-detail-card {
  min-width: 0;
}

.timesheet-list-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.timesheet-list {
  display: grid;
  gap: 10px;
}

.timesheet-card {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 7px;
}

.timesheet-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.timesheet-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.timesheet-card-meta span,
.timesheet-summary-grid > span,
.timesheet-daily-totals > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.timesheet-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-strong);
}

.timesheet-status.submitted {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}

.timesheet-status.approved {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--accent-strong);
}

.timesheet-status.locked {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}

.timesheet-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text);
}

.timesheet-empty.compact {
  min-height: 118px;
  padding: 18px;
}

.timesheet-empty.error {
  color: var(--danger);
}

.timesheet-empty i {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-strong);
}

.timesheet-detail-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.timesheet-notes {
  margin: 0 0 14px;
  line-height: 1.55;
}

.timesheet-summary-grid,
.timesheet-daily-totals {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.timesheet-summary-grid > span,
.timesheet-daily-totals > span {
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
}

.timesheet-summary-grid strong,
.timesheet-daily-totals strong {
  color: var(--text);
}

.timesheet-summary-grid small,
.timesheet-daily-totals small {
  color: var(--muted);
}

.timesheet-daily-totals {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.timesheet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.timesheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.timesheet-mobile-head,
.timesheet-mobile-log {
  display: none;
}

.timesheet-table th,
.timesheet-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.timesheet-table th {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
}

.timesheet-table tr:last-child td {
  border-bottom: 0;
}

.timesheet-row-actions {
  flex-wrap: nowrap;
}

.timesheet-form-content {
  max-width: 680px;
}

.timesheet-form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

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

.timesheet-form label {
  display: grid;
  gap: 6px;
}

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

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

.timesheet-duration-preview {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 750;
}

.timesheet-duration-preview.error,
.timesheet-form-message.error {
  color: var(--danger);
}

.timesheet-form-message {
  min-height: 1.2em;
}

.btn.danger,
.btn.btn-ghost.danger {
  color: var(--danger);
  -webkit-text-fill-color: var(--danger);
}

@media (max-width: 860px) {
  .timesheet-hero,
  .timesheet-layout {
    grid-template-columns: 1fr;
  }

  .timesheet-hero-actions,
  .timesheet-hero-actions .btn,
  .timesheet-detail-actions,
  .timesheet-detail-actions .btn {
    width: 100%;
  }

  .timesheet-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-app-view="timesheets"] .content {
    padding: 8px 8px 76px;
  }

  #view-timesheets {
    display: grid;
    gap: 8px;
  }

  .timesheet-hero {
    position: sticky;
    top: 0;
    z-index: 12;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: -8px -8px 0;
    padding: 8px;
    border-bottom: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--chrome, var(--surface)) 92%, transparent);
    backdrop-filter: blur(14px);
  }

  .timesheet-hero .entry-detail-kicker,
  .timesheet-hero > div > span {
    display: none;
  }

  .timesheet-hero h2 {
    font-size: 20px;
    line-height: 1.1;
  }

  .timesheet-hero-actions {
    width: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 6px;
  }

  .timesheet-hero-actions .btn {
    width: auto;
    min-height: 38px;
    padding: 0 10px;
    gap: 7px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 12px;
  }

  .timesheet-layout {
    gap: 8px;
  }

  .timesheet-list-card,
  .timesheet-detail-card {
    padding: 10px;
    border-radius: 8px;
  }

  .timesheet-list-card {
    overflow: hidden;
  }

  .timesheet-list-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .timesheet-list-head h3 {
    font-size: 15px;
  }

  .timesheet-list-head p {
    display: none;
  }

  #timesheet-refresh {
    width: 40px;
    min-width: 40px;
    min-height: 38px;
    padding: 0;
  }

  #timesheet-refresh span {
    display: none;
  }

  .timesheet-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    margin-inline: -10px;
    padding: 0 10px 2px;
    scrollbar-width: none;
  }

  .timesheet-list::-webkit-scrollbar {
    display: none;
  }

  .timesheet-card {
    flex: 0 0 min(244px, 78vw);
    scroll-snap-align: start;
    gap: 5px;
    min-height: 92px;
    padding: 10px;
    border-color: var(--hairline);
    background: var(--panel);
  }

  .timesheet-card strong {
    font-size: 14px;
    line-height: 1.18;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timesheet-card small {
    font-size: 11px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timesheet-card-meta {
    gap: 6px;
    font-size: 11px;
  }

  .timesheet-status {
    padding: 3px 7px;
    font-size: 10px;
    letter-spacing: 0.03em;
  }

  .timesheet-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 9px;
  }

  .timesheet-detail-head h3 {
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.18;
  }

  .timesheet-detail-head small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
  }

  .timesheet-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
  }

  .timesheet-detail-actions .btn {
    width: 100%;
    min-height: 38px;
    padding: 0 9px;
    font-size: 12px;
  }

  .timesheet-notes {
    margin-bottom: 9px;
    font-size: 12px;
    line-height: 1.35;
  }

  .timesheet-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
  }

  .timesheet-summary-grid > span {
    min-height: 54px;
    display: grid;
    gap: 2px;
    justify-content: stretch;
    align-content: center;
    padding: 8px 9px;
  }

  .timesheet-summary-grid > span:nth-child(3) {
    display: none;
  }

  .timesheet-summary-grid strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .timesheet-summary-grid small {
    font-size: 11px;
  }

  .timesheet-daily-totals {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0 -10px 8px;
    padding: 0 10px 2px;
    scrollbar-width: none;
  }

  .timesheet-daily-totals::-webkit-scrollbar {
    display: none;
  }

  .timesheet-daily-totals > span {
    flex: 0 0 auto;
    min-width: 132px;
    display: grid;
    gap: 2px;
    justify-content: stretch;
    padding: 8px 9px;
  }

  .timesheet-daily-totals strong,
  .timesheet-daily-totals small {
    font-size: 11px;
    line-height: 1.2;
  }

  .timesheet-empty {
    min-height: 132px;
    gap: 6px;
    padding: 14px;
  }

  .timesheet-empty.compact {
    min-height: 86px;
    padding: 12px;
  }

  .timesheet-empty i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

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

  .timesheet-form-content {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 18px);
    overflow-y: auto;
    padding: 12px;
  }

  .timesheet-form-head {
    gap: 8px;
    margin-bottom: 9px;
  }

  .timesheet-form-head h3 {
    font-size: 18px;
  }

  .timesheet-form {
    gap: 9px;
  }

  .timesheet-form label {
    gap: 4px;
    font-size: 11px;
  }

  .timesheet-form input,
  .timesheet-form select,
  .timesheet-form textarea {
    min-height: 38px;
    padding: 7px 9px;
  }

  .timesheet-form textarea {
    min-height: 86px;
  }

  .timesheet-duration-preview {
    padding: 8px 9px;
    font-size: 12px;
  }

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

  .timesheet-form-actions .btn {
    min-height: 38px;
    padding: 0 9px;
    font-size: 12px;
  }

  .timesheet-form-actions .danger {
    grid-column: 1 / -1;
  }

  .timesheet-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .timesheet-table {
    min-width: 0;
  }

  .timesheet-table thead {
    display: none;
  }

  .timesheet-table,
  .timesheet-table tbody,
  .timesheet-table tr,
  .timesheet-table td {
    display: block;
    width: 100%;
  }

  .timesheet-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--panel);
  }

  .timesheet-table tr:last-child {
    margin-bottom: 0;
  }

  .timesheet-table td {
    border-bottom: 0;
    display: block;
    padding: 0;
    min-width: 0;
  }

  .timesheet-table td::before {
    content: none;
  }

  .timesheet-table td.timesheet-desktop-cell {
    display: none;
  }

  .timesheet-mobile-log {
    grid-column: 1;
    grid-row: 1;
    display: grid !important;
    gap: 3px;
    width: auto;
  }

  .timesheet-mobile-log > span,
  .timesheet-mobile-log > small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
  }

  .timesheet-mobile-log strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.15;
  }

  .timesheet-mobile-log i {
    color: var(--muted);
    font-size: 11px;
  }

  .timesheet-table td[data-label="Description"] {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .timesheet-table td[data-label="Actions"] {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: auto;
  }

  .timesheet-row-actions {
    display: grid;
    grid-template-columns: repeat(2, 34px);
    gap: 5px;
  }

  .timesheet-row-actions .btn {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
  }

  .timesheet-row-actions .btn span {
    display: none;
  }
}

.feedback-hero,
.feedback-layout {
  display: grid;
  gap: 14px;
}

.feedback-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.feedback-hero h2,
.feedback-thread-head h3,
.support-report-header h3,
.admin-support-detail-head h3 {
  margin: 0;
}

.feedback-hero > div > span,
.feedback-thread-head small,
.support-report-header p,
.feedback-empty span,
.feedback-thread-card small,
.admin-support-thread small,
.support-post header small,
.support-closed-note {
  color: var(--muted);
}

.feedback-hero-actions,
.feedback-filter-row,
.admin-support-toolbar,
.admin-support-controls,
.support-reply-form,
.support-report-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.feedback-hero .btn,
.feedback-hero .btn span {
  color: var(--on-accent);
  -webkit-text-fill-color: var(--on-accent);
}

.feedback-hero .btn-ghost,
.feedback-hero .btn-ghost span {
  color: var(--link);
  -webkit-text-fill-color: var(--link);
}

.feedback-layout {
  grid-template-columns: minmax(250px, 0.42fr) minmax(0, 1fr);
}

.feedback-thread-list-card,
.feedback-thread-panel,
.admin-support-panel {
  min-width: 0;
}

.feedback-thread-list,
.admin-support-list,
.support-post-list {
  display: grid;
  gap: 10px;
}

.feedback-thread-list,
.admin-support-list {
  margin-top: 12px;
}

.feedback-thread-card,
.admin-support-thread {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 6px;
}

.feedback-thread-card.active,
.admin-support-thread.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.support-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--accent-strong);
}

.support-pill.bug {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.feedback-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text);
}

.feedback-empty.compact {
  min-height: 120px;
  padding: 18px;
}

.feedback-empty i {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-strong);
}

.feedback-thread-head,
.support-report-header,
.admin-support-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.support-post {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.support-post.admin {
  border-color: color-mix(in srgb, var(--ok) 28%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--ok) 8%, transparent));
}

.support-post header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.support-post p {
  margin: 0;
  line-height: 1.55;
}

.support-attachments {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.support-attachments a {
  width: 112px;
  color: var(--text);
  text-decoration: none;
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
}

.support-attachments img {
  width: 112px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.support-reply-form {
  margin-top: 14px;
}

.support-reply-form textarea,
.support-report-form textarea,
.support-report-form input,
.feedback-filter-row select,
.admin-support-controls select,
.admin-support-toolbar select {
  width: 100%;
}

.support-reply-form textarea {
  flex: 1 1 260px;
}

.support-report-content {
  max-width: 720px;
}

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

.support-report-form label,
.feedback-filter-row label,
.admin-support-toolbar label,
.admin-support-controls label {
  display: grid;
  gap: 6px;
}

.support-device-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-2);
}

.support-device-details pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.support-report-message,
.support-closed-note {
  min-height: 1.2em;
}

.admin-support-detail {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.admin-support-controls {
  margin-bottom: 12px;
}

.support-post-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: start;
}

@media (max-width: 820px) {
  .feedback-hero,
  .feedback-layout {
    grid-template-columns: 1fr;
  }

  .feedback-hero-actions,
  .feedback-hero-actions .btn,
  .support-report-actions .btn,
  .support-reply-form .btn {
    width: 100%;
  }

  .support-reply-form {
    display: grid;
  }
}

@media (max-width: 560px) {
  .critical-reminder-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .critical-reminder-actions {
    grid-template-columns: 1fr;
  }

  .offline-conflict-actions {
    grid-template-columns: 1fr;
  }

  .offline-conflict-compare,
  .offline-conflict-item-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-header {
    min-height: 58px;
    padding: 8px 12px;
  }

  .app-brand-mark {
    width: 36px;
    height: 36px;
  }

  .topbar {
    top: 58px;
  }

  .bottom-tabs .tab {
    min-height: 52px;
  }
}

@media (max-width: 640px) {
  .app-brand-copy strong {
    font-size: 14px;
  }

  .app-brand-copy span {
    font-size: 11px;
  }

  .header-icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .notifications-panel {
    position: fixed;
    top: 58px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100dvh - 74px - env(safe-area-inset-bottom));
  }

  .notification-panel-list {
    max-height: calc(100dvh - 214px - env(safe-area-inset-bottom));
  }

  .notifications-panel-foot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notifications-panel-foot .btn,
  .notifications-panel-head .btn {
    justify-content: center;
  }

  .entry-context-menu {
    position: fixed;
  }

  .entry-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-detail-actions .btn {
    justify-content: center;
    padding: 8px 6px;
  }

  .entry-native-attention-head,
  .notification-card-head {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .notification-detail-header {
    display: grid;
  }

  .notification-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Mobile calendar view refinements */
@media (max-width: 640px) {
  .week-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .week-column {
    min-height: 0;
    padding: 9px;
    gap: 7px;
  }

  .week-column.no-entries {
    min-height: 58px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .week-column.no-entries header {
    margin: 0;
    padding: 0;
    border-bottom: 0;
  }

  .week-column.no-entries .empty-state {
    justify-self: end;
    padding: 4px 8px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--panel-2);
    font-weight: 800;
  }

  .week-column.has-entries {
    min-height: 0;
  }

  .month-board {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    overflow-x: visible;
  }

  .month-heading {
    display: block;
    padding: 0 0 4px;
    text-align: center;
    font-size: 10px;
  }

  .month-heading:nth-child(7n + 1),
  .month-heading:nth-child(7n) {
    color: var(--accent);
  }

  .month-cell {
    min-height: 54px;
    padding: 4px 3px;
    gap: 3px;
    border-radius: 8px;
  }

  .month-cell header {
    min-height: 18px;
    text-align: center;
    font-size: 11px;
    line-height: 1;
  }

  .month-cell.no-entries {
    background: color-mix(in srgb, var(--panel) 78%, var(--panel-2));
  }

  .month-cell.has-entries {
    min-height: 94px;
    background: color-mix(in srgb, var(--panel) 84%, var(--accent) 4%);
  }

  .month-cell .cal-chip {
    min-height: 34px;
    padding: 5px 4px 5px 6px;
    border-left-width: 3px;
    font-size: 10px;
    line-height: 1.1;
  }

  .month-cell .cal-chip span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .month-cell .more-count {
    min-height: 20px;
    text-align: center;
    font-size: 10px;
    font-weight: 850;
  }
}

/* Custom calendar picker */
body:not([data-app-view="calendar"]) .view-toggle,
body:not([data-app-view="calendar"]) .period-controls {
  display: none;
}

body[data-app-view="timesheets"] .topbar {
  display: none;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 460px) minmax(240px, 1fr) auto;
  justify-content: space-between;
  align-items: center;
}

.calendar-controls {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
  width: min(460px, 100%);
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.native-calendar-select {
  display: none !important;
}

.calendar-picker {
  position: relative;
  min-width: 0;
}

.calendar-picker-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-picker-toggle:hover,
.calendar-picker-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.calendar-swatch,
.calendar-choice-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.calendar-swatch {
  width: 24px;
  height: 24px;
}

.calendar-picker-copy,
.calendar-choice-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.calendar-picker-copy strong,
.calendar-picker-copy small,
.calendar-choice-copy strong,
.calendar-choice-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-picker-copy strong,
.calendar-choice-copy strong {
  font-weight: 850;
}

.calendar-picker-copy small,
.calendar-choice-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.calendar-picker-toggle > .fa-chevron-down {
  color: var(--muted);
  justify-self: center;
}

.calendar-picker-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(430px, calc(100vh - 170px));
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.calendar-picker-menu .combined-toggle {
  display: grid;
  grid-template-columns: 34px 24px minmax(0, 1fr);
  min-height: 46px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  cursor: pointer;
}

.calendar-picker-menu .combined-toggle input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--on-accent);
}

.calendar-picker-menu .combined-toggle input:checked,
.calendar-picker-menu .combined-toggle input:indeterminate {
  background: var(--accent);
  border-color: var(--accent);
}

.calendar-picker-menu .combined-toggle input:checked::after,
.calendar-picker-menu .combined-toggle input:indeterminate::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 15px;
}

.calendar-picker-menu .combined-toggle input:indeterminate::after {
  content: "\f068";
}

.calendar-picker-menu .combined-toggle span {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-picker-list {
  display: grid;
  gap: 4px;
  padding-top: 6px;
}

.calendar-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-choice:hover {
  background: var(--panel-2);
}

.calendar-choice .fa-check {
  color: transparent;
}

.calendar-choice.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.calendar-choice.active .calendar-choice-swatch {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.calendar-choice.active .fa-check {
  color: var(--accent);
}

.calendar-picker-list.is-combined .calendar-choice {
  opacity: 1;
}

.calendar-create-btn {
  align-self: stretch;
}

.period-controls {
  display: grid;
  grid-template-columns: 36px minmax(150px, 1fr) 36px auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
}

.period-step,
.period-today {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.period-step {
  width: 36px;
  padding: 0;
}

.period-today {
  padding: 0 10px;
  color: var(--link);
  white-space: nowrap;
}

.period-step:hover,
.period-today:hover {
  background: var(--panel-2);
  color: var(--text);
}

.period-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

  .calendar-controls {
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr) 42px;
    width: 100%;
  }

  .view-toggle {
    grid-column: 1;
  }

  .period-controls {
    grid-column: 1;
    width: 100%;
  }

  .calendar-picker-menu {
    width: min(360px, calc(100vw - 24px));
  }
}

@media (max-width: 640px) {
  .calendar-picker-toggle {
    grid-template-columns: 26px minmax(0, 1fr) 18px;
    gap: 7px;
    padding-inline: 8px;
  }

  .calendar-picker-copy small {
    display: none;
  }

  .calendar-picker-menu {
    left: 0;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 182px);
  }

  .period-controls {
    grid-template-columns: 34px minmax(0, 1fr) 34px auto;
  }

  .period-label {
    padding: 0 7px;
    font-size: 12px;
  }

  .period-today {
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (max-width: 900px) and (orientation: landscape), (max-width: 900px) and (max-height: 520px) {
  .app-header {
    min-height: 48px;
    padding: 6px 10px;
  }

  .app-brand {
    gap: 8px;
  }

  .app-brand-mark {
    width: 34px;
    height: 34px;
  }

  .app-brand-copy strong {
    font-size: 14px;
  }

  .app-brand-copy span {
    display: none;
  }

  .app-header-actions {
    gap: 6px;
  }

  .header-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .topbar {
    top: 48px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 7px;
    padding: 7px 10px;
  }

  body:not([data-app-view="calendar"]) .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-controls,
  .period-controls,
  .view-toggle {
    grid-column: auto;
    width: 100%;
    min-width: 0;
  }

  .calendar-controls {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .calendar-picker-toggle {
    grid-template-columns: 24px minmax(0, 1fr) 16px;
    min-height: 38px;
    gap: 7px;
    padding: 5px 7px;
  }

  .calendar-picker-copy small {
    display: none;
  }

  .calendar-swatch {
    width: 22px;
    height: 22px;
  }

  .calendar-create-btn,
  .topbar .icon-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .calendar-picker-menu {
    width: min(340px, calc(100vw - 20px));
    max-height: calc(100vh - 118px);
  }

  .period-controls {
    grid-template-columns: 34px minmax(0, 1fr) 34px auto;
    padding: 3px;
  }

  .period-step,
  .period-today,
  .period-label {
    min-height: 34px;
  }

  .period-step {
    width: 34px;
  }

  .period-label {
    padding: 0 6px;
    font-size: 12px;
  }

  .period-today {
    padding: 0 7px;
    font-size: 12px;
  }

  .view-toggle {
    padding: 3px;
  }

  .view-toggle button {
    min-height: 34px;
    padding: 0 4px;
    font-size: 11px;
  }

  .content {
    padding: 10px 10px 86px;
  }

  .view {
    min-height: calc(100dvh - 168px);
  }

  .view > h2 {
    margin-bottom: 10px;
    font-size: 21px;
  }

  .view-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .summary-card {
    min-height: 54px;
    padding: 8px 10px;
  }

  .summary-card strong {
    font-size: 17px;
  }

  .day-slots {
    max-height: calc(100dvh - 184px);
    margin-top: 8px;
    padding: 8px;
  }

  .week-board,
  .month-board {
    gap: 8px;
  }

  .week-column {
    min-height: 0;
  }

  .month-cell {
    min-height: 70px;
  }

  .settings-grid {
    gap: 10px;
  }

  .card {
    padding: 14px;
  }

  .modal {
    align-items: center;
    padding: 8px;
  }

  .modal-content {
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }

  .entry-detail-grid {
    grid-template-columns: 1fr;
  }

  .entry-detail-header,
  .entry-native-attention-head,
  .reminders-head {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-detail-content .modal-actions,
  .entry-create-content .modal-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .entry-detail-content .modal-actions .btn,
  .entry-create-content .modal-actions .btn,
  .reminders-head .btn {
    width: 100%;
    justify-content: center;
  }

  .bottom-tabs {
    left: 10px;
    right: 10px;
    bottom: max(6px, env(safe-area-inset-bottom));
    padding: 4px;
    background: var(--chrome);
  }

  .bottom-tabs .tab {
    min-height: 44px;
    padding: 3px 2px;
  }

  .bottom-tabs .nav-icon {
    width: 24px;
    height: 24px;
  }
}

/* Public/auth native app polish */
:root,
.theme-light {
  color-scheme: light;
}

.theme-dark {
  color-scheme: dark;
}

.theme-system {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  .theme-system {
    color-scheme: dark;
  }
}

.public-page {
  min-height: 100dvh;
  background: var(--app-bg);
  color: var(--text);
}

.public-chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--chrome) 94%, var(--accent) 6%);
  backdrop-filter: blur(16px);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 900;
}

.public-brand img,
.auth-brand img,
.public-hero-icon {
  display: block;
  border-radius: 8px;
  object-fit: contain;
}

.public-brand img {
  width: 38px;
  height: 38px;
}

.public-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.public-actions .btn {
  min-height: 40px;
  padding: 9px 13px;
}

.public-home {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: calc(100dvh - 176px);
}

.public-hero-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.public-hero-icon {
  width: 72px;
  height: 72px;
}

.public-hero h1,
.auth-card h1 {
  margin: 0;
  color: var(--text);
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: 0;
}

.public-hero p,
.auth-help,
.auth-card > p,
.auth-success p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.public-hero p {
  max-width: 560px;
  font-size: 18px;
}

.public-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.preview-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 42px;
  padding: 5px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.preview-toolbar strong {
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.preview-toolbar span:last-child {
  justify-self: end;
}

.preview-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--panel-2);
}

.preview-row span {
  color: var(--muted);
  font-weight: 850;
}

.preview-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-row.fixed {
  border-left-color: var(--accent-2);
}

.preview-row.flex {
  border-left-color: #7c3aed;
}

.landing,
.landing-hero {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.feature {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: none;
}

.feature strong {
  font-size: 15px;
  font-weight: 900;
}

.feature span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.auth-page {
  display: block;
  min-height: 100dvh;
  padding: 0;
  overflow-y: auto;
}

.auth-stage {
  display: grid;
  place-items: start center;
  width: min(560px, calc(100% - 32px));
  min-height: calc(100dvh - 62px);
  margin: 0 auto;
  padding: 28px 0 44px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-brand img {
  width: 34px;
  height: 34px;
}

.auth-card form,
.auth-success {
  display: grid;
  gap: 12px;
}

.auth-card label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.auth-card input,
.auth-card textarea,
.auth-card select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.auth-card input:focus,
.auth-card textarea:focus,
.auth-card select:focus {
  outline: 2px solid var(--control-ring);
  outline-offset: 2px;
}

.auth-card .password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-card .password-toggle {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--link);
  font-weight: 850;
  cursor: pointer;
}

.auth-card .remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 34px;
  color: var(--text);
}

.auth-card .remember-me input {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  box-shadow: none;
  font-weight: 900;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.auth-links a,
.auth-primary-link {
  font-weight: 850;
}

.auth-success h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
}

@media (max-width: 760px) {
  .public-chrome {
    min-height: 58px;
    padding: 8px 12px;
  }

  .public-brand img {
    width: 36px;
    height: 36px;
  }

  .public-actions .btn {
    min-height: 38px;
    padding: 8px 11px;
  }

  .public-home {
    width: min(100% - 24px, 560px);
    padding: 16px 0 30px;
  }

  .public-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .public-hero h1,
  .auth-card h1 {
    font-size: 30px;
  }

  .public-hero p {
    font-size: 16px;
  }

  .landing-features {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .feature {
    min-height: 0;
  }

  .auth-stage {
    width: min(100% - 24px, 520px);
    min-height: calc(100dvh - 58px);
    padding: 16px 0 28px;
  }

  .auth-card {
    padding: 16px;
  }

  .auth-brand img {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 900px) and (orientation: landscape), (max-width: 900px) and (max-height: 520px) {
  .public-chrome {
    min-height: 48px;
    padding: 6px 10px;
  }

  .public-brand img {
    width: 34px;
    height: 34px;
  }

  .public-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
  }

  .public-home {
    width: min(100% - 20px, 980px);
    padding: 12px 0 20px;
  }

  .public-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
    min-height: 0;
    gap: 12px;
  }

  .public-hero-icon {
    width: 54px;
    height: 54px;
  }

  .public-hero h1,
  .auth-card h1 {
    font-size: 30px;
  }

  .public-hero p {
    font-size: 15px;
  }

  .public-preview {
    gap: 7px;
    padding: 10px;
  }

  .preview-row {
    min-height: 46px;
  }

  .landing-features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .feature {
    min-height: 88px;
    padding: 12px;
  }

  .auth-stage {
    min-height: calc(100dvh - 48px);
    padding: 10px 0 16px;
  }

  .auth-card {
    gap: 6px;
    max-width: 760px;
    padding: 8px;
  }

  .auth-card form,
  .auth-success {
    gap: 7px;
  }

  .auth-card form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .auth-card form > .auth-help,
  .auth-card form > .remember-me,
  .auth-card form > .btn,
  .auth-card form > .auth-links,
  .auth-card form > .success,
  .auth-card form > .error {
    grid-column: 1 / -1;
  }

  .auth-brand img {
    width: 28px;
    height: 28px;
  }

  .auth-brand {
    display: none;
  }

  .auth-card h1 {
    font-size: 24px;
  }

  .auth-card input,
  .auth-card textarea,
  .auth-card select,
  .auth-card .password-toggle {
    min-height: 34px;
    padding-block: 6px;
  }

  .auth-card .remember-me input {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .auth-card .btn {
    min-height: 38px;
  }
}

/* Public/auth pro app refinement */
.public-page {
  font-size: 14px;
}

.public-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34%),
    linear-gradient(320deg, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 42%),
    var(--app-bg);
}

.public-page .btn,
.auth-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--hairline));
  box-shadow: none;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.public-page .btn-ghost {
  border-color: var(--hairline);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  color: var(--link);
}

.public-page .btn i {
  flex: 0 0 auto;
  font-size: 0.95em;
}

.public-chrome {
  min-height: 58px;
  padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--chrome) 88%, transparent);
}

.public-brand span {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.public-brand strong {
  color: var(--text);
  font-weight: 900;
}

.public-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.public-home {
  width: min(1100px, calc(100% - 28px));
  padding: 18px 0 28px;
}

.public-hero {
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 0.94fr);
  min-height: min(660px, calc(100dvh - 118px));
  gap: 18px;
}

.public-hero-copy {
  gap: 12px;
}

.public-hero-badge,
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--hairline));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--link);
  font-size: 12px;
  font-weight: 900;
}

.public-hero-icon {
  width: 58px;
  height: 58px;
}

.public-hero h1,
.auth-card h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
}

.public-hero p {
  max-width: 620px;
  font-size: 17px;
  font-weight: 700;
}

.public-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-hero-actions .btn {
  min-width: 132px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.public-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.public-preview {
  gap: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 92%, var(--accent) 4%);
}

.preview-toolbar {
  min-height: 38px;
}

.preview-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preview-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  min-height: 52px;
  gap: 10px;
}

.preview-row em {
  min-width: 58px;
  padding: 5px 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.landing-features {
  gap: 10px;
}

.feature {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 100px;
  gap: 4px 10px;
  padding: 14px;
}

.feature > i {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--link);
}

.feature strong,
.feature span {
  min-width: 0;
}

.auth-stage {
  width: min(1000px, calc(100% - 28px));
  min-height: calc(100dvh - 58px);
  padding: 18px 0 28px;
}

.auth-stage--split {
  grid-template-columns: minmax(280px, 0.9fr) minmax(380px, 520px);
  align-items: center;
  gap: 16px;
  place-items: center;
}

.auth-companion {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, var(--accent) 5%);
  box-shadow: var(--soft-shadow);
}

.auth-companion-icon img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.auth-companion strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.auth-companion span {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.auth-mini-list {
  display: grid;
  gap: 8px;
}

.auth-mini-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
}

.auth-mini-list i {
  color: var(--accent-2);
}

.auth-card {
  gap: 10px;
  max-width: 520px;
  padding: 18px;
}

.auth-brand {
  display: none;
}

.auth-card h1 {
  font-size: clamp(28px, 3.2vw, 38px);
}

.auth-card form,
.auth-success {
  gap: 10px;
}

.auth-card label {
  gap: 6px;
  font-size: 13px;
}

.auth-card input,
.auth-card textarea,
.auth-card select,
.auth-card .password-toggle {
  min-height: 42px;
}

.auth-card .remember-me {
  min-height: 32px;
}

.auth-card .remember-me input {
  width: 28px;
  height: 28px;
  min-height: 28px;
  accent-color: var(--accent);
}

.auth-links {
  align-items: center;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 0;
  color: var(--link);
  font-size: 13px;
}

.auth-card .success:not(:empty),
.auth-card .error:not(:empty) {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font-weight: 800;
}

@media (max-width: 820px) {
  .public-actions {
    gap: 7px;
  }

  .public-actions .btn {
    min-height: 38px;
    padding: 8px 10px;
  }

  .public-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 12px;
  }

  .public-hero-icon {
    width: 50px;
    height: 50px;
  }

  .public-hero p {
    font-size: 15px;
  }

  .public-preview {
    padding: 10px;
  }

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

  .auth-stage,
  .auth-stage--split {
    grid-template-columns: 1fr;
    width: min(520px, calc(100% - 24px));
    place-items: start center;
    align-items: start;
    padding: 14px 0 22px;
  }

  .auth-companion {
    display: none;
  }

  .auth-card {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .public-chrome {
    min-height: 56px;
    gap: 8px;
  }

  .public-brand {
    gap: 8px;
  }

  .public-brand img {
    width: 34px;
    height: 34px;
  }

  .public-brand span {
    display: none;
  }

  .public-actions .btn {
    min-width: 38px;
    padding: 8px 9px;
  }

  .public-actions .btn i {
    display: none;
  }

  .public-home {
    width: min(100% - 20px, 520px);
    padding: 12px 0 20px;
  }

  .public-hero-copy {
    gap: 10px;
  }

  .public-hero-badge,
  .auth-kicker {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .public-hero h1,
  .auth-card h1 {
    font-size: 28px;
  }

  .public-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .public-hero-actions .btn {
    min-width: 0;
    padding-inline: 10px;
  }

  .public-proof {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }

  .preview-toolbar strong,
  .preview-toolbar span,
  .preview-toolbar span:last-child {
    justify-self: stretch;
    text-align: center;
  }

  .preview-row {
    grid-template-columns: 50px minmax(0, 1fr);
    min-height: 48px;
  }

  .preview-row em {
    display: none;
  }

  .landing-features {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 78px;
  }

  .auth-stage {
    width: min(100% - 20px, 520px);
    padding: 12px 0 20px;
  }

  .auth-card {
    padding: 14px;
  }

  .auth-card .password-field {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 7px;
  }

  .auth-card .password-toggle {
    min-width: 58px;
    padding-inline: 8px;
  }

  .auth-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .auth-links a:last-child {
    justify-self: end;
  }
}

@media (max-width: 900px) and (orientation: landscape), (max-width: 900px) and (max-height: 520px) {
  .public-chrome {
    min-height: 46px;
  }

  .public-brand img {
    width: 30px;
    height: 30px;
  }

  .public-home {
    width: min(100% - 18px, 980px);
    padding: 10px 0 14px;
  }

  .public-hero {
    grid-template-columns: minmax(0, 0.95fr) minmax(260px, 1fr);
    gap: 10px;
  }

  .public-hero-icon {
    display: none;
  }

  .public-hero h1 {
    font-size: 26px;
  }

  .public-hero p {
    font-size: 13px;
  }

  .public-proof {
    gap: 6px;
  }

  .public-proof span {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .preview-row {
    min-height: 42px;
  }

  .landing-features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .feature {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 70px;
    padding: 9px;
  }

  .feature > i {
    width: 28px;
    height: 28px;
  }

  .feature span {
    font-size: 11px;
  }

  .auth-stage,
  .auth-stage--split {
    grid-template-columns: minmax(220px, 0.82fr) minmax(360px, 1fr);
    width: min(100% - 18px, 900px);
    min-height: calc(100dvh - 46px);
    gap: 10px;
    padding: 8px 0 12px;
    align-items: center;
  }

  .auth-companion {
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .auth-companion-icon img {
    width: 42px;
    height: 42px;
  }

  .auth-companion strong {
    font-size: 18px;
  }

  .auth-companion span,
  .auth-mini-list span {
    font-size: 12px;
  }

  .auth-mini-list {
    gap: 6px;
  }

  .auth-mini-list span {
    min-height: 28px;
    padding: 5px 7px;
  }

  .auth-card {
    gap: 7px;
    padding: 10px;
  }

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

  .auth-card > .auth-help,
  .auth-card form > .auth-help,
  .auth-card form > .remember-me,
  .auth-card form > .btn,
  .auth-card form > .auth-links,
  .auth-card form > .success,
  .auth-card form > .error {
    grid-column: 1 / -1;
  }

  .auth-card h1 {
    font-size: 24px;
  }

  .auth-card input,
  .auth-card textarea,
  .auth-card select,
  .auth-card .password-toggle {
    min-height: 34px;
    padding-block: 6px;
  }
}

/* In the installed Android app, the native shell already reserves system-bar space. */
[data-environment="native-app"] a[href*="/downloads"],
.is-murtapp-native a[href*="/downloads"] {
  display: none !important;
}

[data-environment="native-app"] .bottom-tabs,
.is-murtapp-native .bottom-tabs {
  left: 0;
  right: 0;
  bottom: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 8px 8px 0 0;
}

@media (max-width: 900px) {
  [data-environment="native-app"] .content,
  .is-murtapp-native .content {
    padding-bottom: 72px;
  }

  [data-environment="native-app"] .day-slots,
  .is-murtapp-native .day-slots {
    padding-bottom: 66px;
  }
}

@media (max-width: 640px) {
  [data-environment="native-app"] .content,
  .is-murtapp-native .content {
    padding-bottom: 68px;
  }
}

/* Downloads release channel */
.downloads-page::before {
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    linear-gradient(320deg, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 44%),
    var(--app-bg);
}

.downloads-shell {
  width: min(1140px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.downloads-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.downloads-copy,
.downloads-feed-card,
.download-card {
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
  box-shadow: var(--soft-shadow);
}

.downloads-copy h1,
.download-card h2,
.downloads-feed-card h2 {
  margin: 0;
  color: var(--text);
}

.downloads-copy h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.04;
}

.downloads-copy p,
.downloads-feed-card p,
.download-summary,
.download-helper {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.downloads-proof,
.downloads-feed-actions,
.download-actions,
.download-meta,
.download-detail-grid,
.downloads-grid,
.download-card-head {
  display: flex;
  gap: 10px;
}

.downloads-proof,
.download-meta {
  flex-wrap: wrap;
}

.downloads-proof span,
.download-platform,
.download-status,
.download-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.downloads-feed-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.downloads-feed-card code,
.download-card code {
  display: block;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.downloads-grid {
  flex-wrap: wrap;
  align-items: stretch;
}

.download-card {
  display: grid;
  flex: 1 1 320px;
  gap: 14px;
  background: var(--panel);
}

.download-card-featured {
  flex-basis: 100%;
}

.download-card-head {
  justify-content: space-between;
  align-items: flex-start;
}

.download-platform {
  width: fit-content;
  margin-bottom: 10px;
  color: var(--link);
}

.download-status.ready {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, var(--panel));
}

.download-status.soon {
  color: var(--muted);
}

.download-meta span {
  display: grid;
  align-items: start;
  min-width: 152px;
  padding: 10px 12px;
}

.download-meta strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.download-meta small {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.download-actions {
  flex-wrap: wrap;
}

.download-actions .btn {
  min-height: 44px;
}

.download-detail-grid {
  align-items: start;
  flex-wrap: wrap;
}

.download-detail-grid > div {
  flex: 1 1 300px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--panel-2);
}

.download-detail-grid h3 {
  margin: 0;
  color: var(--text);
}

.download-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  gap: 8px;
}

.download-list li {
  line-height: 1.45;
}

.download-hash-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .downloads-shell {
    width: min(100% - 24px, 680px);
    padding: 16px 0 22px;
  }

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

  .download-card-head {
    display: grid;
  }
}

@media (max-width: 520px) {
  .downloads-shell {
    width: min(100% - 20px, 520px);
    padding: 12px 0 20px;
  }

  .downloads-copy,
  .downloads-feed-card,
  .download-card {
    padding: 14px;
  }

  .download-actions,
  .downloads-feed-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .download-actions .btn,
  .downloads-feed-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.settings-hero {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.settings-hero h2,
.settings-hero p,
.settings-hero span,
.settings-panel-head h3,
.settings-panel-head p {
  margin: 0;
}

.settings-hero h2 {
  font-size: 28px;
  line-height: 1.1;
}

.settings-hero span,
.settings-panel-head p {
  color: var(--muted);
  line-height: 1.45;
}

.settings-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel, var(--surface));
}

.settings-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.settings-tabs button.active {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2, var(--surface-2)));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--text);
}

.settings-tabs i {
  color: var(--accent);
}

.settings-panels,
.settings-panel,
.settings-panel-grid {
  min-width: 0;
}

.settings-panel {
  display: grid;
  gap: 12px;
}

.settings-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.settings-panel-head h3 {
  font-size: 20px;
}

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

.settings-account-card {
  max-width: 980px;
}

.settings-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.settings-card-head h3,
.settings-card-head p,
.calendar-editor-card h3,
.settings-subcopy {
  margin: 0;
}

.settings-card-head p,
.settings-subcopy {
  color: var(--muted);
  line-height: 1.45;
}

.settings-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 12px;
  min-width: 0;
}

.calendar-manager-card,
.calendar-editor-card,
.calendar-share-card,
.app-settings-card,
.super-admin-native-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

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

.settings-calendar-list,
.share-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-calendar-card {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 10px;
  background: var(--panel-2, var(--surface-2));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.settings-calendar-card.active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2, var(--surface-2)));
}

.settings-calendar-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

.settings-calendar-swatch {
  width: 14px;
  height: 44px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 24%, transparent);
}

.settings-calendar-copy,
.share-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-calendar-copy strong,
.settings-calendar-copy small,
.share-copy strong,
.share-copy small,
.settings-calendar-meta,
.share-permission {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-calendar-copy small,
.share-copy small,
.settings-calendar-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-calendar-meta,
.share-permission {
  padding: 6px 8px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 999px;
  background: var(--panel, var(--surface));
}

.calendar-editor-card form,
.calendar-share-card form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.calendar-editor-actions .btn,
.calendar-share-card .button-row .btn {
  flex: 1 1 150px;
  justify-content: center;
}

.share-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-2, var(--surface-2)) 86%, var(--accent) 5%);
}

.share-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel, var(--surface)));
  color: var(--accent);
}

.settings-empty-copy {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--hairline, var(--border));
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.45;
  background: color-mix(in srgb, var(--panel-2, var(--surface-2)) 82%, transparent);
}

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

.settings-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 8px;
}

.settings-option-grid label,
.settings-grid label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel-2, var(--surface-2));
}

.settings-option-grid input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
}

.settings-subpanel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 6%);
}

.settings-subpanel h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  text-transform: none;
}

.account-deletion-subpanel {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--hairline, var(--border)));
  background: color-mix(in srgb, var(--surface) 84%, var(--danger) 6%);
}

.privacy-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.privacy-action-row .btn {
  min-width: 0;
  justify-content: center;
}

#account-deletion-message {
  margin: 0;
  min-height: 1.2em;
}

.impersonation-banner,
.admin-impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--hairline, var(--border)) 68%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 82%, var(--accent) 18%);
}

.impersonation-banner-copy,
.admin-impersonation-banner > div {
  display: grid;
  gap: 4px;
}

.impersonation-banner strong,
.admin-impersonation-banner strong {
  font-size: 15px;
}

.impersonation-banner span,
.admin-impersonation-banner span {
  color: var(--muted);
  line-height: 1.45;
}

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 32rem),
    var(--bg);
}

.admin-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 28px;
}

.admin-chrome,
.admin-hero,
.admin-dashboard {
  min-width: 0;
}

.admin-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 5%);
}

.admin-brand,
.admin-user-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--text);
}

.admin-brand span:last-child,
.admin-user-chip span {
  display: grid;
  min-width: 0;
}

.admin-brand strong,
.admin-brand small,
.admin-user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-brand small {
  color: var(--muted);
  font-weight: 750;
}

.admin-user-chip {
  max-width: min(42vw, 360px);
  padding: 9px 11px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel-2, var(--surface-2));
  font-weight: 850;
}

.admin-user-chip i {
  color: var(--accent);
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-hero h1,
.admin-hero p,
.admin-hero span,
.admin-panel h2,
.admin-panel p {
  margin: 0;
}

.admin-hero h1 {
  font-size: 34px;
  line-height: 1.05;
}

.admin-hero span,
.admin-panel p,
.admin-stat-list small {
  color: var(--muted);
  line-height: 1.45;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 12px;
  align-items: start;
}

.admin-dashboard-secondary {
  margin-top: 12px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-stat-card {
  display: grid;
  gap: 6px;
}

.admin-stat-card small,
.admin-user-card small,
.admin-user-form-meta small,
.admin-user-summary {
  color: var(--muted);
}

.admin-stat-card strong {
  font-size: 30px;
  line-height: 1;
}

.admin-panel {
  display: grid;
  gap: 12px;
}

.admin-panel-primary {
  min-height: 360px;
}

.admin-panel-head,
.admin-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.admin-panel-head > div,
.admin-toolbar label {
  min-width: 0;
}

.admin-toolbar label {
  flex: 1 1 220px;
}

.admin-toolbar label input,
.admin-toolbar label select,
.admin-form-grid input,
.admin-form-grid select {
  width: 100%;
}

.admin-user-summary {
  font-weight: 800;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-card,
.admin-user-empty {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 12px;
  background: var(--panel);
}

.admin-user-card {
  cursor: pointer;
}

.admin-user-card.active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--hairline, var(--border)) 56%);
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
}

.admin-user-card-head,
.admin-user-card-actions,
.admin-user-card-badges,
.admin-user-card-meta,
.admin-form-actions,
.admin-user-form-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-card-head {
  align-items: start;
  justify-content: space-between;
}

.admin-user-card-head strong,
.admin-user-card-head small,
.admin-user-card-meta span,
.admin-user-form-meta span {
  display: block;
}

.admin-user-card-meta span,
.admin-user-form-meta span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 999px;
  background: var(--panel-2, var(--surface-2));
  font-size: 12px;
  font-weight: 800;
}

.admin-user-card-meta i,
.admin-user-form-meta strong {
  margin-right: 6px;
}

.admin-user-card-actions {
  justify-content: flex-end;
}

.admin-user-card-actions .btn {
  min-height: 38px;
}

.admin-user-detail-panel {
  align-content: start;
}

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

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

.admin-password-field {
  grid-column: 1 / -1;
}

.admin-mail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.admin-mail-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel-2, var(--surface-2));
}

.admin-mail-list li > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-mail-list strong,
.admin-mail-list small,
.admin-mail-list em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-mail-list strong {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-mail-list small {
  color: var(--muted);
  font-weight: 750;
}

.admin-mail-list em {
  color: var(--danger);
  font-style: normal;
  font-size: 12px;
}

.admin-mail-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}

.admin-mail-empty {
  display: block !important;
  color: var(--muted);
  font-weight: 800;
}

.admin-stat-list {
  display: grid;
  gap: 8px;
}

.admin-stat-list span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel-2, var(--surface-2));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10000;
  max-width: min(92vw, 520px);
  padding: 11px 14px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 850;
}

.toast.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

@media (max-width: 900px) {
  .action-toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 10080;
  }

  .offline-sync-banner {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .keyboard-open .action-toast,
  .keyboard-open .offline-sync-banner {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .keyboard-open .modal {
    align-items: flex-start;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  .keyboard-open .entry-create-content,
  .keyboard-open .entry-detail-content {
    max-height: calc(100dvh - 16px);
    transform: none;
  }

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

  .settings-panel-grid,
  .settings-calendar-layout,
  .settings-form-grid,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

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

  .admin-panel-head,
  .admin-toolbar {
    display: grid;
    align-items: stretch;
  }

  .admin-panel-head .btn,
  .admin-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

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

@media (max-width: 560px) {
  .settings-hero h2,
  .admin-hero h1 {
    font-size: 24px;
  }

  .settings-tabs {
    gap: 6px;
    padding: 6px;
  }

  .settings-tabs button {
    display: grid;
    gap: 4px;
    min-height: 50px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .settings-panel-head,
  .settings-card-head,
  .admin-hero,
  .admin-chrome {
    display: grid;
    align-items: stretch;
  }

  .settings-card-head .btn {
    width: 100%;
    justify-content: center;
  }

  .settings-calendar-card,
  .share-card {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .settings-calendar-meta,
  .share-permission {
    grid-column: 2;
    justify-self: start;
  }

  .admin-shell {
    width: min(100% - 20px, 560px);
    padding-bottom: 20px;
  }

  .admin-user-chip {
    max-width: 100%;
  }

  .admin-hero .btn {
    width: 100%;
    justify-content: center;
  }

  .impersonation-banner,
  .admin-impersonation-banner {
    display: grid;
  }

  .admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-mail-list li {
    grid-template-columns: 1fr;
  }

  .admin-user-card-actions,
  .admin-user-card-badges,
  .admin-user-form-meta {
    display: grid;
  }
}

.public-legal-footer {
  width: min(100% - 32px, 1180px);
  margin: 18px auto max(18px, env(safe-area-inset-bottom));
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 4%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.public-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.public-legal-footer a {
  color: var(--text);
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 30rem),
    var(--bg);
}

.legal-shell {
  width: min(100% - 32px, 1060px);
  margin: 0 auto;
  padding: 12px 0 0;
}

.legal-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 4%);
}

.legal-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
  font-size: 24px;
}

.legal-hero h1,
.legal-hero p,
.legal-hero span,
.legal-card h2,
.legal-card ul,
.legal-contact-card strong,
.legal-contact-card small {
  margin: 0;
}

.legal-hero h1 {
  font-size: 32px;
  line-height: 1.05;
}

.legal-hero span,
.legal-hero small,
.legal-card li,
.legal-contact-card small {
  color: var(--muted);
  line-height: 1.48;
}

.legal-hero > small {
  justify-self: end;
  padding: 8px 10px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--panel-2, var(--surface-2));
  color: var(--text);
  font-weight: 850;
  white-space: nowrap;
}

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

.legal-card {
  padding: 16px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: var(--surface);
}

.legal-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.legal-card ul {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.legal-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--hairline, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-2) 7%);
}

.legal-contact-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 20%, var(--surface));
  color: var(--accent-2);
}

.legal-contact-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.legal-contact-card .btn {
  flex: 0 0 auto;
}

.auth-legal-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-legal-note a {
  color: var(--link);
  font-weight: 850;
}

@media (max-width: 760px) {
  .public-legal-footer,
  .legal-hero,
  .legal-grid,
  .legal-contact-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .public-legal-footer {
    width: min(100% - 20px, 760px);
  }

  .legal-shell {
    width: min(100% - 20px, 760px);
  }

  .legal-hero > small {
    justify-self: start;
  }

  .legal-contact-card .btn {
    width: 100%;
  }

  .legal-hero h1 {
    font-size: 26px;
  }
}

@media (max-width: 520px) {
  .public-chrome {
    align-items: flex-start;
  }

  .public-actions {
    max-width: min(64vw, 270px);
  }

  .public-legal-footer nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .public-legal-footer span {
    display: block;
  }
}

.entry-detail-content .entry-edit-actions,
.entry-create-content .entry-create-actions {
  display: grid !important;
  flex-direction: unset !important;
  align-items: stretch !important;
}

.entry-detail-content .entry-edit-actions {
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) !important;
}

.entry-create-content .entry-create-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.entry-detail-content .entry-edit-actions .btn,
.entry-create-content .entry-create-actions .btn {
  width: 100% !important;
  justify-content: center !important;
}

.entry-detail-content .entry-edit-actions .entry-delete-icon {
  width: 52px !important;
}

button > span,
.btn > span,
.nav-item > span,
.tab > span,
.menu-action > span,
.period-step > span,
.period-today > span,
.calendar-create-btn > span {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

.help-page {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 84%, transparent), var(--bg) 360px);
}

.help-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 26px 0 56px;
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  min-height: 420px;
}

.help-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  padding: 28px 0;
}

.help-hero h1,
.help-section-head h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.02;
}

.help-hero h1 {
  max-width: 780px;
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 850;
}

.help-hero p,
.help-section-head p,
.help-type-card p,
.help-advanced-grid p,
.help-trouble-grid li,
.help-steps p,
.help-guide-list li {
  color: var(--muted);
}

.help-hero p {
  max-width: 680px;
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
}

.help-hero-actions,
.help-preview-top,
.help-preview-line,
.help-jump,
.help-type-card strong,
.help-guide-list summary,
.help-advanced-grid article,
.help-trouble-grid article {
  display: flex;
  align-items: center;
}

.help-hero-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.help-preview {
  align-self: center;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  box-shadow: var(--shadow);
  min-width: 0;
}

.help-preview-top {
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 12px;
  color: var(--muted);
  font-size: 13px;
}

.help-preview-top strong {
  color: var(--text);
  font-size: 15px;
}

.help-preview-line {
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.help-preview-line span,
.help-preview-line em,
.help-preview-queue span {
  color: var(--muted);
}

.help-preview-line span {
  font-weight: 800;
}

.help-preview-line strong {
  flex: 1;
  color: var(--text);
}

.help-preview-line em {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.help-preview-line.fixed {
  border-left: 4px solid var(--accent-2);
}

.help-preview-line.flex {
  border-left: 4px solid var(--accent);
}

.help-preview-queue {
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
}

.help-preview-queue strong,
.help-preview-queue span {
  display: block;
}

.help-preview-queue strong {
  margin-bottom: 4px;
  color: var(--text);
}

.help-jump {
  position: sticky;
  top: 10px;
  z-index: 6;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 30px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.help-jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.help-section {
  scroll-margin-top: 94px;
  padding: 34px 0;
}

.help-section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.help-section-head h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.help-steps,
.help-type-grid,
.help-advanced-grid,
.help-trouble-grid {
  display: grid;
  gap: 12px;
}

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

.help-steps article,
.help-type-card,
.help-guide-list details,
.help-advanced-grid article,
.help-trouble-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}

.help-steps article {
  padding: 18px;
}

.help-steps article > span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 900;
}

.help-steps h3,
.help-type-card h3,
.help-advanced-grid h3,
.help-trouble-grid h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.help-steps p,
.help-type-card p,
.help-advanced-grid p {
  margin: 0;
  line-height: 1.55;
}

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

.help-type-card {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.help-type-card > i {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 22px;
}

.help-type-card.fixed > i {
  color: var(--accent-2);
}

.help-type-card.alarm > i {
  color: var(--danger);
}

.help-type-card strong {
  min-height: 28px;
  color: var(--text);
}

.help-type-card ul,
.help-trouble-grid ul {
  margin: 0;
  padding-left: 18px;
}

.help-type-card li,
.help-trouble-grid li {
  margin: 8px 0;
  line-height: 1.45;
}

.help-guide-list {
  display: grid;
  gap: 10px;
}

.help-guide-list details {
  overflow: hidden;
}

.help-guide-list summary {
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 0 18px;
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.help-guide-list summary::-webkit-details-marker {
  display: none;
}

.help-guide-list details[open] summary {
  border-bottom: 1px solid var(--border);
}

.help-guide-list details[open] summary i {
  transform: rotate(180deg);
}

.help-guide-list ol {
  margin: 0;
  padding: 18px 18px 18px 42px;
}

.help-guide-list li {
  margin: 0 0 10px;
  line-height: 1.55;
}

.help-guide-list li:last-child {
  margin-bottom: 0;
}

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

.help-advanced-grid article {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
}

.help-advanced-grid i {
  color: var(--accent);
  font-size: 22px;
}

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

.help-trouble-grid article {
  align-items: stretch;
  flex-direction: column;
  padding: 18px;
}

@media (max-width: 940px) {
  .help-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .help-preview {
    max-width: 640px;
  }

  .help-steps,
  .help-type-grid,
  .help-advanced-grid,
  .help-trouble-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .help-shell {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .help-hero-copy {
    padding: 18px 0;
  }

  .help-hero h1 {
    font-size: 34px;
  }

  .help-hero p {
    font-size: 16px;
  }

  .help-hero-actions .btn,
  .help-jump a {
    width: 100%;
    justify-content: center;
  }

  .help-jump {
    position: static;
  }

  .help-steps,
  .help-type-grid,
  .help-advanced-grid,
  .help-trouble-grid {
    grid-template-columns: 1fr;
  }

  .help-preview-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .help-guide-list summary {
    min-height: 58px;
    padding: 0 14px;
  }

  .help-guide-list ol {
    padding: 16px 16px 16px 36px;
  }
}
