:root {
  color-scheme: light;
  --app-style-loaded: 1;
  --page: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --surface-tint: #eef4ff;
  --ink: #172033;
  --muted: #697387;
  --faint: #929bad;
  --line: #e2e6ee;
  --line-strong: #d4dbe7;
  --primary: #315fdb;
  --primary-dark: #244bb9;
  --primary-soft: #e8efff;
  --success: #25866a;
  --success-soft: #e9f7f2;
  --danger: #bf4352;
  --danger-soft: #fff0f2;
  --warning: #a36c13;
  --warning-soft: #fff6de;
  --home: #e8ebf0;
  --shadow-sm: 0 1px 2px rgba(20, 29, 48, 0.04), 0 3px 12px rgba(20, 29, 48, 0.04);
  --shadow-md: 0 14px 38px rgba(25, 36, 60, 0.14);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --font: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 0%, rgba(78, 120, 226, 0.07), transparent 28rem),
    var(--page);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

.auth-screen {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #eef3ff, #f8f9fc 55%, #eef5f2);
}

body.is-authenticated .auth-screen {
  display: none;
}

body:not(.is-authenticated) .app-header,
body:not(.is-authenticated) .connection-banner,
body:not(.is-authenticated) .app-main,
body:not(.is-authenticated) .selection-toolbar,
body:not(.is-authenticated) .search-panel,
body:not(.is-authenticated) .search-scrim,
body:not(.is-authenticated) .app-credit,
body:not(.is-authenticated) .chat-link {
  display: none;
}

.auth-card {
  display: grid;
  gap: 15px;
  width: min(420px, 100%);
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(30, 45, 75, 0.14);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-error {
  padding: 9px 11px;
  color: #9c2e2e;
  background: #fff0f0;
  border-radius: 9px;
  font-size: 13px;
}

.auth-security-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  color: var(--primary);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.auth-security-link:hover {
  background: var(--primary-soft);
}

.auth-security-link .ui-icon {
  width: 17px;
  height: 17px;
}

.current-user {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
summary,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
summary,
label[for],
select {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid rgba(49, 95, 219, 0.28);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  right: 10px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 46px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(219, 225, 235, 0.9);
  box-shadow: 0 2px 20px rgba(29, 40, 65, 0.045);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(145deg, #3f70eb, #2f57ce);
  border-radius: 13px;
  box-shadow: 0 7px 16px rgba(49, 95, 219, 0.2);
  font-size: 23px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.link-button {
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
}

.round-date {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
}

.round-date:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-security-link {
  text-decoration: none;
}

.button,
.icon-button,
.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.add-button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(49, 95, 219, 0.13);
}

.button-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button-secondary {
  color: #294eaa;
  background: var(--primary-soft);
  border-color: #d7e2ff;
}

.button-secondary:hover {
  background: #dce7ff;
}

.button-quiet {
  color: #4e596d;
  background: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: #f0f2f7;
}

.button-danger-quiet {
  color: var(--danger);
  background: transparent;
}

.button-danger-quiet:hover {
  background: var(--danger-soft);
}

.button-small {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 12.5px;
}

.icon-button {
  width: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 24px;
  font-weight: 400;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 78px;
  margin-inline-end: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.status-dot {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.save-status.is-loading .status-dot,
.save-status.is-saving .status-dot {
  background: var(--warning);
  animation: pulse 1s ease-in-out infinite;
}

.save-status.is-error {
  color: var(--danger);
}

.save-status.is-error .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.connection-banner {
  position: sticky;
  z-index: 25;
  top: 76px;
  padding: 9px 28px;
  color: #744b0b;
  background: var(--warning-soft);
  border-bottom: 1px solid #eedaa5;
  text-align: center;
  font-size: 13px;
}

.app-main {
  width: min(1880px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 46px) 64px;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.75fr);
  align-items: start;
  gap: 14px;
  width: min(1380px, 100%);
  margin: 0 auto 32px;
}

.focus-row.has-no-today {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-unassigned {
  min-width: 0;
  min-height: 360px;
  padding: 22px;
  border-color: #dce5f8;
  box-shadow: 0 1px 2px rgba(20, 29, 48, 0.04), 0 10px 34px rgba(49, 95, 219, 0.06);
}

.panel-today {
  min-width: 0;
  min-height: 360px;
  padding: 22px;
  border-color: #afc3f5;
  box-shadow:
    0 0 0 2px rgba(49, 95, 219, 0.045),
    0 12px 34px rgba(49, 95, 219, 0.08);
}

.panel-today[hidden] {
  display: none;
}

.panel-today.is-home {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(117, 127, 145, 0.025),
      rgba(117, 127, 145, 0.025) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--home);
  border-color: #d8dde5;
  box-shadow: none;
}

.today-heading {
  align-items: flex-start;
}

.today-heading-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.today-stat {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.today-content {
  min-height: 250px;
}

.panel-heading,
.section-heading,
.attachments-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading {
  margin-bottom: 15px;
}

.panel-heading h2,
.section-heading h2 {
  margin: 2px 0 0;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.panel-hint,
.section-heading p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.eyebrow {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  margin-inline-start: 5px;
  padding: 0 6px;
  color: #5c6677;
  background: #eff1f5;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: 2px;
}

.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

input,
textarea,
select {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input,
select {
  min-height: 40px;
  padding: 8px 11px;
}

textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #bec7d5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7f9bea;
  box-shadow: 0 0 0 3px rgba(49, 95, 219, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #9aa3b3;
}

.quick-add input,
.quick-add textarea {
  min-height: 44px;
  height: 44px;
  padding-inline: 14px;
  background: var(--surface-soft);
  border-color: transparent;
  resize: none;
  line-height: 1.4;
}

.quick-add input:focus,
.quick-add textarea:focus {
  background: #fff;
  border-color: #91a9ec;
}

.add-button {
  flex: 0 0 44px;
  min-height: 44px;
  padding: 0;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-size: 23px;
  font-weight: 350;
}

.add-button:hover {
  background: var(--primary-dark);
}

.quick-add-subtle input,
.quick-add-subtle textarea {
  background: #fff;
  border-color: var(--line);
}

.quick-add-subtle .add-button {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #dce5fc;
}

.quick-add-subtle .add-button:hover {
  background: #dbe6ff;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 4px;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 6px 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(22, 31, 50, 0.025);
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.task-card:hover {
  border-color: #cbd3df;
  box-shadow: 0 3px 10px rgba(28, 40, 64, 0.065);
}

.task-card.is-dragging {
  opacity: 0.38;
  transform: scale(0.985);
}

.task-card.is-batch-dragging {
  border-color: #8da8ec;
}

.task-card.is-selected {
  z-index: 2;
  background: #f4f7ff;
  border-color: #6f92ea;
  box-shadow: 0 0 0 2px rgba(49, 95, 219, 0.11);
}

.task-card.is-day-task.is-hover-expanded:not(.is-selected):not(.is-dragging) {
  z-index: 12;
  border-color: #aebde2;
  box-shadow: 0 12px 25px rgba(28, 40, 64, 0.18);
  transform: scale(1.035);
}

.task-card.is-day-task.is-hover-expanded .task-title,
.task-card.is-day-task.is-hover-expanded .task-subtitle {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-card.is-complete {
  min-height: 37px;
  background: #f8faf9;
  border-color: #e1e8e5;
  box-shadow: none;
}

.task-card.is-complete .task-title {
  color: #7d8794;
  text-decoration: line-through;
  text-decoration-color: #aab2bb;
}

.task-check {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
}

.task-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  opacity: 0;
}

.task-check > span:first-of-type {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1.5px solid #b7c0cf;
  border-radius: 6px;
  transition: all 120ms ease;
}

.task-check input:checked + span {
  background: var(--success);
  border-color: var(--success);
}

.task-check input:checked + span::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.task-check input:focus-visible + span {
  outline: 3px solid rgba(49, 95, 219, 0.23);
  outline-offset: 2px;
}

.task-main {
  min-width: 0;
  padding: 2px 3px;
  background: transparent;
  border: 0;
  text-align: right;
}

.task-title,
.task-subtitle {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title {
  font-size: 13.5px;
  font-weight: 590;
}

.task-subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  color: #687287;
  background: #f0f2f6;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.priority-chip {
  min-width: 23px;
  justify-content: center;
}

.priority-1 {
  color: #a53343;
  background: #ffebee;
}

.priority-2 {
  color: #a26011;
  background: #fff2dc;
}

.priority-3 {
  color: #355eae;
  background: #eaf0ff;
}

.priority-4,
.priority-5 {
  color: #687287;
  background: #eff1f5;
}

.task-menu-button {
  width: 28px;
  height: 28px;
  padding: 0;
  color: #929aaa;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 1px;
}

.task-menu-button:hover {
  color: var(--ink);
  background: #edf0f5;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  color: var(--faint);
  font-size: 12.5px;
}

.empty-state.compact {
  min-height: 42px;
}

.empty-state[hidden] {
  display: none;
}

.board-section {
  margin: 0 auto 34px;
}

.round-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.round-navigation-status {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11.5px;
}

.button:disabled {
  color: var(--faint);
  background: #f2f4f7;
  border-color: var(--line);
  box-shadow: none;
  opacity: 0.78;
}

.history-view-banner {
  margin-bottom: 10px;
  padding: 9px 12px;
  color: #594b25;
  background: #fff5ce;
  border: 1px solid #ead99b;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
}

body.is-future-view .history-view-banner {
  color: #244a80;
  background: #eaf3ff;
  border-color: #bfd5f3;
}

.round-notes-panel {
  width: min(1140px, 100%);
  margin: 28px auto 0;
  overflow: hidden;
  background: #fffefa;
  border: 1px solid #ded7bf;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 26px rgba(54, 47, 25, 0.08);
}

.round-notes-panel h2,
.round-notes-panel p {
  margin: 0;
}

.round-notes-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, #fff9df, #fffefa 58%);
  border-bottom: 1px solid #e9e1c8;
}

.round-notes-heading h2 {
  font-size: 19px;
}

.round-notes-icon {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #7c6323;
  background: #fff1b9;
  border: 1px solid #ead58a;
  border-radius: 12px;
  font-size: 23px;
}

.round-notes-mode {
  align-self: flex-start;
  margin-inline-start: auto;
  padding: 5px 9px;
  color: #725914;
  background: #fff3c8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.round-notes-mode.is-history {
  color: var(--muted);
  background: #e9edf3;
}

.round-notes-form {
  padding: 16px;
}

.round-notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background: #f5f1e6;
  border: 1px solid #dfd8c5;
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
}

.round-notes-toolbar button,
.round-notes-toolbar select {
  min-width: 34px;
  height: 34px;
  padding: 5px 8px;
  color: #403a2d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  line-height: 1;
}

.round-notes-toolbar button:hover,
.round-notes-toolbar button:focus-visible,
.round-notes-toolbar select:hover {
  background: #fffdf8;
  border-color: #d8cfb6;
}

.round-notes-toolbar select {
  width: 124px;
  background: #fffdf8;
  border-color: #d8cfb6;
  font-size: 12px;
}

.notepad-format-label {
  display: flex;
}

.notepad-divider {
  width: 1px;
  height: 23px;
  margin: 0 3px;
  background: #d8cfb6;
}

.round-notes-editor {
  --notepad-line-height: 33px;
  min-height: 220px;
  max-height: 620px;
  overflow-y: auto;
  padding: 24px 28px;
  color: #29271f;
  background-color: #fffefa;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notepad-line-height) - 1px),
    rgba(130, 119, 85, 0.13) calc(var(--notepad-line-height) - 1px),
    rgba(130, 119, 85, 0.13) var(--notepad-line-height)
  );
  background-position: 0 16px;
  border: 1px solid #dfd8c5;
  border-radius: 0 0 11px 11px;
  outline: none;
  font-size: 16px;
  line-height: var(--notepad-line-height);
  white-space: normal;
}

.round-notes-editor:focus {
  border-color: #aa9361;
  box-shadow: inset 0 0 0 2px rgba(170, 147, 97, 0.14);
}

.round-notes-editor:empty::before {
  color: #aaa18b;
  content: attr(data-placeholder);
  pointer-events: none;
}

.round-notes-editor h2,
.round-notes-editor h3,
.round-notes-editor p,
.round-notes-editor blockquote,
.round-notes-editor ul,
.round-notes-editor ol {
  margin-top: 0;
  margin-bottom: 0;
  line-height: var(--notepad-line-height);
}

.round-notes-editor h2,
.round-notes-editor h3 {
  margin-bottom: var(--notepad-line-height);
}

.round-notes-editor h2 {
  font-size: 23px;
}

.round-notes-editor h3 {
  font-size: 19px;
}

.round-notes-editor blockquote {
  margin-inline: 0;
  padding-inline-start: 14px;
  color: #655d4b;
  border-inline-start: 3px solid #d2b968;
}

.round-notes-editor a {
  color: var(--primary);
}

.round-notes-editor.is-read-only {
  min-height: 130px;
  color: #4a4e58;
  background-color: #fafbfc;
  background-image: none;
  border-radius: 11px;
}

.round-notes-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding-top: 12px;
}

.round-notes-autosave {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  padding: 6px 10px;
  color: #66582f;
  background: rgba(236, 184, 55, 0.12);
  border: 1px solid rgba(151, 124, 53, 0.14);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
}

.round-notes-autosave-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.round-notes-autosave.is-pending .round-notes-autosave-dot,
.round-notes-autosave.is-saving .round-notes-autosave-dot {
  background: var(--warning);
  animation: pulse 1s ease-in-out infinite;
}

.round-notes-autosave.is-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(181, 57, 75, 0.16);
}

.round-notes-autosave.is-error .round-notes-autosave-dot {
  background: var(--danger);
}

.round-notes-shortcuts {
  font-size: 11px;
}

body.is-history-view .focus-row,
body.is-history-view .support-sections {
  display: none;
}

body.is-history-view .round-notes-panel {
  background: #fafbfc;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

body.is-history-view .round-notes-heading {
  background: #f3f5f8;
  border-color: var(--line);
}

body.is-history-view .round-notes-form {
  padding-top: 14px;
}

body.is-future-view .round-notes-heading {
  background: linear-gradient(135deg, #eef5ff, #fffefa 58%);
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 12px;
}

.days-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  align-items: start;
  gap: 18px 10px;
  min-width: 1110px;
  padding: 2px;
}

.board-section {
  overflow-x: auto;
  scrollbar-color: #c5ccda transparent;
  scrollbar-width: thin;
}

.day-card {
  width: auto;
  min-width: 0;
  min-height: 242px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.day-card.is-today {
  border-color: #a9bff6;
  box-shadow: 0 0 0 2px rgba(49, 95, 219, 0.06), var(--shadow-sm);
}

.day-card.is-past {
  min-height: 215px;
  color: #687285;
  background: #eef1f5;
  border-color: #dce1e8;
  box-shadow: none;
}

.day-card.is-past .day-header {
  margin-bottom: 5px;
}

.day-card.is-past.is-home {
  min-height: 215px;
}

.day-card.is-today-summary {
  min-height: 215px;
  background: linear-gradient(155deg, #ffffff, #f1f5ff);
}

.day-card.is-home {
  min-height: 174px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(117, 127, 145, 0.03),
      rgba(117, 127, 145, 0.03) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--home);
  border-color: #d8dde5;
  box-shadow: none;
}

.day-card.has-day-type,
.panel-today.has-day-type {
  border-top-color: var(--day-type-color);
  box-shadow: inset 0 3px 0 var(--day-type-color), var(--shadow-sm);
}

.day-card.is-home.has-day-type,
.panel-today.is-home.has-day-type {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--day-type-color) 7%, transparent),
      color-mix(in srgb, var(--day-type-color) 7%, transparent) 8px,
      transparent 8px,
      transparent 16px
    ),
    color-mix(in srgb, var(--day-type-color) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--day-type-color) 34%, var(--line));
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 39px;
  margin-bottom: 9px;
}

.day-name {
  margin: 0;
  font-size: 14px;
  font-weight: 720;
}

.day-date {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.today-label {
  margin-inline-start: 4px;
  color: var(--primary);
  font-size: 9px;
}

.past-label {
  margin-inline-start: 4px;
  color: #8791a2;
  font-size: 9px;
}

.home-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  color: #7c8595;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 10px;
}

.home-toggle:hover {
  color: #4c5668;
  background: #f0f2f5;
}

.home-toggle input {
  width: 13px;
  height: 13px;
  min-height: 0;
  margin: 0;
}

.day-type-select {
  display: block;
  width: min(96px, 42%);
  flex: 0 0 auto;
}

.day-type-select .glass-select-trigger {
  grid-template-columns: minmax(0, 1fr) 25px;
  min-height: 30px;
  padding: 2px 4px 2px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 650;
}

.day-type-select .glass-select-chevron {
  width: 23px;
  height: 23px;
  border-radius: 7px;
}

.day-type-select .glass-select-menu {
  width: min(136px, calc(100vw - 24px));
}

.day-card:has(.glass-select.is-open) {
  position: relative;
  z-index: 5;
}

.glass-select-value.has-color,
.glass-select-option-label.has-color {
  display: flex;
  align-items: center;
  gap: 7px;
}

.glass-select-value.has-color::before,
.glass-select-option-label.has-color::before {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  content: "";
  background: var(--option-color);
  border: 1px solid color-mix(in srgb, var(--option-color) 68%, #1f2937);
  border-radius: 3px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.35);
}

.day-types-modal {
  width: min(760px, calc(100vw - 28px));
}

.day-types-body {
  display: grid;
  gap: 18px;
}

.day-types-list {
  display: grid;
  gap: 9px;
}

.day-type-row,
.day-type-add-form {
  display: grid;
  grid-template-columns: 44px minmax(150px, 1fr) minmax(145px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface) 88%, var(--primary-soft));
  border: 1px solid var(--line);
  border-radius: 14px;
}

