:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f1f3f4;
  --border: #dadce0;
  --text: #3c4043;
  --text-muted: #5f6368;
  --text-strong: #202124;
  --primary: #2196F3;
  --primary-soft: #e3f2fd;
  --primary-hover: #1976D2;
  --meeting: #9334e6;
  --meeting-soft: #f3e8fd;
  --task: #1a73e8;
  --due: #ea8600;
  --done: #188038;
  --danger: #d93025;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 12px rgba(60, 64, 67, 0.08);
  --topbar-h: 52px;
  --bottom-nav-h: 58px;
  font-family: "Google Sans", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); }

.page-login { display: grid; place-items: center; padding: 1.5rem; min-height: 100dvh; }
.login-card {
  width: min(100%, 400px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand h1 { margin: 0.5rem 0 0; color: var(--text-strong); }
.logo-mark {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 12px; background: transparent; border: 2px solid var(--primary);
  color: var(--primary); font-weight: 700; font-size: 1.4rem;
}
.logo-mark.sm { width: 34px; height: 34px; font-size: 1rem; }

.icon {
  width: 1.15rem; height: 1.15rem; flex-shrink: 0;
  stroke: currentColor; fill: none;
}
.icon-xs { width: 0.85rem; height: 0.85rem; }
.btn-with-icon { display: inline-flex; align-items: center; gap: 0.35rem; }
.hide-sm { display: inline; }

#login-form label { display: block; margin-bottom: 1rem; font-size: 0.85rem; color: var(--text-muted); }
#login-form input {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.8rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.form-error { color: var(--danger); font-size: 0.85rem; }

.btn {
  border: none; border-radius: 999px; padding: 0.55rem 1rem; cursor: pointer;
  font-weight: 600; transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.btn:focus-visible, .btn-icon:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-alt); border-color: #c4c7cc; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f5c2c0; }
.btn-danger:hover { background: #fce8e6; }
.btn-icon {
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; padding: 0.4rem; color: var(--text-muted);
}
.btn-icon:hover { background: var(--surface-alt); color: var(--text-strong); border-color: var(--border); }

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }

#btn-install-app[hidden], #install-hint[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
html { scrollbar-width: thin; scrollbar-color: #c5cad1 transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: #c5cad1; border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

.btn-icon:hover { background: var(--surface-alt); color: var(--text-strong); border-color: transparent; }
.btn-icon-only { padding: 0.45rem; border: none !important; background: transparent; }

.topbar { padding: 0.5rem 0.85rem; gap: 0.5rem; }
.brand-link { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-full { height: 30px; width: auto; display: block; }
.logo-icon { display: none; width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.topbar-start, .topbar-end { display: flex; align-items: center; }
.topbar-start { gap: 0.65rem; flex: 1; min-width: 0; }
.topbar-end { gap: 0.35rem; flex-shrink: 0; }

.search-wrap {
  position: relative; flex: 1; min-width: 0; max-width: 420px;
}
.search-icon {
  position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 0.45rem 0.75rem 0.45rem 2.15rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-alt);
  font-size: 0.85rem;
}
.search-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 2px var(--primary-soft); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); max-height: min(60dvh, 360px); overflow-y: auto; padding: 0.35rem;
}
.search-hit {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 0.55rem 0.65rem; border-radius: 8px; cursor: pointer;
}
.search-hit:hover, .search-hit:focus-visible { background: var(--primary-soft); outline: none; }
.search-hit-type { font-size: 0.72rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.03em; }
.search-hit-title { font-size: 0.88rem; font-weight: 600; color: var(--text-strong); line-height: 1.35; }
.search-hit-snippet { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }
.search-empty { margin: 0.5rem 0.65rem; font-size: 0.85rem; color: var(--text-muted); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: var(--bottom-nav-h);
}
.bottom-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem; border: none; background: transparent; cursor: pointer;
  padding: 0.4rem 0.25rem 0.45rem; color: var(--text-muted); font-size: 0.68rem; font-weight: 600;
}
.bottom-tab .icon { width: 1.35rem; height: 1.35rem; }
.bottom-tab.active { color: var(--primary); }
.bottom-tab.active .icon { stroke-width: 2.1; }

.search-flash {
  animation: search-flash 2s ease;
}
@keyframes search-flash {
  0%, 100% { box-shadow: none; }
  15%, 45% { box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary); }
}

.select-pill, .user-pill {
  border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.75rem;
  background: var(--surface); font-size: 0.85rem;
}
.user-pill { color: var(--text-muted); }

