:root {
  --ink: #14201c;
  --ink-soft: #4d5c57;
  --paper: #e6ece9;
  --panel: #ffffff;
  --line: rgba(20, 32, 28, 0.11);
  --accent: #0d7a62;
  --accent-deep: #085544;
  --accent-soft: rgba(13, 122, 98, 0.12);
  --accent-mid: #1a9b7e;
  --sky: #1f6f8b;
  --sky-soft: rgba(31, 111, 139, 0.12);
  --amber: #c47a12;
  --amber-soft: rgba(196, 122, 18, 0.14);
  --prio-low: #ca8a04;
  --prio-normal: #ea580c;
  --prio-high: #dc2626;
  --high: #dc2626;
  --low: #ca8a04;
  --waiting: #a16207;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(20, 32, 28, 0.05);
  --shadow-lift: 0 10px 28px rgba(20, 32, 28, 0.08);
  --radius: 14px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "IBM Plex Serif", "IBM Plex Sans", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(26, 155, 126, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 8%, rgba(31, 111, 139, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 95%, rgba(196, 122, 18, 0.1), transparent 45%),
    linear-gradient(165deg, #dce8e3 0%, #e8eeeb 42%, #eef2f0 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 32, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 28, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}

.is-hidden {
  display: none !important;
}

.brand-mark {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--accent-deep);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead {
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
  max-width: 34ch;
  font-size: 0.98rem;
  line-height: 1.5;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.75rem 1.25rem;
}

.login-stage {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  animation: login-rise 0.55s ease both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  text-align: left;
}

.brand-mark-hero {
  font-size: clamp(2rem, 6vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 0.85rem;
  background: linear-gradient(120deg, var(--accent-deep) 0%, var(--accent-mid) 55%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-brand h1 {
  font-family: var(--font);
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 18ch;
}

.login-form {
  padding: 1.25rem 1.3rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lift);
}

.login-form label {
  margin-top: 0;
}

.login-form input[type="password"] {
  font-size: 1rem;
  letter-spacing: 0.08em;
  background: #fff;
  border-color: rgba(13, 122, 98, 0.22);
}

.btn-login {
  width: 100%;
  margin-top: 1.15rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
  letter-spacing: 0.01em;
}

label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 122, 102, 0.35);
  border-color: var(--accent);
}

.form-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger {
  background: transparent;
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--danger);
}

.btn-icon {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  font-size: 1.25rem;
}

.app-view,
.app-shell {
  animation: login-rise 0.4s ease both;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0.85rem 1rem;
  border-right: 1px solid rgba(20, 32, 28, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(240, 246, 243, 0.92));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  z-index: 20;
}

.sidebar-brand {
  margin: 0 0.35rem 1rem;
  font-size: 1.05rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-link:hover {
  background: rgba(13, 122, 98, 0.08);
  color: var(--ink);
}

.sidebar-link.is-active {
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
}

.sidebar-link-icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.85rem;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-profile {
  width: 100%;
  margin-bottom: 0.25rem;
}

.sidebar-profile select {
  flex: 1;
  max-width: none;
}

.sidebar-action {
  width: 100%;
  justify-content: center;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.main-topbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.main-topbar h1 {
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink-soft);
}

.main-topbar-spacer {
  flex: 1;
}

.main-menu-btn {
  display: none;
}

body.view-chat .main-topbar {
  display: none;
}

.app-main > .tab-panel:not(.chat-home) {
  flex: 1;
  padding: 0.9rem 1.1rem 1.5rem;
  width: min(1280px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
}

.chat-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.chat-welcome {
  position: absolute;
  inset: 0 0 7.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
  animation: login-rise 0.45s ease both;
}

.chat-welcome-brand {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.chat-welcome-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
}

.chat-welcome-lead {
  margin: 0;
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem 1.1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: transparent;
}

.chat-composer-dock {
  padding: 0.65rem 1rem 1.15rem;
  background: linear-gradient(180deg, transparent, rgba(232, 238, 235, 0.92) 28%);
}

.chat-status-line {
  text-align: center;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
}

.chat-composer {
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lift);
  padding: 0.45rem 0.5rem 0.45rem 0.55rem;
  align-items: flex-end;
}

body.view-chat .atmosphere {
  opacity: 1;
}

.ai-chat-error {
  text-align: center;
}

.chat-composer textarea {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  min-height: 2.6rem;
  max-height: 9rem;
  padding: 0.55rem 0.35rem;
  font-size: 0.98rem;
}

.chat-composer textarea:focus {
  outline: none !important;
}

.sidebar-backdrop {
  display: none;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.85rem;
  padding: 0.25rem;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab.is-active {
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.85rem;
}

.panel-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-wrap {
  display: block;
  margin: 0;
}

.search-wrap input {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.is-dragging {
  cursor: grabbing;
  opacity: 0.65;
}

/* Drop-Ziele unter Events freigeben; Quelle nicht anfassen */
body.is-cal-dragging .week-event:not(.is-dragging) {
  pointer-events: none;
}

.rail-tile,
.week-event {
  -webkit-user-drag: element;
  user-select: none;
}


.due-badge {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
}

.due-badge.due-overdue {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.due-badge.due-today {
  background: rgba(180, 83, 9, 0.14);
  color: #9a3412;
}

.due-badge.due-soon {
  background: rgba(15, 122, 102, 0.12);
  color: var(--accent-deep);
}

.task-tile.due-overdue {
  border-left-color: var(--danger);
}

.task-tile.due-today {
  border-left-color: #c2410c;
}

.quick-update {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.quick-update input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  background: #fff;
}

.dot.overdue { background: var(--danger); }


.task-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.btn-schedule {
  border: 1px solid rgba(15, 122, 102, 0.3);
  background: rgba(15, 122, 102, 0.08);
  color: var(--accent-deep);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-schedule:hover {
  background: rgba(15, 122, 102, 0.14);
}

.schedule-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-deep);
  background: rgba(15, 122, 102, 0.1);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
}

.schedule-box {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px dashed rgba(15, 122, 102, 0.35);
  border-radius: 14px;
  background: rgba(15, 122, 102, 0.05);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 700;
  cursor: pointer;
}

.check-row input {
  width: auto;
  accent-color: var(--accent);
}

.schedule-fields {
  margin-top: 0.75rem;
}

.task-timestamps {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: rgba(19, 35, 31, 0.05);
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

.task-timestamps strong {
  color: var(--ink);
  font-weight: 700;
}

.updates-section {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.updates-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.last-update-preview {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  background: rgba(15, 122, 102, 0.08);
  font-size: 0.9rem;
}

.last-update-preview .when {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.update-compose {
  margin-bottom: 0.9rem;
}

.update-compose .btn {
  margin-top: 0.55rem;
}

.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow: auto;
}

.update-item {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.update-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.update-item .when {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.update-item .body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-meta-line {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.task-meta-line.latest {
  color: var(--accent-deep);
  font-weight: 600;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.topbar h1 {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.profile-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.2rem 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.profile-switch select {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.35rem 0.15rem;
  max-width: 9.5rem;
  cursor: pointer;
}

.profile-switch .btn-icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
  max-height: 40vh;
  overflow: auto;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.profile-row.is-active {
  border-color: rgba(15, 122, 102, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 122, 102, 0.18);
}

.profile-row-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  padding: 0.25rem 0;
}

.profile-row input[type="color"] {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.profile-row-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.profile-new {
  margin-top: 0.35rem;
}

.profile-new-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}

.profile-new-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.profile-new-row input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

#btn-briefing.is-ai-off,
.ai-fab.is-ai-off {
  opacity: 0.55;
}

.ai-dialog {
  width: min(520px, calc(100% - 1.5rem));
}

.ai-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem 0.75rem 0.85rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 122, 102, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.ai-fab:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.ai-fab.is-open {
  background: var(--accent-deep);
}

.ai-fab-icon {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
}

.ai-assistant-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.ai-chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-bubble {
  max-width: min(92%, 640px);
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: ai-pop 0.18s ease;
  align-self: stretch;
  width: fit-content;
}

.ai-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-bubble-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  color: var(--ink);
}

.ai-bubble-user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border-bottom-right-radius: 6px;
}

@keyframes ai-pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ai-typing {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
}

.ai-typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: ai-dot 1s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.ai-chat-questions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-chat-q p {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.86rem;
}

.ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ai-chat-chip {
  appearance: none;
  border: 1px solid rgba(15, 122, 102, 0.35);
  background: rgba(15, 122, 102, 0.08);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.ai-chat-chip:hover:not(:disabled) {
  background: rgba(15, 122, 102, 0.16);
}

.ai-chat-chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ai-chat-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.ai-chat-drafts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.ai-chat-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  margin-top: 0.15rem;
}

.ai-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ai-chat-composer textarea {
  flex: 1;
  min-height: 2.4rem;
  max-height: 7.5rem;
  resize: none;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  line-height: 1.35;
}

.ai-chat-composer.is-listening textarea {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.04);
}

.ai-chat-composer.is-listening textarea::placeholder {
  color: #9a3412;
}

.ai-chat-voice,
.ai-chat-send {
  appearance: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}

.ai-chat-voice {
  background: rgba(13, 122, 98, 0.1);
  color: var(--accent-deep);
  font-size: 1rem;
  border: 1px solid rgba(13, 122, 98, 0.2);
}

.ai-chat-voice:hover {
  background: rgba(13, 122, 98, 0.18);
}

.ai-chat-voice.is-listening {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  animation: ai-voice-pulse 1.1s ease-in-out infinite;
}

.ai-chat-voice.is-unsupported,
.ai-chat-voice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
}

.ai-voice-icon {
  display: block;
}

@keyframes ai-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.ai-chat-send {
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.ai-chat-send:hover {
  background: var(--accent-deep);
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-chat-error {
  margin: 0;
  padding: 0 0.75rem 0.45rem;
  background: #fff;
  font-size: 0.8rem;
}

body.ai-assistant-open .undo-toast {
  bottom: 5.5rem;
}

@media (max-width: 520px) {
  .ai-fab-label {
    display: none;
  }
  .ai-fab {
    padding: 0.85rem;
    border-radius: 50%;
  }
  .ai-assistant-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 4.2rem;
    height: min(75vh, 580px);
  }
}

.ai-out {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7f9f8;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
}

.ai-reasoning {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.ai-clarify {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-clarify-head {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink);
}

.ai-question {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(180, 83, 9, 0.25);
  background: rgba(245, 158, 11, 0.1);
}

.ai-question label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.ai-question-custom {
  margin-top: 0.15rem;
}

.ai-draft-list {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-draft-card {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 122, 102, 0.25);
  background: rgba(15, 122, 102, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.ai-draft-card.action-unsure {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.ai-draft-card.action-create {
  border-color: rgba(15, 122, 102, 0.4);
}

.ai-draft-top {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.ai-draft-top strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.ai-contact-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.ai-contact-badge.existing {
  background: rgba(15, 122, 102, 0.14);
  color: var(--accent-deep);
}
.ai-contact-badge.create {
  background: rgba(15, 122, 102, 0.22);
  color: var(--accent-deep);
}
.ai-contact-badge.unsure {
  background: rgba(180, 83, 9, 0.16);
  color: #9a3412;
}

.ai-draft-meta {
  margin: 0;
  font-size: 0.8rem;
}

.ai-draft-contact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ai-draft-notes {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.82rem;
}

.contact-suggest-wrap {
  position: relative;
}

.contact-suggest {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.25rem;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 31, 30, 0.12);
}

.contact-suggest-item {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.contact-suggest-item:hover,
.contact-suggest-item:focus {
  background: rgba(15, 122, 102, 0.08);
}

.contact-suggest-item strong {
  font-weight: 650;
  font-size: 0.92rem;
}

.contact-suggest-item span {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.contact-suggest-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1rem;
}

.calendar-panel,
.side-panel,
.week-panel,
.week-rail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.85rem;
}

.week-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 0.85rem;
  align-items: stretch;
}

.week-panel {
  display: flex;
  flex-direction: column;
  min-height: 68vh;
  padding: 0.75rem;
}

.week-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.week-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.calendar-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.cal-view-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.cal-view-toggle .chip {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.cal-view-toggle .chip.is-active {
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
}

.calendar-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.week-scroll.is-day-view .week-head,
.week-scroll.is-day-view .week-allday,
.week-scroll.is-day-view .week-grid {
  min-width: 0;
}

.month-grid {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
  position: sticky;
  top: 0;
  z-index: 2;
}

.month-weekdays > div {
  padding: 0.45rem 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(88px, 1fr);
  flex: 1;
}

.month-day {
  position: relative;
  min-height: 88px;
  padding: 0.3rem 0.3rem 0.35rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background 0.12s ease;
}

.month-day:hover {
  background: rgba(13, 122, 98, 0.04);
}

.month-day.is-outside {
  background: #f4f6f5;
  color: var(--ink-soft);
}

.month-day.is-outside .month-day-num {
  opacity: 0.45;
}

.month-day.is-today {
  background: rgba(13, 122, 98, 0.06);
}

.month-day.is-selected {
  box-shadow: inset 0 0 0 2px rgba(13, 122, 98, 0.35);
}

.month-day.is-drop-target {
  background: rgba(13, 122, 98, 0.14) !important;
  box-shadow: inset 0 0 0 2px rgba(13, 122, 98, 0.4);
}

.month-day-num {
  appearance: none;
  border: 0;
  background: transparent;
  align-self: flex-end;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.month-day.is-today .month-day-num {
  background: var(--accent);
  color: #fff;
}

.month-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-height: 0;
  overflow: hidden;
}

.month-event {
  appearance: none;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  background: rgba(13, 122, 98, 0.12);
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  padding: 0.12rem 0.25rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.month-event.status-waiting {
  border-left-color: #b45309;
  background: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

.month-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 650;
  text-align: left;
  padding: 0.05rem 0.15rem;
  cursor: pointer;
}

.month-more:hover {
  color: var(--accent-deep);
}

.week-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfa;
}

.week-head,
.week-allday,
.week-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
}

.week-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.week-gutter {
  border-right: 1px solid var(--line);
  background: #fff;
}

.week-day-head {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 0.45rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
}

.week-day-head span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.week-day-head strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.week-day-head.is-today strong {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.week-day-head.is-selected {
  background: rgba(15, 122, 102, 0.06);
}

.week-allday {
  min-height: 2.4rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.week-allday-label {
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.week-allday-cell {
  min-height: 2.4rem;
  padding: 0.2rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.week-allday-cell.is-today,
.week-slot.is-today {
  background: rgba(15, 122, 102, 0.03);
}

.week-grid {
  grid-auto-rows: 32px;
}

.week-time {
  border-right: 1px solid var(--line);
  border-top: 1px solid transparent;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: right;
  padding: 0 0.35rem 0 0;
  transform: translateY(-0.45rem);
  background: #fff;
}

.week-slot {
  position: relative;
  border-right: 1px solid var(--line);
  border-top: 1px solid rgba(26, 31, 30, 0.06);
  padding: 1px 2px;
  min-height: 32px;
}

.week-slot.is-hour {
  border-top-color: rgba(26, 31, 30, 0.14);
}

.week-slot.is-selected-day {
  background: rgba(15, 122, 102, 0.035);
}

.week-slot.is-drop-target,
.week-allday-cell.is-drop-target {
  background: rgba(15, 122, 102, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(15, 122, 102, 0.35);
}

.week-event {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  padding: 0.12rem 0.28rem;
  margin: 0 0 1px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  cursor: grab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Aktiv = teal, Warten = amber — klar getrennt */
.week-event.status-open {
  border-left-color: var(--accent);
  background: rgba(15, 122, 102, 0.18);
  color: var(--accent-deep);
}

.week-event.status-waiting {
  border-left-color: #b45309;
  background: rgba(245, 158, 11, 0.28);
  color: #92400e;
}

.week-event.due-overdue {
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.25);
}

.week-rail {
  display: flex;
  flex-direction: column;
  max-height: 78vh;
  overflow: hidden;
}

.task-rail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.15rem;
}

.rail-tile {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #f7f8f7;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rail-tile.prio-low { border-left-color: var(--prio-low); background: rgba(202, 138, 4, 0.08); }
.rail-tile.prio-normal { border-left-color: var(--prio-normal); background: rgba(234, 88, 12, 0.07); }
.rail-tile.prio-high { border-left-color: var(--prio-high); background: rgba(220, 38, 38, 0.07); }
.rail-tile.status-waiting { border-left-color: var(--waiting); }

.rail-tile-title {
  margin: 0;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  text-align: left;
  color: var(--ink);
  line-height: 1.25;
  pointer-events: none;
}

.rail-tile-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.rail-tile-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-deep);
  opacity: 0.85;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.dot.high { background: var(--prio-high); }
.dot.normal { background: var(--prio-normal); }
.dot.low { background: var(--prio-low); }
.dot.waiting { background: var(--waiting); }
.dot.done { opacity: 0.35; }

.contacts-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-admin-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.contact-admin-info {
  flex: 1;
  min-width: 0;
}

.contact-admin-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-admin-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.contact-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.task-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}

.task-scan-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.scan-section {
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: #f4f6f5;
  border-top: 1px solid var(--line);
}

.scan-section:first-child {
  border-top: 0;
}

.scan-section.status-waiting {
  color: #9a3412;
  background: rgba(245, 158, 11, 0.12);
}

.scan-section.status-open {
  color: var(--accent-deep);
  background: rgba(15, 122, 102, 0.06);
}

.scan-row {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) 6.5rem 4.2rem auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.42rem 0.65rem;
  border-top: 1px solid rgba(26, 31, 30, 0.06);
  border-left: 3px solid var(--accent);
  background: #fff;
  min-height: 2.4rem;
}

.scan-row.status-waiting {
  border-left-color: #b45309;
  background: rgba(245, 158, 11, 0.05);
}

.scan-row.status-done,
.scan-row.is-done {
  border-left-color: var(--line);
  opacity: 0.72;
}

.scan-row.due-overdue {
  background: rgba(220, 38, 38, 0.04);
}

.scan-check {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--accent);
}

.scan-main {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.scan-title {
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-when {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.scan-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  padding: 0.12rem 0.3rem;
  border-radius: 6px;
}

.scan-status.status-open {
  background: rgba(15, 122, 102, 0.12);
  color: var(--accent-deep);
}
.scan-status.status-waiting {
  background: rgba(180, 83, 9, 0.14);
  color: #9a3412;
}
.scan-status.status-done {
  background: rgba(26, 31, 30, 0.08);
  color: var(--ink-soft);
}

.task-row-actions {
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.scan-row:hover .task-row-actions,
.scan-row:focus-within .task-row-actions,
.contact-task:hover .task-row-actions,
.contact-task:focus-within .task-row-actions {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 720px) {
  .scan-row {
    grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  }
  .scan-when,
  .scan-status {
    display: none;
  }
  .task-row-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.contact-tree {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.contact-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.contact-group.is-drop-target {
  border-color: var(--accent);
  background: rgba(15, 122, 102, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 122, 102, 0.25);
}

.contact-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.35rem 0.25rem;
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
}

.contact-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.contact-chevron {
  width: 1rem;
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.contact-name {
  flex: 1;
  min-width: 0;
}

.contact-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(26, 31, 30, 0.06);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.fold-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.contact-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.35rem;
}

.contact-badge {
  min-width: 1.35rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  line-height: 1.2;
}

.contact-badge.badge-open {
  background: #dcfce7;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.25);
}

.contact-badge.badge-waiting {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.contact-badge.badge-muted {
  background: rgba(26, 31, 30, 0.06);
  color: var(--ink-soft);
}

.contact-tasks {
  display: flex;
  flex-direction: column;
}

.contact-tasks-empty {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.contact-task {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  border-top: 1px solid rgba(26, 31, 30, 0.08);
  border-left: 3px solid var(--prio-normal);
  background: #fff7ed;
}

.contact-task.prio-low {
  border-left-color: var(--prio-low);
  background: #fef9c3;
}

.contact-task.prio-normal {
  border-left-color: var(--prio-normal);
  background: #ffedd5;
}

.contact-task.prio-high {
  border-left-color: var(--prio-high);
  background: #fee2e2;
}

.contact-task.status-waiting {
  background: #dbeafe !important;
  border-left-color: #2563eb !important;
}

.contact-task.status-waiting .contact-task-title {
  color: #1e3a8a;
}

.contact-task.status-waiting .contact-task-meta {
  color: #1d4ed8;
}

.contact-task-grip {
  flex-shrink: 0;
  width: 1.4rem;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: -0.08em;
  cursor: grab;
  user-select: none;
  padding-left: 0.35rem;
}

.contact-task.is-dragging {
  opacity: 0.55;
}

.contact-task:first-child {
  border-top: 0;
}

.contact-task-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.45rem 0.55rem 0.2rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.contact-task-side {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.55rem;
  flex-shrink: 0;
}

.btn-wait {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #2563eb;
  color: #fff;
}

.btn-wait:hover {
  background: #1d4ed8;
}

.btn-wait-off {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #eff6ff;
  color: #1d4ed8;
}

.btn-wait-off:hover {
  background: #dbeafe;
}

.contact-task-main:hover {
  background: rgba(255, 255, 255, 0.35);
}

.contact-task.is-done {
  opacity: 0.72;
}

.contact-task.is-done .contact-task-title {
  text-decoration: line-through;
  color: #4b5563;
}

.contact-task-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
}

.contact-task-meta {
  font-size: 0.78rem;
  color: #374151;
  line-height: 1.35;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.task-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  border-left: 3px solid var(--accent);
}

.task-tile:hover,
.task-tile:focus-visible {
  outline: none;
  border-color: rgba(15, 122, 102, 0.35);
}

.task-tile.prio-high { border-left-color: var(--prio-high); }
.task-tile.prio-normal { border-left-color: var(--prio-normal); }
.task-tile.prio-low { border-left-color: var(--prio-low); }

.task-tile.status-waiting {
  background: #fffbeb;
}

.task-tile.status-done {
  opacity: 0.65;
}

.task-tile.status-done .tile-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.tile-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
}

.tile-head .prio {
  margin-left: auto;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  background: rgba(15, 122, 102, 0.1);
  color: var(--accent-deep);
}

.status-pill.status-waiting {
  background: rgba(161, 98, 7, 0.14);
  color: #854d0e;
}

.status-pill.status-done {
  background: rgba(107, 114, 128, 0.14);
  color: #6b7280;
}

.tile-title {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.tile-meta,
.tile-times {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.tile-update {
  margin: 0.15rem 0 0;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: #f3f6f5;
  border-left: 2px solid var(--accent);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--ink);
}

.tile-update .when {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding-top: 0.4rem;
}

.btn-tiny {
  padding: 0.28rem 0.5rem;
  font-size: 0.75rem;
}

.side-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.side-head h2 {
  font-size: 1.25rem;
}

.filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 560;
  cursor: pointer;
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.task-item.is-done .task-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.task-check {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.task-title {
  margin: 0;
  font-weight: 700;
}

.task-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.prio {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: rgba(15, 122, 102, 0.1);
  color: var(--accent-deep);
}

.prio.high {
  background: rgba(220, 38, 38, 0.14);
  color: var(--prio-high);
}

.prio.normal {
  background: rgba(234, 88, 12, 0.14);
  color: var(--prio-normal);
}

.prio.low {
  background: rgba(202, 138, 4, 0.16);
  color: #a16207;
}

.empty-state {
  color: var(--ink-soft);
  margin: 1.5rem 0 0;
}

.task-dialog {
  width: min(480px, calc(100% - 1.5rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #fff;
  box-shadow: 0 8px 30px rgba(26, 31, 30, 0.12);
}

.task-dialog::backdrop {
  background: rgba(19, 35, 31, 0.35);
  backdrop-filter: blur(3px);
}

.task-dialog form {
  padding: 1.1rem 1.2rem 1.2rem;
}

.task-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.1rem;
}

.dialog-actions-right {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* —— Dashboard —— */
.dash {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(13, 122, 98, 0.14) 0%, rgba(31, 111, 139, 0.1) 48%, rgba(255, 255, 255, 0.55) 100%),
    rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: dash-in 0.45s ease both;
}

.dash-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-mid), var(--sky));
}

.dash-hero-copy {
  min-width: 0;
  padding-left: 0.35rem;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.dash-date {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.dash-greeting {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.dash-next {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.45;
}

.dash-next-label {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  vertical-align: 0.05em;
}

.dash-next strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  animation: dash-in 0.5s ease 0.05s both;
}

@keyframes dash-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.dash-agenda-panel {
  min-height: auto;
  animation: dash-in 0.5s ease 0.1s both;
}

.dash-agenda {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.dash-agenda::before {
  content: "";
  position: absolute;
  left: 1.55rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(13, 122, 98, 0.35), rgba(31, 111, 139, 0.12));
  border-radius: 2px;
  pointer-events: none;
}

.agenda-item {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  position: relative;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.agenda-item:hover {
  border-color: rgba(13, 122, 98, 0.28);
  background: #fff;
}

.agenda-item.status-waiting,
.agenda-item.kind-followup,
.agenda-item.kind-followup-overdue {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(180, 83, 9, 0.22);
}

.agenda-item.kind-overdue,
.agenda-item.kind-followup-overdue {
  box-shadow: inset 3px 0 0 var(--prio-high);
}

.agenda-item.status-open.kind-due {
  background: rgba(15, 122, 102, 0.08);
  border-color: rgba(15, 122, 102, 0.2);
}

.agenda-time {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.agenda-body {
  min-width: 0;
}

.agenda-title {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.agenda-title:hover {
  color: var(--accent-deep);
}

.agenda-meta {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.agenda-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}

.agenda-badge.kind-due {
  background: rgba(15, 122, 102, 0.14);
  color: var(--accent-deep);
}
.agenda-badge.kind-followup,
.agenda-badge.kind-followup-overdue {
  background: rgba(180, 83, 9, 0.16);
  color: #9a3412;
}
.agenda-badge.kind-overdue {
  background: rgba(220, 38, 38, 0.12);
  color: var(--prio-high);
}

.agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1a1f1e;
  color: #f5f6f5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 0.88rem;
  font-weight: 500;
}

.undo-toast .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.dash-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}
.dash-status.open {
  background: rgba(15, 122, 102, 0.12);
  color: var(--accent-deep);
}
.dash-status.waiting {
  background: rgba(180, 83, 9, 0.14);
  color: #9a3412;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dash-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.dash-stat strong {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.dash-stat span {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.dash-stat.tone-now {
  background: linear-gradient(160deg, rgba(13, 122, 98, 0.12), rgba(255, 255, 255, 0.85));
  border-color: rgba(13, 122, 98, 0.14);
}
.dash-stat.tone-now::before { background: var(--accent-mid); }
.dash-stat.tone-now strong { color: var(--accent-deep); }

.dash-stat.tone-wait {
  background: linear-gradient(160deg, var(--amber-soft), rgba(255, 255, 255, 0.85));
  border-color: rgba(196, 122, 18, 0.18);
}
.dash-stat.tone-wait::before { background: var(--amber); }
.dash-stat.tone-wait strong { color: #8a4f0a; }

.dash-stat.tone-due {
  background: linear-gradient(160deg, var(--sky-soft), rgba(255, 255, 255, 0.85));
  border-color: rgba(31, 111, 139, 0.16);
}
.dash-stat.tone-due::before { background: var(--sky); }
.dash-stat.tone-due strong { color: #0f4c81; }

.dash-stat.tone-alert {
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(160deg, rgba(220, 38, 38, 0.1), rgba(255, 255, 255, 0.88));
}
.dash-stat.tone-alert::before { background: var(--prio-high); }
.dash-stat.tone-alert strong { color: var(--prio-high); }

.dash-stat.tone-soft {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}
.dash-stat.tone-soft::before { background: #8a9a94; }
.dash-stat.tone-soft strong { color: var(--ink-soft); }

.dash-hint {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(196, 122, 18, 0.28);
  background: linear-gradient(90deg, rgba(196, 122, 18, 0.14), rgba(255, 255, 255, 0.65));
  color: #7a4508;
  font-size: 0.86rem;
  font-weight: 560;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  animation: dash-in 0.55s ease 0.14s both;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  min-height: 12rem;
  backdrop-filter: blur(6px);
}

.dash-panel-now {
  background:
    linear-gradient(180deg, rgba(13, 122, 98, 0.06), transparent 28%),
    rgba(255, 255, 255, 0.78);
}

.dash-panel-wait {
  background:
    linear-gradient(180deg, rgba(196, 122, 18, 0.07), transparent 28%),
    rgba(255, 255, 255, 0.78);
}

.dash-agenda-panel {
  background:
    linear-gradient(180deg, rgba(31, 111, 139, 0.07), transparent 22%),
    rgba(255, 255, 255, 0.8);
}

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

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dash-panel-head h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.dash-panel-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.dash-panel-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  background: var(--sky-soft);
  color: var(--sky);
}

.dash-panel-tag.tone-now {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.dash-panel-tag.tone-wait {
  background: var(--amber-soft);
  color: #8a4f0a;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-empty {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.dash-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(13, 122, 98, 0.14);
  border-left: 3px solid var(--accent-mid);
  background: rgba(13, 122, 98, 0.06);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.dash-item:hover {
  background: rgba(13, 122, 98, 0.1);
  transform: translateX(2px);
}

.dash-item.status-waiting {
  border-left-color: var(--amber);
  border-color: rgba(196, 122, 18, 0.18);
  background: var(--amber-soft);
}
.dash-item.is-alert {
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.18);
}

.dash-item-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-item-title {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.3;
}

.dash-item-title:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dash-item-meta {
  grid-column: 1;
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.dash-item-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .week-layout {
    grid-template-columns: 1fr;
  }

  .week-rail {
    max-height: none;
  }

  .week-panel {
    min-height: 60vh;
  }

  .dash-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-agenda::before {
    display: none;
  }

  .agenda-item {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .agenda-badge,
  .agenda-actions {
    grid-column: 2;
  }
}

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

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

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lift);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop:not(.is-hidden) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(20, 32, 28, 0.35);
  }

  .main-menu-btn {
    display: inline-grid;
  }

  body.view-chat .main-topbar {
    display: flex;
    border-bottom: 0;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
  }

  body.view-chat .main-topbar h1 {
    display: none;
  }

  .chat-welcome {
    inset: 3.2rem 0 7.5rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .week-head,
  .week-allday,
  .week-grid {
    grid-template-columns: 36px repeat(7, minmax(64px, 1fr));
    min-width: 540px;
  }

  .week-toolbar {
    flex-direction: column;
  }

  .calendar-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .month-days {
    grid-auto-rows: minmax(72px, auto);
  }

  .month-day {
    min-height: 72px;
  }
}