.day-type-row > input[type="color"],
.day-type-color-field input[type="color"] {
  width: 42px;
  height: 38px;
  min-height: 0;
  padding: 3px;
  border-radius: 10px;
  cursor: pointer;
}

.day-type-disabled-field,
.day-type-color-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.day-type-disabled-field input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.day-type-row-actions {
  display: flex;
  gap: 6px;
}

.day-type-row-actions .button {
  min-height: 34px;
  padding: 6px 10px;
}

.day-type-add-form {
  grid-template-columns: minmax(180px, 1fr) auto minmax(145px, auto) auto;
  border-style: dashed;
}

.day-type-add-form .field {
  gap: 4px;
}

@media (max-width: 680px) {
  .day-type-row,
  .day-type-add-form {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .day-type-disabled-field,
  .day-type-row-actions,
  .day-type-add-form > .button {
    grid-column: 1 / -1;
  }

  .day-type-add-form > .field,
  .day-type-add-form > .day-type-color-field {
    grid-column: 1 / -1;
  }
}

.day-card .quick-add {
  margin-bottom: 9px;
}

.day-card .quick-add input,
.day-card .quick-add textarea {
  min-height: 34px;
  height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.day-card .add-button {
  flex-basis: 34px;
  min-height: 34px;
  font-size: 18px;
}

.day-card .task-list {
  gap: 6px;
}

.day-card .task-card {
  grid-template-columns: 23px minmax(0, 1fr) auto 24px;
  gap: 4px;
  padding-inline: 4px 5px;
}

.day-card .task-title {
  font-size: 12.5px;
}

.day-card .task-menu-button {
  width: 24px;
}

.day-empty {
  min-height: 58px;
  padding: 8px;
  color: #a0a8b5;
  border: 1px dashed #e1e5eb;
  border-radius: 9px;
  text-align: center;
  font-size: 11px;
}

.home-message {
  display: grid;
  place-items: center;
  min-height: 88px;
  color: #737d8d;
  text-align: center;
  font-size: 12px;
}

.home-message strong {
  display: block;
  margin-bottom: 2px;
  color: #565f6f;
  font-size: 14px;
}

.day-actions {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

.day-actions button {
  flex: 1;
  min-height: 28px;
  padding: 4px 6px;
  color: #6e788a;
  background: #f5f6f9;
  border: 0;
  border-radius: 7px;
  font-size: 10px;
}

.day-actions button:hover {
  color: #3f4a5f;
  background: #eaedf3;
}

.past-day-stat {
  margin: 3px 0 9px;
  color: #576174;
  font-size: 12px;
  font-weight: 700;
}

.past-day-closed {
  min-height: 42px;
  padding: 12px 8px;
  color: #7b8595;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 9px;
  text-align: center;
  font-size: 11.5px;
}

.overdue-decision {
  margin: 7px 0 9px;
  padding: 9px;
  color: #765317;
  background: var(--warning-soft);
  border: 1px solid #ead8a8;
  border-radius: 10px;
}

.overdue-decision strong {
  display: block;
  font-size: 11.5px;
}

.overdue-decision p {
  margin: 2px 0 7px;
  font-size: 10.5px;
}

.overdue-actions {
  margin-top: 0;
}

.overdue-actions button {
  color: #6e501d;
  background: rgba(255, 255, 255, 0.7);
}

.past-task-details {
  margin-top: 8px;
  border-top: 1px solid rgba(116, 128, 147, 0.16);
}

.past-task-details > summary {
  padding: 7px 1px 2px;
  color: #6f798b;
  font-size: 10.5px;
}

.past-task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 5px;
}

.past-task-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(207, 214, 224, 0.8);
  border-radius: 8px;
  font-size: 10.5px;
}

.past-task-row.is-complete .past-task-title {
  color: #88919e;
  text-decoration: line-through;
}

.past-task-state {
  color: var(--success);
  font-weight: 800;
}

.past-task-row.is-open .past-task-state {
  color: var(--warning);
}

.today-overview-stat {
  margin: 10px 0 5px;
  color: #3658ae;
  font-size: 18px;
  font-weight: 750;
}

.today-overview-note {
  color: var(--muted);
  font-size: 11.5px;
}

.today-focus-link {
  margin-top: 15px;
  padding: 6px 9px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d4e0ff;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}

.completed-group {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #edf0f3;
}

.completed-group summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 1px 6px;
  color: #7c8594;
  font-size: 10.5px;
  list-style: none;
}

.completed-group summary::-webkit-details-marker {
  display: none;
}

.completed-group summary::before {
  content: "‹";
  display: inline-block;
  transform: rotate(0);
  transition: transform 120ms ease;
}