.view { flex: 1; display: none; min-height: 0; }
.view.is-visible { display: flex; flex-direction: column; }

#view-board.is-visible { display: block; }

.board {
  display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 0.85rem; padding: 0.85rem; align-items: start;
}
@media (max-width: 960px) { .board { grid-template-columns: 1fr; } }

.column {
  background: var(--surface-alt); border-radius: 14px; border: 1px solid var(--border);
  min-height: 180px; max-height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h) - 1.5rem);
  display: flex; flex-direction: column;
}
.column-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0.9rem; border-bottom: 3px solid #9aa0a6;
}
.column-header.progress { border-bottom-color: var(--meeting); }
.column-header.done { border-bottom-color: var(--done); }
.column-header h2 { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.count {
  font-size: 0.75rem; background: transparent; color: var(--text-muted);
  padding: 0.1rem 0.45rem; border-radius: 999px; border: 1px solid var(--border);
}
.column-body { flex: 1; overflow-y: auto; padding: 0.55rem; min-height: 100px; }
.column-body.drag-over { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: -4px; }

.task-card {
  display: flex; flex-direction: row; align-items: stretch; gap: 0.55rem;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--task);
  border-radius: var(--radius); padding: 0.65rem 0.7rem; margin-bottom: 0.45rem;
  cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.task-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.task-card-aside {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between; min-width: 1.25rem; color: var(--primary);
}
.task-card-aside .icon { width: 1rem; height: 1rem; opacity: 0.85; }
.task-card-title { font-size: 0.92rem; color: var(--text-strong); line-height: 1.35; word-break: break-word; font-weight: 600; }
.task-card-preview {
  margin: 0; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card-preview:empty { display: none; }
.task-card-preview strong { color: var(--text); font-weight: 600; }
.task-card-date { font-size: 0.72rem; color: var(--due); font-weight: 600; white-space: nowrap; }
.task-card-date:empty { display: none; }
.task-card-meta { display: none; }
.task-card.meeting { border-left-color: var(--meeting); }
.task-card:hover { box-shadow: var(--shadow); }
.task-card.dragging { opacity: 0.55; }
.badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  background: transparent; color: var(--primary);
  padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid currentColor;
  font-weight: 600; line-height: 1.3;
}
.badge.meeting { color: var(--meeting); }
.badge.due { color: var(--due); }
.badge-icon { padding: 0.1rem 0.35rem; }

.calendar-toolbar {
  display: flex; align-items: center; gap: 0.35rem; padding: 0.65rem 0.75rem 0.25rem;
  flex-shrink: 0;
}
.calendar-toolbar h2 { margin: 0; flex: 1; text-align: center; font-size: 1.05rem; color: var(--text-strong); }
.btn-nav { min-width: 2.25rem; padding-inline: 0.65rem; font-size: 1.2rem; line-height: 1; }

.calendar-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 0.75rem;
  padding: 0 0.75rem 0.75rem; flex: 1; min-height: 0; align-items: start;
}

.calendar-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 100%; width: 100%;
}
.cal-head {
  background: var(--surface-alt); padding: 0.5rem 0.25rem; text-align: center;
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.cal-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.2rem;
  background: var(--surface); min-height: 88px; padding: 0.35rem;
  cursor: pointer; transition: background 0.12s; border: none; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); text-align: left; font: inherit; color: inherit;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #fafbff; }
.cal-day.other { background: #fbfcfd; color: #9aa0a6; }
.cal-day.today .cal-day-num {
  background: transparent; color: var(--primary); border: 2px solid var(--primary);
  border-radius: 999px; width: 1.6rem; height: 1.6rem; display: inline-grid; place-items: center;
}
.cal-day.selected { background: var(--primary-soft); outline: 2px solid var(--primary); outline-offset: -2px; z-index: 1; }
.cal-day-num { font-size: 0.78rem; font-weight: 600; line-height: 1.2; align-self: flex-start; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: auto; padding-bottom: 0.15rem; }
.cal-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--primary); }
.cal-dot.meeting { background: var(--meeting); }
.cal-event {
  display: block; font-size: 0.68rem; padding: 0.15rem 0.35rem; border-radius: 4px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-event.task { background: transparent; color: var(--primary); border: 1px solid var(--primary-soft); border-left: 3px solid var(--primary); }
.cal-event.meeting { background: transparent; color: var(--meeting); border: 1px solid var(--meeting-soft); border-left: 3px solid var(--meeting); }
.cal-more { font-size: 0.65rem; color: var(--text-muted); padding-left: 0.2rem; }

.calendar-sidebar { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.calendar-day-detail, .calendar-agenda {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0.75rem;
}
.calendar-day-detail h3, .calendar-agenda h3 {
  margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--text-strong);
}
.day-events-list, #agenda-list { list-style: none; margin: 0; padding: 0; }
.day-events-list li, #agenda-list li {
  display: flex; gap: 0.65rem; padding: 0.55rem 0 0.55rem 0.5rem;
  border-bottom: 1px solid var(--surface-alt); border-left: 3px solid var(--task-accent, transparent);
  cursor: pointer;
}
.day-events-list li:last-child, #agenda-list li:last-child { border-bottom: none; }
.empty-day { color: var(--text-muted); font-size: 0.82rem; padding: 0.5rem 0; cursor: default; }
.day-events-list .what small { display: block; color: var(--text-muted); font-size: 0.72rem; margin-top: 0.15rem; }
#agenda-list .when { min-width: 3.5rem; font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
#agenda-list .what, .day-events-list .what { flex: 1; font-size: 0.85rem; color: var(--text-strong); min-width: 0; word-break: break-word; }

