:root {
  color-scheme: light;
  --accent: #0071e3;
  --accent-dark: #0062c4;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgba(60, 60, 67, 0.14);
  --surface: rgba(255, 255, 255, 0.82);
  --sidebar: rgba(244, 244, 246, 0.78);
  --shadow: 0 28px 80px rgba(34, 45, 70, 0.18), 0 3px 12px rgba(34, 45, 70, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: #f2f4f8;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.macos-dashboard .ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: .52;
}
.macos-dashboard .ambient-one { top: -14rem; left: -10rem; background: radial-gradient(circle, #b9ddff 0, rgba(185,221,255,0) 70%); }
.macos-dashboard .ambient-two { right: -12rem; bottom: -16rem; background: radial-gradient(circle, #cfeadd 0, rgba(207,234,221,0) 70%); }

.macos-dashboard .app-window {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: 68px minmax(calc(100vh - 116px), auto);
  width: min(1460px, calc(100% - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: hidden;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.macos-dashboard .titlebar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: center;
  padding: 0 20px;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 10;
}

.macos-dashboard .window-controls { display: flex; align-items: center; gap: 8px; }
.macos-dashboard .window-controls .control { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.macos-dashboard .window-controls .control.close { background: #ff5f57; }
.macos-dashboard .window-controls .control.minimize { background: #febc2e; }
.macos-dashboard .window-controls .control.maximize { background: #28c840; }

.macos-dashboard .brand { justify-self: center; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.macos-dashboard .brand img { width: 34px; height: 34px; object-fit: cover; object-position: center 38%; border-radius: 9px; }

.macos-dashboard .title-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.macos-dashboard .icon-button, .macos-dashboard .avatar, .macos-dashboard .view-control {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.76);
  color: #4d4d52;
  cursor: pointer;
  transition: .2s ease;
}
.macos-dashboard .icon-button { width: 36px; height: 36px; border-radius: 11px; }
.macos-dashboard .icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.macos-dashboard .status-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; border: 1.5px solid white; }
.macos-dashboard .avatar { width: 36px; height: 36px; border: 0; border-radius: 50%; color: white; background: linear-gradient(145deg, #4f8fd6, #075bab); font-size: 13px; font-weight: 700; }

.macos-dashboard .sidebar {
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--hairline);
}
.macos-dashboard .sidebar nav { display: grid; gap: 4px; }
.macos-dashboard .nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 12px; border-radius: 10px; color: #4f4f54; text-decoration: none; font-size: 15px; font-weight: 520; transition: .18s ease; }
.macos-dashboard .nav-item:hover { background: rgba(0,0,0,.045); }
.macos-dashboard .nav-item.active { color: white; background: linear-gradient(180deg, #1485f6, #0071e3); box-shadow: 0 5px 12px rgba(0,113,227,.24); }
.macos-dashboard .nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.macos-dashboard .sidebar-section { margin-top: 30px; }
.macos-dashboard .sidebar-section > p { margin: 0 12px 7px; color: #8b8b90; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.macos-dashboard .sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.macos-dashboard .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,.14); }

.macos-dashboard main { min-width: 0; padding: 46px clamp(24px, 4vw, 64px) 56px; background: rgba(250,250,252,.56); }
.macos-dashboard .welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.macos-dashboard .eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 12px; font-weight: 720; letter-spacing: .11em; }
.macos-dashboard h1, .macos-dashboard h2, .macos-dashboard p { margin-top: 0; }
.macos-dashboard h1 { margin-bottom: 7px; font-size: clamp(32px, 4vw, 48px); line-height: 1.06; letter-spacing: -.045em; font-weight: 720; }
.macos-dashboard .intro { margin-bottom: 0; color: var(--muted); font-size: 17px; }
.macos-dashboard .welcome time { color: var(--muted); font-size: 14px; white-space: nowrap; }

.macos-dashboard .command-center { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 14px; align-items: center; padding: 14px; margin-bottom: 42px; border: 1px solid rgba(255,255,255,.92); border-radius: 18px; background: rgba(255,255,255,.72); box-shadow: 0 10px 28px rgba(47,61,87,.09); backdrop-filter: blur(20px); }
.macos-dashboard .spotlight { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 15px; background: #f1f1f4; border: 1px solid rgba(0,0,0,.05); border-radius: 13px; }
.macos-dashboard .spotlight:focus-within { border-color: rgba(0,113,227,.5); box-shadow: 0 0 0 4px rgba(0,113,227,.1); background: white; }
.macos-dashboard .spotlight svg { width: 21px; fill: none; stroke: #77777c; stroke-width: 2; stroke-linecap: round; }
.macos-dashboard .spotlight input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.macos-dashboard .spotlight input::placeholder { color: #929297; }
.macos-dashboard kbd { padding: 3px 7px; border: 1px solid rgba(0,0,0,.08); border-radius: 6px; background: white; color: #77777c; box-shadow: 0 1px 1px rgba(0,0,0,.06); font: 12px -apple-system, BlinkMacSystemFont, sans-serif; }
.macos-dashboard .scan-actions { display: flex; gap: 10px; }
.macos-dashboard .secondary-button, .macos-dashboard .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 17px; border-radius: 12px; font-weight: 620; font-size: 14px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.macos-dashboard .secondary-button { border: 1px solid var(--hairline); background: white; color: #36363a; }
.macos-dashboard .primary-button { border: 1px solid transparent; background: linear-gradient(180deg, #1787f6, #0071e3); color: white; box-shadow: 0 7px 16px rgba(0,113,227,.22); }
.macos-dashboard .secondary-button svg, .macos-dashboard .primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.macos-dashboard .secondary-button:hover, .macos-dashboard .primary-button:hover { transform: translateY(-1px); }
.macos-dashboard .primary-button:hover { background: linear-gradient(180deg, #0d7fee, #0068d2); }

.macos-dashboard .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.macos-dashboard .section-heading h2 { margin-bottom: 3px; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
.macos-dashboard .section-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.macos-dashboard .view-control { width: 36px; height: 36px; border-radius: 10px; color: var(--accent); }
.macos-dashboard .view-control svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.macos-dashboard .service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.macos-dashboard .service-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 92px; padding: 15px; color: var(--text); text-decoration: none; border: 1px solid rgba(255,255,255,.92); border-radius: 17px; background: rgba(255,255,255,.78); box-shadow: 0 5px 16px rgba(47,61,87,.065); transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.macos-dashboard .service-card:hover { transform: translateY(-2px); background: white; box-shadow: 0 10px 24px rgba(47,61,87,.12); }
.macos-dashboard .service-card strong, .macos-dashboard .service-card small { display: block; }
.macos-dashboard .service-card strong { margin-bottom: 2px; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.macos-dashboard .service-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.macos-dashboard .service-card b { color: #aaaab0; font-size: 25px; font-weight: 350; }
.macos-dashboard .service-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: white; font-size: 15px; font-weight: 720; letter-spacing: -.03em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 5px 12px rgba(0,0,0,.12); }
.macos-dashboard .service-icon.blue { background: linear-gradient(145deg, #36a0ff, #0071e3); }
.macos-dashboard .service-icon.cyan { background: linear-gradient(145deg, #67d4e7, #20a6c7); font-size: 25px; }
.macos-dashboard .service-icon.indigo { background: linear-gradient(145deg, #7388ff, #4256d7); font-size: 23px; }
.macos-dashboard .service-icon.orange { background: linear-gradient(145deg, #ffb64b, #f37d0f); font-size: 22px; }
.macos-dashboard .service-icon.purple { background: linear-gradient(145deg, #b889f8, #7e4fd3); font-size: 21px; }
.macos-dashboard .service-icon.teal { background: linear-gradient(145deg, #48d7bf, #15947f); font-size: 23px; }
.macos-dashboard .service-icon.green { background: linear-gradient(145deg, #62d37d, #21a64b); font-size: 22px; }
.macos-dashboard .service-icon.sky { background: linear-gradient(145deg, #5cc5ff, #268bc8); }
.macos-dashboard .service-icon.red { background: linear-gradient(145deg, #ff6b65, #db3831); font-size: 23px; }
.macos-dashboard .service-icon.slate { background: linear-gradient(145deg, #8c99aa, #566273); font-size: 22px; }
.macos-dashboard .service-icon.rose { background: linear-gradient(145deg, #ff7599, #db3e6d); font-size: 18px; }
.macos-dashboard .service-icon.yellow { background: linear-gradient(145deg, #ffd95c, #e9a91f); font-size: 22px; }
.macos-dashboard .service-icon.graphite { background: linear-gradient(145deg, #5d6571, #292d34); font-size: 20px; }
.macos-dashboard .admin-card { border-color: rgba(0,113,227,.2); background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(235,244,255,.9)); }
.macos-dashboard .admin-nav { color: #6646a3; }

/* Shared macOS treatment for the rest of the Flask application. */
body:not(.macos-dashboard) {
  min-height: 100vh !important;
  margin: 0 !important;
  color: #1d1d1f !important;
  background:
    radial-gradient(900px 520px at -5% -10%, rgba(153,207,255,.42), transparent 65%),
    radial-gradient(850px 520px at 105% 105%, rgba(170,226,205,.32), transparent 66%),
    #f3f5f8 !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
body.macos-themed {
  --primary-color: #0071e3;
  --secondary-color: #5ac8fa;
  --warning-color: #b56b00;
  --danger-color: #ff3b30;
  --bg: #f3f5f8;
  --surface: rgba(255,255,255,.86);
  --surface-strong: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(60,60,67,.16);
  --mono: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
body.macos-themed::before { display: none !important; }
body:not(.macos-dashboard) h1,
body:not(.macos-dashboard) h2,
body:not(.macos-dashboard) h3 { color: #1d1d1f; letter-spacing: -.025em; }
body:not(.macos-dashboard) a { text-underline-offset: 3px; }
body:not(.macos-dashboard) button,
body:not(.macos-dashboard) input[type="submit"],
body:not(.macos-dashboard) input[type="button"],
body:not(.macos-dashboard) .btn {
  min-height: 42px;
  border-radius: 11px !important;
  font-weight: 620;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
body:not(.macos-dashboard) button:hover,
body:not(.macos-dashboard) input[type="submit"]:hover,
body:not(.macos-dashboard) .btn:hover { transform: translateY(-1px); }
body:not(.macos-dashboard) form > button[type="submit"]:not(.danger):not(.btn-danger):not(.btn-success):not(.btn-warning),
body:not(.macos-dashboard) input[type="submit"]:not(.danger):not(.btn-danger):not(.btn-success):not(.btn-warning) {
  border: 1px solid transparent !important;
  background: linear-gradient(180deg, #1687f6, #0071e3) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(0,113,227,.2) !important;
}
body:not(.macos-dashboard) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body:not(.macos-dashboard) select,
body:not(.macos-dashboard) textarea {
  max-width: 100%;
  min-height: 42px;
  border: 1px solid rgba(60,60,67,.2) !important;
  border-radius: 11px !important;
  background-color: rgba(255,255,255,.88) !important;
  color: #1d1d1f !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.035);
}
body.complaint-edit-page input.control,
body.complaint-edit-page select.control,
body.complaint-edit-page textarea.control { width: 100%; }
body.complaint-edit-page textarea.control { min-height: 140px; resize: vertical; }
body:not(.macos-dashboard) input:focus,
body:not(.macos-dashboard) select:focus,
body:not(.macos-dashboard) textarea:focus {
  outline: none !important;
  border-color: rgba(0,113,227,.6) !important;
  box-shadow: 0 0 0 4px rgba(0,113,227,.12) !important;
}
body:not(.macos-dashboard) .card,
body:not(.macos-dashboard) .panel,
body:not(.macos-dashboard) .form-section,
body:not(.macos-dashboard) .content-card,
body:not(.macos-dashboard) .modal-content {
  border: 1px solid rgba(255,255,255,.88) !important;
  border-radius: 18px !important;
  background-color: rgba(255,255,255,.84) !important;
  box-shadow: 0 10px 28px rgba(47,61,87,.1) !important;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
body:not(.macos-dashboard) .wrap { width: min(1180px, calc(100% - 28px)); margin: 22px auto 64px; }
body:not(.macos-dashboard) .topbar {
  border: 1px solid rgba(255,255,255,.9) !important;
  background: rgba(255,255,255,.82) !important;
  color: #1d1d1f !important;
  box-shadow: 0 12px 34px rgba(47,61,87,.11) !important;
  backdrop-filter: blur(20px) saturate(150%);
}
body:not(.macos-dashboard) .title,
body:not(.macos-dashboard) .card h2,
body:not(.macos-dashboard) .record-title { color: #1d1d1f !important; text-shadow: none !important; text-transform: none !important; }
body:not(.macos-dashboard) .sub,
body:not(.macos-dashboard) .meta,
body:not(.macos-dashboard) .note,
body:not(.macos-dashboard) label { color: #6e6e73 !important; }
body:not(.macos-dashboard) .prompt::before { color: #0071e3 !important; }
body:not(.macos-dashboard) .nav-actions a,
body:not(.macos-dashboard) a.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning) {
  border: 1px solid rgba(60,60,67,.16) !important;
  background: rgba(255,255,255,.9) !important;
  color: #0071e3 !important;
  box-shadow: none !important;
}
body.complaint-edit-page .thumb-actions button[type="submit"],
body.complaint-edit-page form > button.btn.danger[type="submit"] {
  border-color: #fecaca !important;
  background: #fff !important;
  color: #b42318 !important;
  box-shadow: none !important;
}
body:not(.macos-dashboard) table { max-width: 100%; background: rgba(255,255,255,.88); }
body:not(.macos-dashboard) th { background: #eef1f5 !important; color: #36363a !important; }
body:not(.macos-dashboard) th,
body:not(.macos-dashboard) td { border-color: rgba(60,60,67,.14) !important; }
.macos-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.macos-table-scroll > table { min-width: max-content; margin-bottom: 0; }
body:not(.macos-dashboard) img:not(.leaflet-tile),
body:not(.macos-dashboard) video,
body:not(.macos-dashboard) iframe { max-width: 100%; }
body:not(.macos-dashboard) nav,
body:not(.macos-dashboard) .navbar {
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* Disable legacy Matrix/Stargate and Garouche Electronics idle screensavers. */
#matrix-rain, #matrix-message, #admin-idle-message { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
body.matrix-screensaver-active,
body.admin-idle-locked { overflow: auto !important; background: #f3f5f8 !important; }
body.matrix-screensaver-active > *,
body.admin-idle-locked > * { visibility: visible !important; opacity: 1 !important; filter: none !important; pointer-events: auto !important; }
#matrix-rain, #matrix-message, #admin-idle-message { pointer-events: none !important; }

.notification-bubble {
  position: fixed; top: 82px; right: 28px; z-index: 3000; width: min(340px, calc(100vw - 32px));
  padding: 16px 42px 16px 17px; border: 1px solid rgba(255,255,255,.9); border-radius: 16px;
  background: rgba(255,255,255,.9); box-shadow: 0 18px 50px rgba(28,38,57,.2); backdrop-filter: blur(22px);
}
.notification-bubble + .notification-bubble { top: 210px; }
.notification-bubble strong, .notification-bubble small { display: block; }
.notification-bubble small { margin: 3px 0 8px; color: var(--muted); }
.notification-bubble p { margin: 0; }
.dismiss-btn { position: absolute; top: 9px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #ececf0; color: #65656a; font-size: 20px; cursor: pointer; }

#spinner-overlay { position: fixed; inset: 0; z-index: 5000; display: none; place-items: center; background: rgba(245,247,250,.74); backdrop-filter: blur(8px); }
#spinner-overlay .spinner { width: 46px; height: 46px; border: 4px solid rgba(0,113,227,.18); border-top-color: var(--accent); border-radius: 50%; animation: mac-spin .8s linear infinite; }
@keyframes mac-spin { to { transform: rotate(360deg); } }
.command-center > video, .command-center > canvas { grid-column: 1 / -1; width: min(100%, 520px); margin: 0 auto; border-radius: 14px; }

.autocomplete { position: relative; }
.autocomplete-list { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 200; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--hairline); border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: 0 16px 38px rgba(34,45,70,.18); }
.autocomplete-list:empty { display: none; }
.autocomplete-list li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.autocomplete-list li:hover { background: #edf5ff; }
.autocomplete-list img.thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.autocomplete-list .type-label { color: var(--accent); font-size: 12px; font-weight: 700; }

#task-toggle-btn { position: fixed; right: 30px; bottom: 28px; z-index: 2100; width: 54px; height: 54px; border: 0; border-radius: 17px; background: linear-gradient(180deg,#1687f6,#0071e3); color: white; box-shadow: 0 12px 28px rgba(0,113,227,.32); font-size: 24px; cursor: pointer; }
#drawer-backdrop { position: fixed; inset: 0; z-index: 2190; background: rgba(25,28,35,.22); backdrop-filter: blur(3px); opacity: 0 !important; visibility: hidden; pointer-events: none !important; transition: opacity .22s ease, visibility 0s linear .22s; }
#drawer-backdrop.open { opacity: 1 !important; visibility: visible; pointer-events: auto !important; transition-delay: 0s; }
#task-drawer { position: fixed; top: 16px; right: 16px !important; bottom: 16px; left: auto !important; z-index: 2200; display: flex; flex-direction: column; width: min(390px, calc(100vw - 32px)); height: auto !important; max-width: none !important; padding: 20px; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: rgba(250,250,252,.96); box-shadow: 0 24px 70px rgba(22,31,50,.28); opacity: 0 !important; visibility: hidden; pointer-events: none !important; transform: translate3d(calc(100% + 48px),0,0) !important; transition: transform .25s ease, opacity .2s ease, visibility 0s linear .25s; }
#task-drawer.open { opacity: 1 !important; visibility: visible; pointer-events: auto !important; transform: translate3d(0,0,0) !important; transition-delay: 0s; }
#task-drawer header { display: flex; align-items: start; justify-content: space-between; margin-bottom: 16px; }
#task-drawer header small { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
#task-drawer h2 { margin: 2px 0 0; font-size: 25px; }
#close-drawer { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e7e7eb; color: #55555a; font-size: 21px; cursor: pointer; }
#task-list { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
#task-list li { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: white; }
#task-list li span { flex: 1; }
#task-list li span.done { color: var(--muted); text-decoration: line-through; }
#task-list .del-btn { border: 0; background: transparent; color: #ff3b30; font-size: 20px; cursor: pointer; }
#task-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 12px; }
#task-form input { min-width: 0; padding: 11px 12px; border: 1px solid var(--hairline); border-radius: 11px; }
#task-form button { padding: 0 17px; border: 0; border-radius: 11px; background: var(--accent); color: white; font-weight: 650; }

/* Calendar: light, focused and readable on desktop and mobile. */
body.macos-calendar { padding: 0 0 28px !important; }
.macos-calendar .calendar-nav {
  position: sticky; top: 0; z-index: 1200;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: min(1500px, calc(100% - 28px)); min-height: 58px; margin: 14px auto 0; padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.9); border-radius: 17px;
  background: rgba(255,255,255,.86) !important; color: #1d1d1f !important;
  box-shadow: 0 12px 34px rgba(47,61,87,.11);
  backdrop-filter: blur(22px) saturate(155%); -webkit-backdrop-filter: blur(22px) saturate(155%);
}
.macos-calendar .calendar-nav strong { justify-self: center; font-size: 17px; letter-spacing: -.02em; }
.macos-calendar .calendar-nav a { display: inline-flex; align-items: center; width: max-content; min-height: 38px; padding: 0 13px; border-radius: 10px; color: #0071e3 !important; background: #edf5ff; font-size: 14px; font-weight: 650; text-decoration: none; }
.macos-calendar .calendar-nav a:last-child { justify-self: end; color: #5b5b60 !important; background: #f1f1f4; }
.macos-calendar .calendar-controls {
  display: grid; grid-template-columns: minmax(220px,1fr) minmax(220px,1fr); gap: 12px;
  width: min(1500px, calc(100% - 28px)); margin: 14px auto; padding: 14px;
  border: 1px solid rgba(255,255,255,.9); border-radius: 17px; background: rgba(255,255,255,.8);
  box-shadow: 0 8px 24px rgba(47,61,87,.08); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.macos-calendar .calendar-controls > div { min-width: 0; }
.macos-calendar .calendar-controls label { display: block; margin: 0 0 6px; color: #6e6e73 !important; font-size: 11px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.macos-calendar .calendar-controls input,
.macos-calendar .calendar-controls select { width: 100% !important; margin: 0 !important; padding: 0 12px !important; }
.macos-calendar .calendar-surface {
  width: min(1500px, calc(100% - 28px)); height: calc(100vh - 190px) !important; min-height: 620px;
  margin: 0 auto; padding: 15px; overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.92); border-radius: 20px; background: rgba(255,255,255,.9);
  box-shadow: 0 18px 55px rgba(38,50,73,.14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.macos-calendar .fc { height: 100%; color: #1d1d1f; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; }
.macos-calendar .fc .fc-toolbar-title { color: #1d1d1f; font-size: clamp(20px,2.1vw,28px); font-weight: 720; letter-spacing: -.035em; }
.macos-calendar .fc .fc-button { min-height: 38px; border-radius: 10px !important; box-shadow: none !important; font-size: 13px; font-weight: 650; text-transform: capitalize; }
.macos-calendar .fc .fc-button-primary { border-color: #0071e3 !important; background: #0071e3 !important; color: #fff !important; }
.macos-calendar .fc .fc-button-primary:not(:disabled):hover { border-color: #0062c4 !important; background: #0068d2 !important; }
.macos-calendar .fc .fc-button-primary:disabled { opacity: .55; }
.macos-calendar .fc-theme-standard .fc-scrollgrid,
.macos-calendar .fc-theme-standard td,
.macos-calendar .fc-theme-standard th { border-color: rgba(60,60,67,.13) !important; }
.macos-calendar .fc .fc-col-header-cell { background: #f5f6f8 !important; }
.macos-calendar .fc .fc-col-header-cell-cushion { padding: 9px 4px; color: #6e6e73; font-size: 11px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.macos-calendar .fc .fc-daygrid-day.fc-day-today { background: #edf6ff !important; }
.macos-calendar .fc .fc-daygrid-day-number { padding: 7px; color: #55555a; font-weight: 620; text-decoration: none; }
.macos-calendar .fc .fc-event { border-radius: 7px !important; padding: 2px 4px; box-shadow: 0 2px 5px rgba(30,42,64,.12); }

.macos-dashboard .preview-toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 30px); padding: 11px 16px; border-radius: 11px; background: rgba(35,35,38,.9); color: white; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 13px; opacity: 0; pointer-events: none; transition: .25s ease; }
.macos-dashboard .preview-toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1080px) {
  .macos-dashboard .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .macos-dashboard .command-center { grid-template-columns: 1fr; }
  .macos-dashboard .scan-actions { justify-content: flex-end; }
}

@media (max-width: 760px) {
  .macos-dashboard .app-window { width: 100%; min-height: 100vh; margin: 0; grid-template-columns: 1fr; grid-template-rows: 62px auto auto; border: 0; border-radius: 0; }
  .macos-dashboard .titlebar { grid-template-columns: 54px 1fr 92px; padding: 0 12px; }
  .macos-dashboard .window-controls { gap: 5px; }
  .macos-dashboard .window-controls .control { width: 9px; height: 9px; }
  .macos-dashboard .brand span { display: none; }
  .macos-dashboard .sidebar { grid-row: 2; flex-direction: row; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .macos-dashboard .sidebar nav { display: flex; min-width: max-content; }
  .macos-dashboard .sidebar-section, .macos-dashboard .sidebar-footer { display: none; }
  .macos-dashboard .nav-item { min-height: 38px; padding: 7px 11px; }
  .macos-dashboard .nav-item svg { width: 17px; }
  .macos-dashboard main { padding: 30px 18px 44px; }
  .macos-dashboard .welcome { align-items: start; }
  .macos-dashboard .welcome time { display: none; }
  .macos-dashboard h1 { font-size: 34px; }
  .macos-dashboard .scan-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .macos-dashboard .service-grid { grid-template-columns: 1fr; }
  .macos-dashboard .preview-toast { max-width: calc(100% - 32px); width: max-content; text-align: center; }
  body:not(.macos-dashboard) { font-size: 16px !important; }
  body:not(.macos-dashboard) .container,
  body:not(.macos-dashboard) .wrapper,
  body:not(.macos-dashboard) main { max-width: 100%; }
  body:not(.macos-dashboard) button,
  body:not(.macos-dashboard) .btn,
  body:not(.macos-dashboard) input[type="submit"] { max-width: 100%; }
  #task-toggle-btn { right: 18px; bottom: 18px; }
  #task-drawer { top: 8px; right: 8px !important; bottom: 8px; width: calc(100vw - 16px); transform: translate3d(calc(100% + 24px),0,0) !important; }
  #task-drawer.open { transform: translate3d(0,0,0) !important; }
  .macos-calendar .calendar-nav { grid-template-columns: 1fr auto 1fr; width: 100%; margin: 0; border-width: 0 0 1px; border-radius: 0; }
  .macos-calendar .calendar-nav strong { font-size: 15px; }
  .macos-calendar .calendar-nav a { min-height: 36px; padding: 0 10px; font-size: 13px; }
  .macos-calendar .calendar-controls { grid-template-columns: 1fr; width: calc(100% - 16px); margin: 10px auto; padding: 11px; }
  .macos-calendar .calendar-surface { width: calc(100% - 16px); height: auto !important; min-height: 74vh; padding: 8px; border-radius: 16px; }
  .macos-calendar .fc .fc-header-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .macos-calendar .fc .fc-toolbar-chunk { display: flex; justify-content: center; }
  .macos-calendar .fc .fc-toolbar-title { font-size: 21px; }
  .macos-calendar .fc .fc-button { min-height: 36px; padding: 6px 9px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