.completed-group[open] summary::before {
  transform: rotate(-90deg);
}

.drop-zone.is-drop-target,
.day-card.is-drop-target,
.person-card.is-drop-target {
  border-color: #7799ee !important;
  background-color: #f4f7ff !important;
  box-shadow: 0 0 0 3px rgba(49, 95, 219, 0.1);
}

.support-sections {
  display: grid;
  gap: 10px;
  width: min(1140px, 100%);
  margin: 0 auto;
}

.custom-sections-list {
  display: contents;
}

.custom-section-panel .person-actions {
  margin-inline-start: 4px;
}

.collapsible-panel {
  overflow: hidden;
  border-radius: var(--radius);
}

.collapsible-panel > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 17px;
  list-style: none;
  user-select: none;
}

.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel > summary:hover {
  background: #fafbfc;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #5570b4;
  background: #eef2fc;
  border-radius: 9px;
  font-size: 16px;
}

.summary-title {
  font-weight: 690;
}

.summary-spacer,
.footer-spacer {
  flex: 1;
}

.summary-help {
  color: var(--faint);
  font-size: 11.5px;
}

.chevron {
  color: #8b94a4;
  font-size: 18px;
  transform: rotate(0);
  transition: transform 150ms ease;
}

.collapsible-panel[open] .chevron {
  transform: rotate(180deg);
}

.details-body {
  padding: 4px 17px 17px;
  border-top: 1px solid #edf0f4;
}

.details-body > .quick-add {
  max-width: 680px;
  margin-top: 14px;
}

.person-add {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 14px 0;
}

.person-add .button {
  flex: 0 0 auto;
}

.people-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 10px;
}

.person-card {
  width: auto;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.person-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}

.person-heading h3 {
  flex: 1;
  margin: 0;
  font-size: 14px;
}

.person-actions {
  display: flex;
  gap: 2px;
}

.person-actions button {
  width: 27px;
  height: 27px;
  padding: 0;
  color: #8b94a3;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.person-actions button:hover {
  color: var(--ink);
  background: #e9ecf2;
}

.person-card .quick-add {
  margin-bottom: 8px;
}

.person-card .quick-add input,
.person-card .quick-add textarea {
  min-height: 35px;
  height: 35px;
  background: #fff;
  border-color: var(--line);
  font-size: 12px;
}

.selection-toolbar {
  position: fixed;
  z-index: 65;
  right: 50%;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 28px);
  padding: 10px 13px;
  color: #fff;
  background: #253452;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 29, 48, 0.28);
  font-size: 12px;
  transform: translateX(50%);
}

.selection-toolbar[hidden] {
  display: none;
}

.selection-toolbar span {
  color: #cfd8ea;
}

.selection-toolbar button {
  padding: 5px 8px;
  color: #e6ecf8;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 7px;
  font-weight: 650;
}

.selection-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.person-card .add-button {
  flex-basis: 35px;
  min-height: 35px;
  font-size: 18px;
}

.trash-panel .summary-icon {
  color: #7b6470;
  background: #f3eef1;
}

.trash-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 13px;
}

.trash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.trash-toolbar + .trash-list {
  padding-top: 9px;
}

.app-credit {
  width: min(1880px, 100%);
  margin: -42px auto 0;
  padding: 0 clamp(16px, 3vw, 48px) 18px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: left;
  opacity: 0.72;
}

.chat-link {
  position: fixed;
  z-index: 60;
  bottom: 22px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-primary, #fff);
  background: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(25, 38, 66, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.chat-link[hidden] {
  display: none;
}

.chat-link:hover,
.chat-link:focus-visible {
  outline: none;
  box-shadow: 0 12px 30px rgba(25, 38, 66, 0.26), 0 0 0 4px var(--primary-soft);
  transform: translateY(-2px);
}

.chat-link .ui-icon {
  width: 22px;
  height: 22px;
}

.trash-row {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.trash-row > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #626c7d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-row small {
  color: var(--faint);
}

.search-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(20, 29, 48, 0.26);
  border: 0;
  backdrop-filter: blur(2px);
}

.search-panel {
  position: fixed;
  z-index: 71;
  top: 90px;
  left: 50%;
  width: min(680px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 120px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-input-wrap input {
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 16px;
}

kbd {
  padding: 2px 6px;
  color: #737c8c;
  background: #f2f3f6;
  border: 1px solid #e1e4e9;
  border-radius: 5px;
  font: 10px var(--font);
}

.search-results {
  max-height: 520px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: right;
}

.search-result:hover {
  background: var(--surface-soft);
}

.search-result strong,
.search-result small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  margin-top: 2px;
  color: var(--muted);
}

.modal {
  width: min(620px, calc(100vw - 26px));
  max-height: min(800px, calc(100vh - 30px));
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.modal::backdrop {
  background: rgba(20, 29, 48, 0.36);
  backdrop-filter: blur(2px);
}

.modal-small {
  width: min(480px, calc(100vw - 26px));
}

.modal-wide {
  width: min(1080px, calc(100vw - 26px));
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-header > div {
  flex: 1;
}

.modal-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.modal-body {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 20px 22px;
}

.modal-body > :last-child {
  margin-bottom: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
}

.field {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin-bottom: 15px;
  color: #4e596c;
  font-size: 12.5px;
  font-weight: 600;
}

.field-wide {
  width: 100%;
}

.field-row {
  display: flex;
  gap: 12px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0 18px;
  padding: 10px 0;
}

.toggle-field > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 37px;
  height: 21px;
  background: #c7ced9;
  border-radius: 999px;
  transition: background 120ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(20, 29, 48, 0.25);
  transition: transform 120ms ease;
}

.toggle-field > input:checked + .toggle {
  background: var(--primary);
}

.toggle-field > input:checked + .toggle::after {
  transform: translateX(-16px);
}

.toggle-field > input:focus-visible + .toggle {
  outline: 3px solid rgba(49, 95, 219, 0.24);
  outline-offset: 2px;
}

.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field strong {
  color: var(--ink);
  font-size: 13px;
}

.toggle-field small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.attachments-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.attachments-heading {
  align-items: center;
  margin-bottom: 9px;
}

.attachments-heading h3 {
  margin: 0;
  font-size: 13.5px;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 12px;
}

.attachment-row a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #3159b8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-row small {
  color: var(--muted);
}

.attachment-row button {
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.attachment-row button:hover {
  background: var(--danger-soft);
}

.file-drop {
  margin-top: 8px;
  padding: 10px;
  color: var(--faint);
  border: 1px dashed #ccd3df;
  border-radius: 9px;
  text-align: center;
  font-size: 11px;
}

.file-drop.is-drop-target {
  color: var(--primary);
  background: var(--surface-tint);
  border-color: #7695e3;
}

.muted {
  color: var(--muted);
}

.choice-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.choice:hover {
  background: var(--surface-soft);
}

.choice input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 2px 0 0;
}

.choice strong,
.choice small {
  display: block;
}

.choice small {
  margin-top: 2px;
  color: var(--muted);
}

.history-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: min(610px, calc(100vh - 130px));
}

.history-list {
  max-height: min(610px, calc(100vh - 130px));
  overflow-y: auto;
  padding: 10px;
  background: #f8f9fb;
  border-left: 1px solid var(--line);
}

.history-list-button {
  display: block;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: right;
}

.history-list-button:hover,
.history-list-button.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(24, 34, 54, 0.07);
}

.history-list-button strong,
.history-list-button small {
  display: block;
}

.history-list-button small {
  margin-top: 3px;
  color: var(--muted);
}

.history-content {
  max-height: min(610px, calc(100vh - 130px));
  overflow: auto;
  padding: 20px;
}

.history-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.history-summary > div:first-child {
  flex: 1;
}

.history-summary h3 {
  margin-bottom: 3px;
}

.history-stats {
  display: flex;
  gap: 7px;
}

.stat {
  min-width: 76px;
  padding: 7px 9px;
  background: var(--surface-soft);
  border-radius: 9px;
  text-align: center;
}

.stat strong,
.stat small {
  display: block;
}

.stat strong {
  font-size: 17px;
}

.stat small {
  color: var(--muted);
  font-size: 10px;
}

.history-completed {
  margin: 18px 0;
  padding: 15px;
  background: var(--success-soft);
  border-radius: 12px;
}

.history-completed h3 {
  margin-bottom: 8px;
  color: #246f5a;
  font-size: 14px;
}

.history-completed ul {
  margin: 0;
  padding-inline-start: 20px;
}

.history-completed li {
  margin: 4px 0;
}

.history-open-items {
  margin: 12px 0 20px;
  padding: 11px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.history-open-items summary {
  color: #4f596b;
  font-size: 12.5px;
  font-weight: 680;
}

.history-open-items ul {
  margin: 10px 0 2px;
  padding-inline-start: 20px;
  color: #626c7d;
  font-size: 12px;
}

.history-open-items li {
  margin: 4px 0;
}

.history-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 6px;
  min-width: 850px;
}