.invite-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem;
  margin-bottom: 0.55rem; background: var(--surface-alt);
}
.invite-card strong { display: block; margin-bottom: 0.45rem; font-size: 0.88rem; }
.invite-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.invite-input {
  flex: 1 1 100%; min-width: 0; padding: 0.45rem 0.55rem; font-size: 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.btn-block { display: block; width: 100%; text-align: center; text-decoration: none; }
.join-back { margin-top: 1rem; text-align: center; font-size: 0.85rem; }

@media (max-width: 900px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-sidebar { order: -1; }
  .calendar-day-detail { order: 0; }
}

@media (max-width: 640px) {
  .topbar { padding: 0.5rem; gap: 0.4rem; }
  .topbar-start, .topbar-end { width: 100%; justify-content: space-between; }
  .logo-full { display: none; }
  .logo-icon { display: block; }
  .search-wrap { max-width: none; order: 3; width: 100%; }
  .topbar-start { flex-wrap: wrap; }
  #team-filter { flex: 1; min-width: 0; max-width: 8rem; }
  .btn-primary#btn-new { padding-inline: 0.75rem; font-size: 0.85rem; }

  .board { padding: 0.5rem; gap: 0.5rem; }
  .column { max-height: none; }

  .calendar-toolbar h2 { font-size: 0.95rem; }
  .cal-day { min-height: 52px; padding: 0.25rem; }
  .cal-head { font-size: 0.62rem; padding: 0.35rem 0.1rem; }
  .bottom-tab span { font-size: 0.62rem; }
  .search-input::placeholder { font-size: 0.78rem; }
  .modal.modal-task {
    width: 100%; max-width: 100%; margin: 0; border-radius: 16px 16px 0 0;
    height: 92dvh; max-height: 92dvh;
  }
  .modal-body { max-height: none; }
  .textarea-notes { min-height: 38vh; }
  .invite-row .btn { flex: 1; }
}

@media (max-width: 380px) {
  .cal-head:nth-child(n+2):nth-child(-n+7) { font-size: 0; }
  .cal-head:nth-child(n+2):nth-child(-n+7)::first-letter { font-size: 0.62rem; }
}

.modal {
  border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface);
  color: var(--text); width: min(96vw, 520px); box-shadow: var(--shadow);
}
.modal.modal-task {
  width: min(96vw, 680px); height: min(88dvh, 820px); max-height: 88dvh;
}
.modal-form {
  display: flex; flex-direction: column; height: 100%; max-height: 88dvh;
}
.modal::backdrop { background: rgba(32, 33, 36, 0.45); }
.modal-head, .modal-foot {
  display: flex; align-items: center; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-foot { border-bottom: none; border-top: 1px solid var(--border); gap: 0.5rem; }
.modal-head h3 { margin: 0; flex: 1; color: var(--text-strong); font-size: 1.05rem; }
.modal-body {
  padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem;
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.modal-body label.field-compact,
.modal-body label.field-title,
.modal-body label.field-notes { display: block; font-size: 0.82rem; color: var(--text-muted); }
.modal-body label.field-compact input,
.modal-body label.field-compact select,
.modal-body label.field-inline input,
.modal-body .textarea-notes,
.modal-body .copy-input {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.modal-body label.toggle-row {
  display: flex !important; align-items: center; justify-content: space-between;
  width: 100%; margin: 0; font-size: 0.88rem; color: var(--text-strong);
}
.modal-body .toggle-input {
  width: 2.5rem; height: 1.45rem; min-width: 2.5rem; max-width: 2.5rem;
  margin: 0; padding: 0; border: none; flex-shrink: 0;
}
.modal-row-top { display: flex; flex-direction: column; gap: 0.65rem; flex-shrink: 0; }
.field-title { margin: 0; }
.field-label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 600; }
.field-notes {
  display: flex; flex-direction: column; flex: 0 0 auto; margin: 0;
}
.textarea-notes {
  min-height: 200px; max-height: 45vh; margin-top: 0 !important;
  resize: vertical; line-height: 1.55; font-size: 0.92rem;
}
.modal-details-inner {
  display: flex; flex-direction: column; gap: 0.65rem;
  padding: 0.75rem; overflow: visible;
  background: var(--surface);
}
.detail-panel-reminders { border: none; background: #f8faff; padding: 0.85rem; }
.detail-panel-reminders .toggle-row-main { border-bottom: none; margin-bottom: 0; padding-bottom: 0.5rem; }
.modal-details {
  flex-shrink: 0; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.modal-details-summary {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; padding: 0.75rem 1rem; font-size: 0.88rem; font-weight: 600;
  color: var(--text-strong); list-style: none; background: var(--surface);
  border-bottom: 1px solid transparent; transition: background 0.12s;
}
.modal-details[open] .modal-details-summary { border-bottom-color: var(--border); background: #fafbff; }
.modal-details-summary::-webkit-details-marker { display: none; }
.modal-details-summary::after {
  content: ""; width: 0.45rem; height: 0.45rem; margin-left: auto;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform 0.15s;
}
.modal-details[open] .modal-details-summary::after { transform: rotate(-135deg); margin-top: 0.2rem; }
.detail-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.55rem;
}
.detail-panel-head {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin: 0;
}
.field-compact { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.field-compact input, .field-compact select {
  margin-top: 0.3rem; padding: 0.55rem 0.65rem; border-radius: 8px;
}
.field-inline input { margin-top: 0.35rem; }
.field-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem;
}
@media (max-width: 520px) { .field-grid-2 { grid-template-columns: 1fr; } }

.toggle-row {
  display: flex !important; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.35rem 0; margin: 0; font-size: 0.88rem; color: var(--text-strong);
}
.toggle-row-main { padding: 0.15rem 0 0.35rem; border-bottom: 1px solid var(--surface-alt); margin-bottom: 0.15rem; }
.toggle-input {
  appearance: none; width: 2.5rem; height: 1.45rem; border-radius: 999px;
  background: var(--border); position: relative; cursor: pointer; flex-shrink: 0; margin: 0;
  transition: background 0.15s;
}
.toggle-input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 1.1rem; height: 1.1rem;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.15s;
}
.toggle-input:checked { background: var(--primary); }
.toggle-input:checked::after { transform: translateX(1.05rem); }

.reminder-options { display: flex; flex-direction: column; gap: 0.55rem; padding-top: 0.35rem; }
.reminder-hint { margin: 0; font-size: 0.78rem; color: var(--text-muted); }
.reminder-grid {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.reminder-chip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: auto; padding: 0.28rem 0.55rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); cursor: pointer;
  font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.reminder-chip input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0; padding: 0; pointer-events: none;
}
.reminder-chip span { pointer-events: none; line-height: 1.2; }
.reminder-chip:has(input:checked) {
  border-color: var(--primary); color: var(--primary); background: var(--primary-soft);
  box-shadow: none;
}
.icon-sm { width: 0.95rem; height: 0.95rem; }

.logo-img { display: block; border-radius: 10px; }
.logo-img.sm { width: 34px; height: 34px; }
.brand-r { color: var(--primary); }
.brand-me { color: var(--text-muted); font-weight: 600; }
.login-logo { display: block; margin: 0 auto 0.75rem; border-radius: 18px; box-shadow: var(--shadow); }
.login-brand h1 { margin: 0.35rem 0 0; font-size: 2rem; letter-spacing: -0.02em; }
.modal:not(.modal-task) .modal-body { max-height: 70dvh; overflow-y: auto; }

.kind-tabs { display: flex; gap: 0.35rem; }
.kind-tab {
  flex: 1; text-align: center; padding: 0.45rem; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 0.85rem;
}
.kind-tab:has(input:checked) {
  border-color: var(--primary); background: transparent; color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.kind-tab input { display: none; }

.reminder-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; margin: 0; }
.reminder-box legend { padding: 0 0.35rem; font-size: 0.78rem; color: var(--text-muted); }
.hint { margin: 0.35rem 0; font-size: 0.78rem; color: var(--text-muted); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.55rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.78rem; cursor: pointer;
}
.chip:has(input:checked) {
  background: transparent; border-color: var(--primary); color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.checkbox-row { display: flex !important; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; margin: 0; }
.spacer { flex: 1; }

.inline-form { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.inline-form input, .inline-form select { flex: 1; min-width: 120px; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); }
.stack-form { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.5rem; }
.stack-form input { padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); }

.team-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem; background: var(--surface-alt);
}
.team-card h4 { margin: 0 0 0.35rem; font-size: 0.9rem; }
.team-card ul { margin: 0; padding-left: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.create-user-box { margin-top: 0.75rem; font-size: 0.85rem; }
.create-user-box summary { cursor: pointer; color: var(--primary); }

.color-picker { border: none; margin: 0; padding: 0; }
.color-picker legend { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.color-swatch { cursor: pointer; position: relative; }
.color-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch .color-dot {
  display: block; width: 1.55rem; height: 1.55rem; border-radius: 999px;
  border: 2px solid var(--border); transition: transform 0.12s, box-shadow 0.12s;
}
.color-swatch.is-none .color-dot {
  background: linear-gradient(135deg, var(--surface) 45%, var(--border) 45%, var(--border) 55%, var(--surface) 55%);
}
.color-swatch:has(input:checked) .color-dot {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary);
}
.task-card.has-color { border-left-width: 5px; }
.cal-event.has-color { border-left-width: 3px; border-left-style: solid; }
.cal-dot.has-color { border: 1px solid rgba(0,0,0,0.08); }

.install-body h4 { margin: 1rem 0 0.35rem; font-size: 0.92rem; color: var(--text-strong); }
.install-steps, .install-steps-list { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.45; }
.install-steps li, .install-steps-list li { margin-bottom: 0.45rem; }
.install-body code { font-size: 0.8rem; background: var(--surface-alt); padding: 0.1rem 0.35rem; border-radius: 4px; }
.modal-install { width: min(96vw, 560px); }
.install-body .btn-block { margin: 0.75rem 0; }
.install-logo { display: block; margin: 0 auto 0.85rem; border-radius: 14px; box-shadow: var(--shadow); }

#view-notes.is-visible { display: flex; flex-direction: column; min-height: 0; }
.notes-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--border); background: var(--surface);
}
.notes-toolbar h2 { margin: 0; font-size: 1rem; color: var(--text-strong); }
.notes-hint { margin: 0; flex: 1; font-size: 0.8rem; color: var(--text-muted); }
.notes-hint kbd { font-size: 0.75rem; background: var(--surface-alt); padding: 0.1rem 0.35rem; border-radius: 4px; }
.notes-list {
  flex: 1; overflow-y: auto; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.65rem;
  max-width: 720px; width: 100%; margin: 0 auto;
}
.note-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.55rem 0.65rem 0.65rem; display: flex; flex-direction: column; gap: 0.35rem;
}
.note-toolbar { display: flex; align-items: center; gap: 0.35rem; }
.note-toolbar .spacer { flex: 1; }
.btn-note-bold {
  border: none; background: var(--surface-alt); color: var(--text-strong);
  font-weight: 700; width: 1.75rem; height: 1.75rem; border-radius: 6px; cursor: pointer;
}
.btn-note-bold:hover { background: var(--primary-soft); color: var(--primary); }
.note-input {
  width: 100%; border: none; background: transparent; resize: vertical;
  min-height: 4.5rem; line-height: 1.5; font-size: 0.92rem; padding: 0.15rem 0;
}
.note-input:focus { outline: none; }
.login-logo-full { display: block; margin: 0 auto 0.5rem; max-width: min(100%, 220px); height: auto; }
.install-hint { margin-top: 0.75rem; }

.toast-host {
  position: fixed; top: 0.85rem; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  pointer-events: none; width: min(92vw, 420px);
}
.toast {
  width: 100%; padding: 0.65rem 0.9rem; border-radius: 12px;
  background: var(--text-strong); color: #fff; font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--done); }
.toast-warn { background: var(--due); color: #fff; }
.toast-info { background: var(--text-strong); }

.modal-compact { width: min(92vw, 400px); }
.modal-compact .modal-body { padding: 0.85rem 1rem; }
.ui-message { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--text); white-space: pre-line; }
.copy-input { font-size: 0.82rem; }
.install-hint summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.notes-empty { text-align: center; padding: 2rem 1rem; }
.formatted-text strong { font-weight: 700; color: var(--text-strong); }