.history-day {
  width: auto;
  min-height: 90px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-day strong {
  display: block;
  margin-bottom: 5px;
  font-size: 10.5px;
}

.history-day ul {
  margin: 0;
  padding-inline-start: 14px;
  color: #5e6879;
  font-size: 9.5px;
}

.history-day.is-home {
  color: #8a929e;
  background: var(--home);
}

.toast-region {
  position: fixed;
  z-index: 120;
  bottom: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(430px, calc(100vw - 36px));
  padding: 11px 13px;
  color: #fff;
  background: #263044;
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(20, 29, 48, 0.24);
  font-size: 12.5px;
  pointer-events: auto;
  animation: toast-in 160ms ease-out;
}

.toast.is-error {
  background: #9e3342;
}

.toast button {
  padding: 3px 7px;
  color: #dfe7ff;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
}

.toast button:hover {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1500px) and (min-width: 901px) {
  .app-main {
    padding-inline: 20px;
  }

  .days-board {
    grid-template-columns: repeat(7, minmax(145px, 1fr));
    min-width: 1075px;
  }

  .day-card .task-card {
    grid-template-columns: 23px minmax(0, 1fr) 24px;
  }

  .day-card .task-check {
    grid-row: 1 / span 2;
  }

  .day-card .task-main {
    grid-row: 1;
    grid-column: 2;
  }

  .day-card .task-meta {
    grid-row: 2;
    grid-column: 2;
  }

  .day-card .task-menu-button {
    grid-row: 1 / span 2;
    grid-column: 3;
  }
}

@media (max-width: 900px) {
  .app-header {
    align-items: flex-start;
    padding: 10px 14px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .save-status {
    order: 5;
  }

  .header-actions .button span:last-child {
    display: none;
  }

  .app-main {
    padding-inline: 14px;
  }

  .focus-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .brand-mark {
    display: none;
  }

  .brand h1 {
    font-size: 17px;
  }

  .round-date {
    font-size: 11px;
  }

  .button {
    min-height: 34px;
    padding: 6px 9px;
  }

  .panel-unassigned {
    padding: 16px;
  }

  .panel-today {
    padding: 16px;
  }

  .panel-hint,
  .section-heading p,
  .summary-help {
    display: none;
  }

  .field-row {
    display: block;
  }

  .section-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .round-notes-panel {
    margin-top: 22px;
  }

  .round-notes-heading {
    align-items: flex-start;
    padding: 15px;
  }

  .round-notes-mode {
    max-width: 120px;
    text-align: center;
  }

  .round-notes-form {
    padding: 10px;
  }

  .round-notes-toolbar {
    max-height: 132px;
    overflow-y: auto;
  }

  .notepad-divider {
    display: none;
  }

  .round-notes-editor {
    min-height: 190px;
    padding: 18px;
  }

  .round-notes-shortcuts {
    display: none;
  }

  .history-layout {
    display: block;
  }

  .history-list {
    display: flex;
    max-height: 115px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .history-list-button {
    flex: 0 0 175px;
  }

  .history-content {
    max-height: calc(100vh - 260px);
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .selection-toolbar span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Glassy rounded UI redesign
   The content layer stays stable and opaque. Glass is reserved for floating
   application chrome, transient panels, and modal framing.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --page: #f3f6fa;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(248, 250, 253, 0.88);
  --surface-tint: #edf3ff;
  --surface-solid: #ffffff;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --ink: #172033;
  --muted: #667085;
  --faint: #8b95a7;
  --line: rgba(79, 96, 128, 0.15);
  --line-strong: rgba(79, 96, 128, 0.25);
  --primary: #3a67e8;
  --primary-dark: #315bd1;
  --primary-soft: rgba(58, 103, 232, 0.11);
  --success: #168568;
  --success-soft: rgba(22, 133, 104, 0.1);
  --danger: #b83d50;
  --danger-soft: rgba(184, 61, 80, 0.1);
  --warning: #a56612;
  --warning-soft: #fff4dc;
  --home: #edf0f5;
  --shadow-sm: 0 1px 2px rgba(20, 29, 48, 0.05), 0 7px 20px rgba(20, 29, 48, 0.055);
  --shadow-md: 0 18px 56px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 10px 34px rgba(20, 29, 48, 0.12), 0 2px 8px rgba(20, 29, 48, 0.05);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-dialog: 24px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

html {
  background: var(--page);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -8%, rgb(var(--primary-rgb, 58 103 232) / 0.105), transparent 36rem),
    radial-gradient(circle at 3% 34%, rgba(82, 193, 169, 0.065), transparent 30rem),
    var(--page);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.47;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font-family: var(--font);
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-icon .ui-icon,
.round-notes-icon .ui-icon {
  width: 19px;
  height: 19px;
}

:focus-visible {
  outline: 3px solid rgba(58, 103, 232, 0.3);
  outline-offset: 2px;
}

.auth-screen {
  background:
    radial-gradient(circle at 80% 12%, rgba(83, 126, 255, 0.16), transparent 29rem),
    radial-gradient(circle at 14% 82%, rgba(82, 193, 169, 0.11), transparent 27rem),
    #f3f6fa;
}

.auth-card {
  gap: 17px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-card .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.auth-error {
  padding: 11px 13px;
  color: #9e2f42;
  background: var(--danger-soft);
  border: 1px solid rgba(184, 61, 80, 0.16);
  border-radius: 12px;
}

.app-header {
  min-height: 72px;
  padding: 11px clamp(18px, 3vw, 48px);
  background: var(--glass);
  border-bottom: 1px solid rgba(79, 96, 128, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 7px 26px rgba(20, 29, 48, 0.055);
  -webkit-backdrop-filter: blur(22px) saturate(132%);
  backdrop-filter: blur(22px) saturate(132%);
}

.brand {
  gap: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #4b77ee, #315bd1);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(49, 91, 209, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.brand h1 {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.028em;
}

.round-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  gap: 7px;
}

.theme-toggle {
  min-width: 78px;
  gap: 7px;
}

.theme-color-picker {
  position: relative;
}

.theme-color-button {
  min-width: 68px;
  gap: 8px;
}

.theme-color-dot {
  width: 14px;
  height: 14px;
  background: var(--theme-source-color, var(--primary));
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgb(var(--primary-rgb) / 0.28);
}

.theme-color-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 9px);
  inset-inline-end: 0;
  display: grid;
  gap: 14px;
  width: 304px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(79, 96, 128, 0.18);
  border-radius: 17px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
}

.theme-color-menu[hidden] {
  display: none;
}

.theme-color-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-color-menu-header strong {
  font-size: 13px;
}

.theme-color-menu-header .icon-button {
  width: 28px;
  min-height: 28px;
  font-size: 18px;
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.theme-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  background: var(--swatch-color);
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(50, 62, 84, 0.16), 0 2px 5px rgba(20, 29, 48, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.theme-swatch[data-theme-color="#3a67e8"] { --swatch-color: #3a67e8; }
.theme-swatch[data-theme-color="#0078d4"] { --swatch-color: #0078d4; }
.theme-swatch[data-theme-color="#1f4e79"] { --swatch-color: #1f4e79; }
.theme-swatch[data-theme-color="#4f46d8"] { --swatch-color: #4f46d8; }
.theme-swatch[data-theme-color="#6b5caa"] { --swatch-color: #6b5caa; }
.theme-swatch[data-theme-color="#7c3fc7"] { --swatch-color: #7c3fc7; }
.theme-swatch[data-theme-color="#a13e8e"] { --swatch-color: #a13e8e; }
.theme-swatch[data-theme-color="#c33f6b"] { --swatch-color: #c33f6b; }
.theme-swatch[data-theme-color="#c43b4d"] { --swatch-color: #c43b4d; }
.theme-swatch[data-theme-color="#c65335"] { --swatch-color: #c65335; }
.theme-swatch[data-theme-color="#bd5d16"] { --swatch-color: #bd5d16; }
.theme-swatch[data-theme-color="#a87508"] { --swatch-color: #a87508; }
.theme-swatch[data-theme-color="#6d7f24"] { --swatch-color: #6d7f24; }
.theme-swatch[data-theme-color="#4f7f2c"] { --swatch-color: #4f7f2c; }
.theme-swatch[data-theme-color="#168568"] { --swatch-color: #168568; }
.theme-swatch[data-theme-color="#087f8c"] { --swatch-color: #087f8c; }
.theme-swatch[data-theme-color="#397178"] { --swatch-color: #397178; }
.theme-swatch[data-theme-color="#795548"] { --swatch-color: #795548; }
.theme-swatch[data-theme-color="#52647e"] { --swatch-color: #52647e; }
.theme-swatch[data-theme-color="#3f4652"] { --swatch-color: #3f4652; }

.theme-swatch:hover,
.theme-swatch:focus-visible {
  z-index: 1;
  transform: scale(1.09);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.96), 0 0 0 5px var(--swatch-color);
}

.theme-swatch.is-selected::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 17px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  content: "✓";
}

.custom-theme-color {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 55px;
  padding: 9px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
}

.custom-theme-color:hover,
.custom-theme-color:focus-within {
  border-color: rgb(var(--primary-rgb) / 0.44);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.custom-theme-color input[type="color"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-theme-preview {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: white;
  background: conic-gradient(#f04444, #f5ad32, #58a94d, #30aeb7, #4f6df5, #9a52d0, #f04444);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(50, 62, 84, 0.16);
  font-size: 21px;
  font-weight: 500;
}

.custom-theme-color strong,
.custom-theme-color small {
  display: block;
}

.custom-theme-color strong {
  color: var(--ink);
  font-size: 12.5px;
}

.custom-theme-color small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.auth-theme-toggle {
  justify-self: end;
  margin-bottom: -6px;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.current-user {
  margin-inline-end: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.save-status {
  min-width: 82px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(79, 96, 128, 0.1);
  border-radius: 999px;
  font-size: 11.5px;
}

.status-dot {
  box-shadow: 0 0 0 3px rgba(22, 133, 104, 0.1);
}

.connection-banner {
  top: 72px;
  padding: 10px 28px;
  background: rgba(255, 244, 220, 0.94);
  border-bottom-color: rgba(165, 102, 18, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.button,
.icon-button,
.add-button {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 630;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

.button-primary {
  color: var(--on-primary, #fff);
  background: var(--primary);
  border-color: rgba(30, 74, 190, 0.15);
  box-shadow: 0 6px 16px rgba(58, 103, 232, 0.19), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.button-primary:hover {
  box-shadow: 0 8px 20px rgba(49, 91, 209, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.button-secondary {
  color: #2f57c2;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(58, 103, 232, 0.18);
  box-shadow: 0 1px 2px rgba(20, 29, 48, 0.035);
}

.button-secondary:hover {
  background: var(--surface-solid);
  border-color: rgba(58, 103, 232, 0.3);
}

.button-quiet {
  color: #4f5d73;
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(79, 96, 128, 0.11);
}

.button-small {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 12px;
}

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid transparent;
  font-size: 22px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.62);
  border-color: var(--line);
}

.app-main {
  width: min(1880px, 100%);
  padding: 28px clamp(16px, 3vw, 48px) 72px;
}

.focus-row {
  grid-template-columns:
    minmax(420px, var(--focus-today-width, min(70%, calc(100% - 318px))))
    18px
    minmax(300px, 1fr);
  align-items: stretch;
  gap: 0;
  width: min(1420px, 100%);
  margin-bottom: 36px;
}

.panel-unassigned {
  order: 0;
}

.panel {
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-unassigned,
.panel-today {
  min-height: 380px;
  padding: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(79, 96, 128, 0.14);
  box-shadow: var(--shadow-sm);
}

.panel-today {
  position: relative;
  order: -2;
  min-height: 380px;
  border-color: rgba(58, 103, 232, 0.31);
  box-shadow: 0 0 0 3px rgba(58, 103, 232, 0.045), var(--shadow-sm);
}

.panel-today .today-content {
  min-height: 286px;
}

.focus-resizer {
  position: relative;
  order: -1;
  align-self: stretch;
  min-height: 380px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.focus-resizer::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 2px;
  background: rgba(79, 96, 128, 0.2);
  border-radius: 999px;
  content: "";
  transform: translateX(-50%);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.focus-resizer-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 48px;
  background:
    radial-gradient(circle, currentColor 1.1px, transparent 1.3px) center 13px / 6px 7px repeat-y,
    var(--glass-strong);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.46);
  color: var(--faint);
  transform: translate(-50%, -50%);
  transition: width 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.focus-resizer:hover::before,
.focus-resizer:focus-visible::before,
body.is-resizing-focus .focus-resizer::before {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.focus-resizer:hover .focus-resizer-handle,
.focus-resizer:focus-visible .focus-resizer-handle,
body.is-resizing-focus .focus-resizer-handle {
  width: 12px;
  color: var(--primary);
  border-color: rgba(58, 103, 232, 0.46);
  box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-sm);
}

.focus-resizer:focus-visible {
  outline: none;
}

body.is-resizing-focus,
body.is-resizing-focus * {
  cursor: col-resize !important;
}

.focus-row.has-no-today .focus-resizer {
  display: none;
}

.panel-today::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 0 0 999px 999px;
  content: "";
  opacity: 0.72;
}

.panel-today.is-home,
.day-card.is-home {
  background: #edf0f5;
  border-color: rgba(79, 96, 128, 0.14);
}

.panel-heading {
  margin-bottom: 17px;
}

.panel-heading h2,
.section-heading h2 {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.panel-hint,
.section-heading p {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.055em;
}

.count-badge {
  min-width: 24px;
  height: 22px;
  color: #4562a5;
  background: rgba(58, 103, 232, 0.1);
  border: 1px solid rgba(58, 103, 232, 0.08);
  font-variant-numeric: tabular-nums;
}

input,
textarea,
select {
  color: var(--ink);
  background: var(--surface-solid);
  border-color: var(--line-strong);
  border-radius: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input,
select {
  min-height: 42px;
  padding: 9px 12px;
}

textarea {
  padding: 11px 12px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(79, 96, 128, 0.38);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(58, 103, 232, 0.68);
  box-shadow: 0 0 0 4px rgba(58, 103, 232, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #929bad;
}

.quick-add {
  gap: 8px;
  margin-bottom: 13px;
}

.quick-add input,
.quick-add textarea {
  background: rgba(243, 246, 250, 0.82);
  border-color: rgba(79, 96, 128, 0.1);
  border-radius: 12px;
}

.quick-add input:focus,
.quick-add textarea:focus {
  background: var(--surface-solid);
  border-color: rgba(58, 103, 232, 0.56);
}

.add-button {
  flex-basis: 44px;
  padding: 0;
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(58, 103, 232, 0.18);
  font-size: 21px;
}

.quick-add-subtle .add-button {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(58, 103, 232, 0.14);
  box-shadow: none;
}

.task-list {
  gap: 8px;
}

.task-card {
  grid-template-columns: 28px minmax(0, 1fr) auto 30px;
  gap: 7px;
  min-height: 46px;
  padding: 7px 7px 7px 9px;
  background: var(--surface-solid);
  border-color: rgba(79, 96, 128, 0.14);
  border-radius: 13px;
  box-shadow: 0 1px 3px rgba(20, 29, 48, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.task-card:hover {
  border-color: rgba(79, 96, 128, 0.28);
  box-shadow: 0 7px 18px rgba(20, 29, 48, 0.075);
}

.task-card.is-selected {
  background: #f2f6ff;
  border-color: rgba(58, 103, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(58, 103, 232, 0.11), 0 8px 20px rgba(20, 29, 48, 0.08);
}

.task-card.is-day-task.is-hover-expanded:not(.is-selected):not(.is-dragging) {
  border-color: rgba(58, 103, 232, 0.38);
  box-shadow: var(--shadow-float);
  transform: translateY(-2px) scale(1.018);
}

.task-card.is-complete {
  background: #f7faf9;
  border-color: rgba(22, 133, 104, 0.12);
}

.task-check {
  width: 28px;
  height: 28px;
}

.task-check > span:first-of-type {
  width: 19px;
  height: 19px;
  border-color: #adb8ca;
  border-radius: 7px;
}

.task-check input:checked + span {
  box-shadow: 0 0 0 3px rgba(22, 133, 104, 0.1);
}

.task-title {
  font-size: 13.5px;
  font-weight: 610;
}

.task-subtitle {
  color: var(--muted);
  font-size: 10.5px;
}

.meta-chip {
  min-height: 21px;
  color: #647087;
  background: #f0f3f7;
  border: 1px solid rgba(79, 96, 128, 0.07);
  border-radius: 7px;
}

.priority-1 {
  color: #a33246;
  background: #fff0f2;
}

.priority-2 {
  color: #95600f;
  background: #fff5df;
}

.priority-3 {
  color: #365ab5;
  background: #edf2ff;
}

.task-menu-button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.task-menu-button:hover {
  background: #eef2f7;
}

.empty-state {
  color: var(--faint);
}

.board-section {
  margin-bottom: 38px;
  padding-bottom: 4px;
}

.section-heading {
  margin-bottom: 14px;
}

.round-navigation {
  gap: 8px;
}

.round-navigation-status {
  color: var(--muted);
}

.history-view-banner {
  padding: 10px 13px;
  background: rgba(255, 244, 220, 0.9);
  border-color: rgba(165, 102, 18, 0.2);
  border-radius: 12px;
}

.days-board {
  grid-template-columns: repeat(7, minmax(158px, 1fr));
  gap: 14px 10px;
  min-width: 1160px;
  padding: 4px 3px 16px;
}

.board-section {
  scrollbar-color: rgba(79, 96, 128, 0.28) transparent;
}

.day-card {
  display: flex;
  flex-direction: column;
  min-height: 206px;
  padding: 13px 11px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(79, 96, 128, 0.14);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(36, 48, 71, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(128%);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
}

.day-card.is-today {
  position: relative;
  border-color: rgba(58, 103, 232, 0.4);
  box-shadow: 0 0 0 3px rgba(58, 103, 232, 0.055), var(--shadow-sm);
}

.day-card.is-today::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 999px 999px;
  content: "";
}

.day-card.is-past {
  min-height: 206px;
  color: #687285;
  background: rgba(234, 238, 244, 0.86);
  border-color: rgba(79, 96, 128, 0.1);
}

.day-card.is-home {
  min-height: 206px;
}

.day-card.is-past.is-home {
  min-height: 206px;
}

.day-card.is-today-summary {
  min-height: 206px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(237, 243, 255, 0.96));
}

.day-header {
  align-items: flex-start;
  flex: 0 0 47px;
  height: 47px;
  min-height: 47px;
  gap: 4px;
  margin-bottom: 11px;
  padding: 1px 1px 10px;
  border-bottom: 1px solid rgba(79, 96, 128, 0.09);
}

.day-name {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  column-gap: 5px;
  margin: 0;
  line-height: 1.2;
}

.day-name-text {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

.day-date,
.today-label,
.past-label {
  font-variant-numeric: tabular-nums;
}

.day-date {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: #727d90;
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1;
}

.today-label,
.past-label {
  margin: 0;
  font-size: 9px;
  font-weight: 720;
  line-height: 1;
}

.home-toggle {
  flex: 0 0 auto;
  min-height: 26px;
  gap: 4px;
  padding: 3px 0 3px 3px;
  color: #7c8799;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}

.home-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.home-toggle {
  position: relative;
}

.home-toggle input[role="switch"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.home-switch {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: #a5afbe;
  transition: background 120ms ease;
}

.home-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  transition: transform 120ms ease;
}

.home-toggle input:checked + .home-switch {
  background: var(--primary);
}

.home-toggle input:checked + .home-switch::after {
  transform: translateX(-12px);
}

.home-toggle input:focus-visible + .home-switch {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.subtask-progress {
  position: absolute;
  bottom: 0;
  inset-inline: 10px;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(34, 160, 99, 0.16);
}

.subtask-progress > span {
  display: block;
  height: 100%;
  background: #22a063;
  border-radius: inherit;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 8px;
}

.subtask-composer {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.subtask-composer input {
  flex: 1;
  min-width: 0;
}

.subtask-composer .button {
  flex: 0 0 42px;
  min-width: 42px;
  padding-inline: 0;
  font-size: 20px;
}

#edit-dialog {
  width: min(820px, calc(100vw - 26px));
  overflow: hidden;
}

#edit-form {
  display: flex;
  flex-direction: column;
  max-height: min(798px, calc(100vh - 32px));
}

#edit-form .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  scrollbar-color: rgb(var(--primary-rgb) / 0.42) transparent;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

#edit-form .modal-body::-webkit-scrollbar {
  width: 9px;
}

#edit-form .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

#edit-form .modal-body::-webkit-scrollbar-thumb {
  background: rgb(var(--primary-rgb) / 0.32);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

#edit-form .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--primary-rgb) / 0.5);
  background-clip: padding-box;
}

#edit-form .modal-header,
#edit-form .modal-footer {
  flex-shrink: 0;
}

.subtask-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.subtask-row input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  accent-color: #22a063;
}

.subtask-row input:checked + input {
  text-decoration: line-through;
  opacity: 0.65;
}

.day-card .quick-add input,
.day-card .quick-add textarea {
  min-height: 38px;
  height: 38px;
  padding: 8px 10px;
  border-color: rgba(79, 96, 128, 0.09);
  border-radius: 12px;
  font-size: 12px;
  line-height: 20px;
  text-align: right;
}

.day-card .quick-add {
  gap: 7px;
  margin-bottom: 8px;
}

.day-card .add-button {
  flex: 0 0 38px;
  min-height: 38px;
  border-radius: 12px;
  font-size: 19px;
  box-shadow: 0 5px 12px rgba(58, 103, 232, 0.18);
}

.day-card .task-card {
  grid-template-columns: 22px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 3px;
  min-height: 48px;
  padding: 5px 4px;
  border-radius: 12px;
}

.day-card .task-check {
  grid-row: 1 / span 2;
  grid-column: 1;
  width: 22px;
  height: 28px;
}

.day-card .task-main {
  grid-row: 1;
  grid-column: 2;
  padding: 2px 1px;
}

.day-card .task-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.day-card .task-meta {
  grid-row: 2;
  grid-column: 2;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.day-card .task-meta:empty {
  display: none;
}

.day-card .task-menu-button {
  grid-row: 1 / span 2;
  grid-column: 3;
  width: 24px;
  height: 28px;
}

.day-card .task-list {
  flex: 1 1 auto;
  gap: 7px;
}

.day-empty {
  display: flex;
  flex-direction: column;
  min-height: 58px;
  gap: 8px;
  padding: 12px 8px;
  color: #8792a4;
  background: rgba(246, 248, 252, 0.62);
  border: 1px solid rgba(79, 96, 128, 0.09);
  border-radius: 13px;
  font-size: 10.5px;
  font-weight: 520;
  line-height: 1.35;
}

.day-empty::before {
  width: 30px;
  height: 4px;
  background: rgba(58, 103, 232, 0.16);
  border-radius: 999px;
  content: "";
}

.day-card .today-overview-stat {
  margin: 8px 0 4px;
  font-size: 14.5px;
  line-height: 1.25;
  white-space: nowrap;
}

.day-card .today-overview-note {
  font-size: 10.5px;
  line-height: 1.4;
}

.day-actions button {
  min-height: 30px;
  color: #647087;
  background: #f1f4f8;
  border: 1px solid rgba(79, 96, 128, 0.07);
  border-radius: 9px;
}

.past-day-closed,
.past-task-row {
  background: rgba(255, 255, 255, 0.58);
  border-radius: 10px;
}

.overdue-decision {
  background: rgba(255, 244, 220, 0.88);
  border-color: rgba(165, 102, 18, 0.19);
  border-radius: 12px;
}

.today-focus-link {
  background: var(--primary-soft);
  border-color: rgba(58, 103, 232, 0.15);
  border-radius: 10px;
}

.drop-zone.is-drop-target,
.day-card.is-drop-target,
.person-card.is-drop-target {
  border-color: var(--primary) !important;
  background-color: #f3f6ff !important;
  box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-sm);
}

.support-sections {
  gap: 11px;
  width: min(1180px, 100%);
}

.collapsible-panel {
  border-radius: 16px;
}

.collapsible-panel > summary {
  min-height: 60px;
  padding: 13px 18px;
  transition: background-color 140ms ease;
}

.collapsible-panel > summary:hover {
  background: rgba(248, 250, 253, 0.82);
}

.summary-icon {
  width: 32px;
  height: 32px;
  color: #4665ae;
  background: rgba(58, 103, 232, 0.1);
  border: 1px solid rgba(58, 103, 232, 0.08);
  border-radius: 10px;
}

.summary-title {
  font-weight: 680;
}

.chevron {
  width: 9px;
  height: 9px;
  overflow: hidden;
  color: transparent;
  border-right: 1.8px solid #7a8598;
  border-bottom: 1.8px solid #7a8598;
  transform: rotate(45deg);
}

.collapsible-panel[open] .chevron {
  transform: rotate(225deg);
}

.details-body {
  padding: 5px 18px 18px;
  border-top-color: rgba(79, 96, 128, 0.11);
}

.person-card {
  padding: 13px;
  background: rgba(248, 250, 253, 0.84);
  border-color: var(--line);
  border-radius: 14px;
}

.round-notes-panel {
  width: min(1180px, 100%);
  margin-top: 30px;
  background: rgba(255, 253, 244, 0.95);
  border-color: rgba(151, 124, 53, 0.2);
  border-radius: 20px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.round-notes-heading {
  padding: 19px 21px 17px;
  background: linear-gradient(135deg, rgba(255, 244, 201, 0.94), rgba(255, 253, 244, 0.96) 62%);
  border-bottom-color: rgba(151, 124, 53, 0.16);
}

.round-notes-heading h2 {
  font-size: 20px;
  font-weight: 720;
}

.round-notes-icon {
  color: #89661c;
  background: rgba(236, 184, 55, 0.18);
  border-color: rgba(176, 129, 25, 0.2);
  border-radius: 13px;
}

.round-notes-mode {
  color: #745917;
  background: rgba(236, 184, 55, 0.16);
}

.round-notes-form {
  padding: 17px;
}

.round-notes-toolbar {
  gap: 4px;
  padding: 8px;
  background: #f7f0d9;
  border-color: rgba(151, 124, 53, 0.2);
  border-radius: 13px 13px 0 0;
}

.round-notes-toolbar button,
.round-notes-toolbar select {
  color: #51472f;
  border-radius: 9px;
}

.round-notes-toolbar button:hover,
.round-notes-toolbar button:focus-visible,
.round-notes-toolbar select:hover {
  background: #fffdf5;
  border-color: rgba(151, 124, 53, 0.28);
}

.round-notes-toolbar select {
  background: #fffdf5;
  border-color: rgba(151, 124, 53, 0.24);
}

.notepad-divider {
  background: rgba(151, 124, 53, 0.22);
}

.round-notes-editor {
  --notepad-line-height: 33px;
  min-height: 230px;
  padding: 24px 30px;
  color: #302d25;
  caret-color: #315fb8;
  background-color: #fffbed;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notepad-line-height) - 1px),
    rgba(75, 117, 168, 0.19) calc(var(--notepad-line-height) - 1px),
    rgba(75, 117, 168, 0.19) var(--notepad-line-height)
  );
  background-position: 0 25px;
  border-color: rgba(151, 124, 53, 0.24);
  border-radius: 0 0 13px 13px;
  box-shadow:
    inset 0 12px 22px -22px rgba(78, 62, 20, 0.42),
    inset 0 -1px 0 rgba(255, 255, 255, 0.75);
}

.round-notes-editor:focus {
  border-color: rgba(72, 111, 190, 0.58);
  box-shadow:
    inset 0 0 0 2px rgba(72, 111, 190, 0.1),
    inset 0 12px 22px -22px rgba(78, 62, 20, 0.42);
}

.round-notes-editor:empty::before {
  color: #8c8778;
}

.round-notes-editor h2,
.round-notes-editor h3,
.round-notes-editor p,
.round-notes-editor blockquote,
.round-notes-editor ul,
.round-notes-editor ol {
  line-height: var(--notepad-line-height);
}

.round-notes-editor ul,
.round-notes-editor ol {
  padding-inline-start: 24px;
}

.round-notes-editor blockquote {
  color: #675f4f;
  border-inline-start-color: #c89b32;
}

.round-notes-editor.is-read-only {
  color: #5a574f;
  background-color: #f7f4e8;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notepad-line-height) - 1px),
    rgba(99, 120, 146, 0.13) calc(var(--notepad-line-height) - 1px),
    rgba(99, 120, 146, 0.13) var(--notepad-line-height)
  );
  background-position: 0 25px;
}

.round-notes-footer {
  min-height: 50px;
}

.task-selection-mode-button.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(58, 103, 232, 0.22);
  box-shadow: inset 0 0 0 1px rgba(58, 103, 232, 0.08);
}

body.is-task-selection-mode .task-card[data-selectable="true"] {
  cursor: pointer;
  border-color: rgba(58, 103, 232, 0.22);
  box-shadow: 0 3px 12px rgba(38, 55, 87, 0.07);
}

body.is-task-selection-mode .task-card[data-selectable="true"]:hover {
  border-color: rgba(58, 103, 232, 0.55);
  background: rgba(244, 247, 255, 0.82);
}

body.is-task-selection-mode .task-card.is-selected {
  background: rgba(235, 241, 255, 0.96);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 103, 232, 0.12), 0 6px 18px rgba(38, 55, 87, 0.1);
}

body.is-task-selection-mode .task-card.is-selected .task-check > span:first-of-type {
  background: var(--primary);
  border-color: var(--primary);
}

body.is-task-selection-mode .task-card.is-selected .task-check > span:first-of-type::after {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  content: "✓";
}

.selection-toolbar {
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(780px, calc(100vw - 40px));
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--glass-strong);
  border-color: rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(26px) saturate(136%);
  backdrop-filter: blur(26px) saturate(136%);
}

.selection-summary {
  display: grid;
  gap: 2px;
  min-width: 170px;
}

.selection-summary strong {
  font-size: 13px;
}

.selection-toolbar .selection-summary span {
  color: var(--muted);
  font-size: 10.5px;
}

.selection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.selection-toolbar button {
  min-height: 34px;
  padding: 6px 10px;
  color: #334058;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(79, 96, 128, 0.12);
  border-radius: 9px;
}

.selection-toolbar button:hover {
  background: var(--surface-solid);
}

.selection-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.selection-toolbar .selection-primary {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.selection-toolbar .selection-primary:hover {
  background: var(--primary-dark);
}

.selection-toolbar .selection-danger {
  color: #b33a4a;
  background: rgba(255, 240, 242, 0.82);
  border-color: rgba(179, 58, 74, 0.16);
}

.bulk-edit-fields {
  display: grid;
  gap: 16px;
}

.bulk-edit-fields .field small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.search-scrim {
  background: rgba(10, 16, 28, 0.3);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.search-panel {
  top: 92px;
  background: var(--glass-strong);
  border-color: rgba(255, 255, 255, 0.66);
  border-radius: 20px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(28px) saturate(138%);
  backdrop-filter: blur(28px) saturate(138%);
}

.search-input-wrap {
  padding: 14px 16px;
  border-bottom-color: rgba(79, 96, 128, 0.13);
}

.search-input-wrap input {
  font-size: 16px;
}

kbd {
  color: #69758a;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(79, 96, 128, 0.16);
  border-radius: 7px;
  box-shadow: 0 1px 1px rgba(20, 29, 48, 0.04);
}

.search-results {
  padding: 9px;
}

.search-result {
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(79, 96, 128, 0.12);
}

.modal {
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(28px) saturate(138%);
  backdrop-filter: blur(28px) saturate(138%);
}

.modal::backdrop {
  background: rgba(10, 16, 28, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-header {
  padding: 21px 23px 16px;
  border-bottom-color: rgba(79, 96, 128, 0.13);
}

.modal-header h2 {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.modal-body {
  margin: 0 9px;
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
}

.modal-footer {
  padding: 14px 23px 17px;
  background: transparent;
  border-top-color: rgba(79, 96, 128, 0.11);
}

.field {
  color: #4e5b71;
  font-weight: 620;
}

.toggle {
  border-radius: 999px;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-header,
  .selection-toolbar,
  .search-panel,
  .modal {
    background: rgba(255, 255, 255, 0.96);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1118;
  --surface: rgba(27, 33, 45, 0.9);
  --surface-soft: rgba(36, 43, 57, 0.82);
  --surface-tint: #202b44;
  --surface-solid: #1b212d;
  --glass: rgba(29, 36, 49, 0.68);
  --glass-strong: rgba(29, 36, 49, 0.84);
  --ink: #f4f7fc;
  --muted: #b5becd;
  --faint: #8994a7;
  --line: rgba(213, 224, 244, 0.13);
  --line-strong: rgba(213, 224, 244, 0.23);
  --primary: #7c9cff;
  --primary-dark: #91acff;
  --primary-soft: rgba(124, 156, 255, 0.16);
  --success: #55c7a4;
  --success-soft: rgba(85, 199, 164, 0.13);
  --danger: #ff8293;
  --danger-soft: rgba(255, 130, 147, 0.13);
  --warning: #e7b15a;
  --warning-soft: rgba(231, 177, 90, 0.14);
  --home: #242a35;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 22px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 22px 64px rgba(0, 0, 0, 0.42), 0 4px 16px rgba(0, 0, 0, 0.24);
  --shadow-float: 0 12px 38px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 90% -8%, rgb(var(--primary-rgb) / 0.14), transparent 36rem),
    radial-gradient(circle at 3% 34%, rgba(58, 153, 132, 0.095), transparent 30rem),
    var(--page);
}

html[data-theme="dark"] .auth-screen {
  background:
    radial-gradient(circle at 80% 12%, rgba(89, 124, 224, 0.14), transparent 29rem),
    radial-gradient(circle at 14% 82%, rgba(58, 153, 132, 0.11), transparent 27rem),
    var(--page);
}

html[data-theme="dark"] .auth-card {
  background: rgba(27, 33, 45, 0.88);
  border-color: rgba(213, 224, 244, 0.14);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .selection-toolbar,
html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .modal {
  border-color: rgba(213, 224, 244, 0.15);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .panel-unassigned,
html[data-theme="dark"] .panel-today,
html[data-theme="dark"] .day-card {
  background: rgba(27, 33, 45, 0.92);
}

html[data-theme="dark"] .round-notes-panel {
  background: rgba(23, 30, 41, 0.96);
  border-color: rgba(124, 156, 255, 0.16);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .button-quiet:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .save-status,
html[data-theme="dark"] .selection-toolbar button,
html[data-theme="dark"] kbd {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

html[data-theme="dark"] .theme-color-menu {
  background: rgba(27, 33, 45, 0.97);
  border-color: rgba(213, 224, 244, 0.16);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .custom-theme-color {
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .task-selection-mode-button.is-active {
  color: #a8baff;
  background: rgba(124, 156, 255, 0.14);
  border-color: rgba(124, 156, 255, 0.24);
}

html[data-theme="dark"] body.is-task-selection-mode .task-card[data-selectable="true"]:hover,
html[data-theme="dark"] body.is-task-selection-mode .task-card.is-selected {
  background: rgba(40, 52, 78, 0.96);
  border-color: #7c9cff;
}

html[data-theme="dark"] .selection-toolbar .selection-primary {
  color: #101521;
  background: var(--primary);
  border-color: transparent;
}

html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .add-button {
  color: #101521;
}

html[data-theme="dark"] .day-card .add-button {
  flex-basis: 44px;
  min-width: 44px;
  min-height: 44px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: rgba(var(--primary-rgb), 0.24);
  box-shadow: none;
}

html[data-theme="dark"] .day-card .add-button:hover {
  color: var(--ink);
  background: rgba(var(--primary-rgb), 0.24);
}

html[data-theme="dark"] .selection-toolbar .selection-danger {
  color: #ff9aa8;
  background: rgba(142, 45, 61, 0.2);
  border-color: rgba(255, 154, 168, 0.18);
}

html[data-theme="dark"] .button-quiet,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .current-user,
html[data-theme="dark"] .round-date {
  color: var(--muted);
}

html[data-theme="dark"] .button:disabled {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

html[data-theme="dark"] .field {
  color: var(--muted);
}

html[data-theme="dark"] .collapsible-panel > summary:hover {
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .modal .button,
html[data-theme="dark"] .modal .icon-button,
html[data-theme="dark"] .auth-card .button {
  min-height: 44px;
}

html[data-theme="dark"] .modal .icon-button {
  min-width: 44px;
}

html[data-theme="dark"] .modal input,
html[data-theme="dark"] .modal textarea,
html[data-theme="dark"] .modal select {
  min-height: 44px;
}

html[data-theme="dark"] .quick-add input,
html[data-theme="dark"] .quick-add textarea,
html[data-theme="dark"] .day-actions button,
html[data-theme="dark"] .meta-chip,
html[data-theme="dark"] .person-card {
  background: var(--surface-soft);
}

html[data-theme="dark"] .round-notes-toolbar {
  background: #192331;
  border-color: rgba(124, 156, 255, 0.15);
}

html[data-theme="dark"] .round-notes-toolbar button,
html[data-theme="dark"] .round-notes-toolbar select {
  color: var(--muted);
}

html[data-theme="dark"] .round-notes-toolbar button:hover,
html[data-theme="dark"] .round-notes-toolbar button:focus-visible,
html[data-theme="dark"] .round-notes-toolbar select:hover {
  color: var(--ink);
  background: rgba(124, 156, 255, 0.11);
  border-color: rgba(124, 156, 255, 0.2);
}

html[data-theme="dark"] .task-card,
html[data-theme="dark"] .round-notes-toolbar select,
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .search-result:focus-visible {
  background: var(--surface-solid);
}

html[data-theme="dark"] .round-notes-toolbar select {
  background: #111a26;
  border-color: rgba(124, 156, 255, 0.17);
}

html[data-theme="dark"] .notepad-divider {
  background: rgba(156, 176, 214, 0.18);
}

html[data-theme="dark"] .round-notes-editor {
  color: #eef2f6;
  caret-color: #9bb6ff;
  background-color: #111a26;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notepad-line-height) - 1px),
    rgba(135, 172, 221, 0.13) calc(var(--notepad-line-height) - 1px),
    rgba(135, 172, 221, 0.13) var(--notepad-line-height)
  );
  background-position: 0 25px;
  border-color: rgba(124, 156, 255, 0.16);
  box-shadow:
    inset 0 12px 22px -22px rgba(0, 0, 0, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .round-notes-editor:focus {
  border-color: rgba(124, 156, 255, 0.64);
  box-shadow:
    inset 0 0 0 2px rgba(124, 156, 255, 0.11),
    inset 0 12px 22px -22px rgba(0, 0, 0, 0.9);
}

html[data-theme="dark"] .round-notes-editor:empty::before {
  color: #8491a5;
}

html[data-theme="dark"] .round-notes-editor::selection,
html[data-theme="dark"] .round-notes-editor *::selection {
  color: #ffffff;
  background: rgba(77, 121, 255, 0.42);
}

html[data-theme="dark"] .round-notes-editor blockquote {
  color: #c4ccd7;
  border-inline-start-color: #d8ad52;
}

html[data-theme="dark"] .round-notes-editor.is-read-only {
  color: #bac1cc;
  background-color: #151e2a;
}

html[data-theme="dark"] .task-card.is-selected,
html[data-theme="dark"] .drop-zone.is-drop-target,
html[data-theme="dark"] .day-card.is-drop-target,
html[data-theme="dark"] .person-card.is-drop-target {
  background: #202b44 !important;
}

html[data-theme="dark"] .day-card.is-past,
html[data-theme="dark"] .panel-today.is-home,
html[data-theme="dark"] .day-card.is-home {
  background: #202631;
}

html[data-theme="dark"] .past-day-closed,
html[data-theme="dark"] .past-task-row,
html[data-theme="dark"] .overdue-actions button {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

html[data-theme="dark"] .day-empty {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
}

html[data-theme="dark"] .day-actions button:hover,
html[data-theme="dark"] .home-toggle:hover,
html[data-theme="dark"] .task-menu-button:hover,
html[data-theme="dark"] .person-actions button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .day-card.is-today-summary,
html[data-theme="dark"] .round-notes-heading {
  background: linear-gradient(155deg, rgba(31, 42, 58, 0.98), rgba(23, 30, 41, 0.98));
  border-bottom-color: rgba(124, 156, 255, 0.13);
}

html[data-theme="dark"] .modal-body {
  background: rgba(10, 14, 21, 0.28);
}

html[data-theme="dark"] .summary-icon,
html[data-theme="dark"] .count-badge,
html[data-theme="dark"] .today-focus-link {
  color: #a8baff;
  background: rgba(124, 156, 255, 0.14);
  border-color: rgba(124, 156, 255, 0.14);
}

html[data-theme="dark"] .round-notes-icon,
html[data-theme="dark"] .round-notes-mode {
  color: #a8baff;
  background: rgba(124, 156, 255, 0.13);
  border-color: rgba(124, 156, 255, 0.17);
}

html[data-theme="dark"] .round-notes-autosave {
  color: #83d7bd;
  background: rgba(85, 199, 164, 0.1);
  border-color: rgba(85, 199, 164, 0.14);
}

html[data-theme="dark"] .round-notes-autosave.is-error {
  color: #ff9aaa;
  background: rgba(142, 45, 61, 0.2);
  border-color: rgba(255, 154, 168, 0.18);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--surface-solid);
}

html[data-theme="dark"] .priority-1 {
  color: #ff9aaa;
  background: rgba(255, 130, 147, 0.13);
}

html[data-theme="dark"] .priority-2 {
  color: #efc070;
  background: rgba(231, 177, 90, 0.14);
}

html[data-theme="dark"] .priority-3 {
  color: #9eb4ff;
  background: rgba(124, 156, 255, 0.15);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme="dark"] .app-header,
  html[data-theme="dark"] .selection-toolbar,
  html[data-theme="dark"] .search-panel,
  html[data-theme="dark"] .modal {
    background: rgba(29, 36, 49, 0.97);
  }
}

@media (max-width: 900px) {
  .app-header {
    min-height: 66px;
    padding: 10px 14px;
  }

  .app-main {
    padding-top: 22px;
  }

  .focus-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 30px;
  }

  .focus-resizer {
    display: none;
  }

  .panel-unassigned,
  .panel-today {
    min-height: 290px;
  }
}

@media (max-width: 620px) {
  .app-header {
    align-items: center;
    min-height: 62px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .app-main {
    padding: 18px 14px 58px;
  }

  .button {
    min-height: 38px;
    border-radius: 11px;
  }

  .focus-row {
    margin-bottom: 26px;
  }

  .panel-unassigned,
  .panel-today {
    min-height: 0;
    padding: 17px;
    border-radius: 18px;
  }

  .panel-heading h2,
  .section-heading h2 {
    font-size: 18px;
  }

  .days-board {
    grid-template-columns: repeat(7, minmax(270px, 84vw));
    gap: 12px;
    min-width: max-content;
    scroll-snap-type: x proximity;
  }

  .day-card {
    min-height: 280px;
    scroll-snap-align: start;
  }

  .collapsible-panel > summary {
    min-height: 56px;
    padding-inline: 14px;
  }

  .round-notes-panel {
    border-radius: 18px;
  }

  .round-notes-editor {
    padding: 18px;
  }

  .search-panel {
    top: 74px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 90px);
    border-radius: 18px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  #edit-dialog {
    width: calc(100vw - 20px);
  }

  .modal-header,
  .modal-footer {
    padding-inline: 17px;
  }

  .modal-body {
    margin-inline: 6px;
    padding-inline: 11px;
  }

  .selection-toolbar {
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 9px;
    border-radius: 14px;
  }
}

@media (forced-colors: active) {
  .app-header,
  .panel,
  .day-card,
  .task-card,
  .round-notes-panel,
  .selection-toolbar,
  .search-panel,
  .modal,
  .button,
  input,
  textarea,
  select {
    color: CanvasText;
    background: Canvas;
    border-color: ButtonBorder;
    box-shadow: none;
  }

  .panel-today::before,
  .day-card.is-today::before {
    background: Highlight;
  }
}

/* Task-option dropdowns — accessible glass listboxes. */
.glass-select {
  position: relative;
  width: 100%;
}

.glass-select-native {
  display: none !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0;
  pointer-events: none;
}

.glass-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 5px 7px 5px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(79, 96, 128, 0.2);
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.78), 0 4px 12px rgba(31, 45, 72, 0.045);
  font-size: 13.5px;
  font-weight: 650;
  text-align: start;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.glass-select-trigger:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(58, 103, 232, 0.36);
  box-shadow: inset 0 1px #fff, 0 7px 18px rgba(31, 45, 72, 0.075);
}

.glass-select-trigger:focus-visible,
.glass-select.is-open .glass-select-trigger {
  outline: none;
  background: var(--surface-solid);
  border-color: rgba(58, 103, 232, 0.68);
  box-shadow: 0 0 0 4px rgba(58, 103, 232, 0.11), 0 8px 20px rgba(31, 45, 72, 0.08);
}

.glass-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.glass-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-select-trigger.has-placeholder .glass-select-value {
  color: var(--muted);
  font-weight: 580;
}

.glass-select-chevron {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: rgba(239, 243, 250, 0.88);
  border: 1px solid rgba(79, 96, 128, 0.09);
  border-radius: 10px;
  transition: color 150ms ease, background-color 150ms ease, transform 180ms ease;
}

.glass-select-chevron svg,
.glass-select-option-check svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glass-select.is-open .glass-select-chevron {
  color: var(--primary);
  background: var(--primary-soft);
  transform: rotate(180deg);
}

.glass-select-menu {
  position: absolute;
  z-index: 170;
  top: calc(100% + 8px);
  right: 0;
  width: 100%;
  max-height: min(300px, 42vh);
  padding: 7px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 17px;
  box-shadow: 0 22px 56px rgba(25, 38, 66, 0.2), 0 4px 14px rgba(25, 38, 66, 0.08), inset 0 1px #fff;
  backdrop-filter: blur(24px) saturate(135%);
  scrollbar-color: rgba(97, 112, 141, 0.34) transparent;
  scrollbar-width: thin;
  transform-origin: top center;
  animation: glass-select-reveal 150ms cubic-bezier(.2, .78, .22, 1);
}

.glass-select-menu[hidden] {
  display: none;
}

.glass-select.opens-upward .glass-select-menu {
  top: auto;
  bottom: calc(100% + 8px);
  transform-origin: bottom center;
}

.glass-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 25px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px 7px 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 590;
  text-align: start;
  transition: color 110ms ease, background-color 110ms ease, border-color 110ms ease, transform 110ms ease;
}

.glass-select-option + .glass-select-option {
  margin-top: 2px;
}

.glass-select-option:hover:not(:disabled),
.glass-select-option:focus-visible {
  outline: none;
  color: var(--primary-dark);
  background: rgba(58, 103, 232, 0.075);
  border-color: rgba(58, 103, 232, 0.1);
}

.glass-select-option:active:not(:disabled) {
  transform: scale(0.988);
}

.glass-select-option[aria-selected="true"] {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: rgba(58, 103, 232, 0.16);
  font-weight: 730;
}

.glass-select-option:disabled {
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.52;
}

.glass-select-option-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-select-option-check {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: transparent;
  border-radius: 8px;
}

.glass-select-option[aria-selected="true"] .glass-select-option-check {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 12px rgba(58, 103, 232, 0.22);
}

@keyframes glass-select-reveal {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-theme="dark"] .glass-select-trigger {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(213, 224, 244, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), 0 5px 16px rgba(0, 0, 0, 0.13);
}

html[data-theme="dark"] .glass-select-trigger:hover,
html[data-theme="dark"] .glass-select-trigger:focus-visible,
html[data-theme="dark"] .glass-select.is-open .glass-select-trigger {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(124, 156, 255, 0.58);
}

html[data-theme="dark"] .glass-select-chevron {
  color: #aeb9ca;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(213, 224, 244, 0.1);
}

html[data-theme="dark"] .glass-select.is-open .glass-select-chevron {
  color: #b9c8ff;
  background: rgba(124, 156, 255, 0.15);
}

html[data-theme="dark"] .glass-select-menu {
  background: rgba(29, 36, 49, 0.96);
  border-color: rgba(213, 224, 244, 0.18);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.06);
  scrollbar-color: rgba(190, 202, 224, 0.3) transparent;
}

html[data-theme="dark"] .glass-select-option:hover:not(:disabled),
html[data-theme="dark"] .glass-select-option:focus-visible {
  color: #dbe4ff;
  background: rgba(124, 156, 255, 0.11);
  border-color: rgba(124, 156, 255, 0.14);
}

html[data-theme="dark"] .glass-select-option[aria-selected="true"] {
  color: #eef2ff;
  background: rgba(124, 156, 255, 0.17);
  border-color: rgba(124, 156, 255, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .glass-select-menu {
    animation: none;
  }
}

/* Weekly scoring — compact desktop glass surface. */
.scoreboard-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 2.2fr) auto;
  align-items: center;
  gap: 24px;
  margin: 18px 0 28px;
  padding: 20px 22px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 24px;
  box-shadow: 0 16px 42px rgba(26, 40, 70, 0.09), inset 0 1px rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(22px) saturate(118%);
}

.scoreboard-panel[hidden] {
  display: none;
}

.scoreboard-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.scoreboard-symbol {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 78%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 18px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8), 0 8px 18px rgba(49, 95, 219, 0.12);
}

.scoreboard-symbol svg {
  width: 27px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scoreboard-heading h2,
.scoreboard-heading p {
  margin: 0;
}

.scoreboard-heading h2 {
  margin-top: 1px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.scoreboard-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.scoreboard-content {
  min-width: 0;
}

.scoreboard-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scoreboard-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 16px;
}

.scoreboard-entry.is-current-user {
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 8%, transparent);
}

.scoreboard-rank {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.scoreboard-entry.rank-1 .scoreboard-rank {
  color: #765300;
  background: #fff4c7;
  border-color: #ead27a;
}

.scoreboard-entry.rank-2 .scoreboard-rank {
  color: #526076;
  background: #edf1f6;
  border-color: #cad2de;
}

.scoreboard-entry.rank-3 .scoreboard-rank {
  color: #784f35;
  background: #f8e4d5;
  border-color: #ddb89e;
}

.scoreboard-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scoreboard-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.scoreboard-identity strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard-points {
  grid-column: 2;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.scoreboard-empty {
  padding: 12px 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  text-align: center;
}

.scoreboard-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.scoreboard-participation {
  max-width: 170px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: end;
}

.scoreboard-preferences-button.is-opted-out {
  color: var(--muted);
}

.scoreboard-consent-dialog {
  width: min(510px, calc(100vw - 48px));
}

.scoreboard-consent-header {
  padding-bottom: 14px;
}

.scoreboard-consent-body {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.scoreboard-consent-body > p {
  max-width: 390px;
  margin: 0;
}

.scoreboard-podium {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 65px;
  color: var(--primary);
}

.scoreboard-podium i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 39px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 12px 12px 5px 5px;
  font-style: normal;
  font-weight: 800;
}

.scoreboard-podium i:nth-child(2) {
  height: 60px;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.scoreboard-consent-toggle {
  width: 100%;
  margin: 2px 0 0;
  text-align: start;
}

.scoreboard-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.score-burst {
  position: fixed;
  z-index: 3;
  padding: 7px 12px;
  color: #fff;
  background: var(--primary);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(49, 95, 219, 0.3);
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
  transform: translate(50%, -50%);
  animation: score-burst-rise 1400ms cubic-bezier(.18, .72, .24, 1) forwards;
}

@keyframes score-burst-rise {
  0% { opacity: 0; transform: translate(50%, -35%) scale(.7); }
  18% { opacity: 1; transform: translate(50%, -80%) scale(1.05); }
  78% { opacity: 1; transform: translate(50%, -145%) scale(1); }
  100% { opacity: 0; transform: translate(50%, -190%) scale(.92); }
}

html[data-theme="dark"] .scoreboard-panel {
  background: var(--surface-solid);
  border-color: rgba(139, 157, 190, 0.23);
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme="dark"] .scoreboard-entry {
  background: rgba(33, 42, 59, 0.76);
  border-color: rgba(139, 157, 190, 0.18);
}

html[data-theme="dark"] .scoreboard-entry.is-current-user {
  background: rgba(56, 86, 164, 0.28);
  border-color: rgba(111, 145, 238, 0.52);
}

html[data-theme="dark"] .scoreboard-rank {
  background: #242d3e;
  border-color: #46536a;
}

html[data-theme="dark"] .scoreboard-avatar {
  color: #cbd8ff;
  background: rgba(72, 106, 200, 0.34);
}

html[data-theme="dark"] .scoreboard-podium i {
  background: #20293a;
  border-color: #46536a;
}

html[data-theme="dark"] .scoreboard-podium i:nth-child(2) {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 1220px) and (min-width: 901px) {
  .scoreboard-panel {
    grid-template-columns: minmax(210px, .8fr) minmax(0, 2fr);
  }

  .scoreboard-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .scoreboard-list {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .score-burst {
    animation: none;
    display: none;
  }
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 240;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Keep the working surfaces edge-to-edge on desktop while preserving a small gutter. */
@media (min-width: 901px) {
  .app-main {
    width: 100%;
    max-width: none;
    padding-inline: clamp(14px, 1.5vw, 28px);
  }

  .focus-row,
  .support-sections,
  .round-notes-panel {
    width: 100%;
    max-width: none;
  }

  .focus-row.has-no-today {
    grid-template-columns: minmax(0, 1fr);
  }
}

.confetti-particle {
  position: absolute;
  left: var(--confetti-x);
  top: var(--confetti-y);
  width: 7px;
  height: 11px;
  border-radius: 2px;
  background: var(--confetti-color);
  box-shadow: 0 1px 3px rgb(31 46 95 / 18%);
  opacity: 0;
  will-change: transform, opacity;
  animation: task-confetti-burst var(--confetti-duration) cubic-bezier(.16, .74, .28, 1)
    var(--confetti-delay) forwards;
}

.confetti-particle.is-round {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.confetti-particle.is-streamer {
  width: 4px;
  height: 15px;
  border-radius: 999px;
}

.confetti-ring {
  position: absolute;
  width: 18px;
  height: 18px;
  translate: -50% -50%;
  border: 3px solid rgb(79 109 245 / 78%);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 70%), 0 8px 22px rgb(79 109 245 / 24%);
  animation: task-confetti-ring 720ms cubic-bezier(.2, .8, .2, 1) forwards;
}

@keyframes task-confetti-burst {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(.2) rotate(0deg);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  46% {
    transform: translate3d(var(--confetti-mid-x), var(--confetti-mid-y), 0) scale(1)
      rotate(var(--confetti-mid-rotation));
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--confetti-end-x), var(--confetti-end-y), 0) scale(.72)
      rotate(var(--confetti-rotation));
    opacity: 0;
  }
}

@keyframes task-confetti-ring {
  0% {
    scale: .25;
    opacity: 1;
  }

  100% {
    scale: 4.2;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-particle,
  .confetti-ring {
    display: none;
    animation: none;
  }
}

@media (forced-colors: active) {
  .confetti-particle,
  .confetti-ring {
    display: none;
  }
}

@media (max-width: 620px) {
  .theme-color-menu {
    position: fixed;
    top: 72px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 84px);
    overflow-y: auto;
  }
}

.team-body { display: grid; gap: 14px; }
.team-body input, #scoreboard-display-name { width: 100%; padding: 10px; border: 1px solid var(--line, #ccd2dc); border-radius: 10px; background: var(--surface, #fff); color: inherit; }
.team-list { list-style: none; margin: 0; padding-inline-start: 18px; border-inline-start: 2px solid var(--line, #ccd2dc); }
.team-member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; }
.team-member > span { flex: 1 1 180px; overflow-wrap: anywhere; }
.team-search-controls { display: flex; gap: 8px; margin-top: 6px; }
.team-search-controls input { min-width: 0; }
#team-accept-form { padding: 16px; border: 1px solid var(--line, #ccd2dc); border-radius: 12px; }
#team-accept-form .button { margin-top: 12px; }
.shared-board-banner { position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 100; padding: 12px; text-align: center; border: 2px solid var(--accent, #4169e1); border-radius: 12px; background: var(--surface, #fff); color: var(--ink, #202838); box-shadow: 0 4px 20px #0002; }
.tutorial-page { max-width: 820px; margin: 40px auto; padding: 24px; line-height: 1.8; }
.tutorial-page h2 { margin-top: 28px; }
.tutorial-dialog { position: fixed; inset: auto 16px 16px auto; margin: 0; width: min(440px, calc(100vw - 32px)); max-height: 45vh; overflow: auto; border: 1px solid #a0a8b8; border-radius: 18px; padding: 22px; background: var(--surface, #fff); color: var(--ink, #202838); box-shadow: 0 12px 50px #0004; }
.tutorial-dialog::backdrop { background: #14203555; }
.tutorial-dialog p { line-height: 1.65; }
.tutorial-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.tutorial-highlight { position: fixed; pointer-events: none; border: 3px solid #4d8aff; border-radius: 10px; box-shadow: 0 0 0 3px #fff; }
@media (max-width: 600px) { .tutorial-dialog { padding: 14px; } .tutorial-page { margin: 0 auto; } }

.header-more {
  position: relative;
}

.header-more > summary {
  list-style: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.header-more > summary::-webkit-details-marker {
  display: none;
}

.header-more-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 9px);
  inset-inline-end: 0;
  display: grid;
  min-width: 190px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.header-more-menu .button {
  justify-content: flex-start;
  text-align: start;
}

#soldiers-panel[hidden],
#soldiers-panel-option[hidden] {
  display: none;
}

#soldiers-panel-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

#soldiers-panel-toggle {
  width: auto;
  accent-color: var(--primary);
}

.soldiers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}

.soldier-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.soldier-card > div {
  display: grid;
  flex: 1 1 140px;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.soldier-card .muted {
  font-size: 12px;
}
