/* NOC CSS – iPhone-/iPad-Fix – Werkzeugfach jederzeit bedienbar – 2026-08-02 */
:root {
  --bg: #f2efe8;
  --bg-accent: #e4eee8;
  --surface: #fffefa;
  --surface-2: #f7f5ef;
  --surface-3: #ebe8df;
  --text: #1d2421;
  --muted: #68716d;
  --muted-strong: #4f5954;
  --line: #d9d6cd;
  --line-strong: #bebbb2;
  --accent: #1f5b4b;
  --accent-strong: #174437;
  --accent-soft: #dcebe4;
  --signal: #d8753c;
  --signal-soft: #f6e3d7;
  --success: #27705a;
  --success-soft: #dcece5;
  --danger: #a8463f;
  --danger-soft: #f4dfdc;
  --warning: #a46928;
  --feature-panel: #f2cb83;
  --feature-panel-border: #d8ad5c;
  --feature-panel-text: #332817;
  --feature-field: #fffefa;
  --feature-muted: #6d5834;
  --shadow-lg: 0 28px 70px rgba(42, 47, 44, .13);
  --shadow-md: 0 16px 34px rgba(42, 47, 44, .09);
  --shadow-sm: 0 8px 20px rgba(42, 47, 44, .07);
  --focus: 0 0 0 4px rgba(31, 91, 75, .16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --drawer-peek: 72px;
  --content-width: 1180px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #151917;
  --bg-accent: #1c2d27;
  --surface: #202522;
  --surface-2: #272d2a;
  --surface-3: #313834;
  --text: #f4f2ec;
  --muted: #a7b0ab;
  --muted-strong: #c0c7c3;
  --line: #3a423e;
  --line-strong: #56605b;
  --accent: #70c8a8;
  --accent-strong: #8ed9bc;
  --accent-soft: #263e34;
  --signal: #f0a16d;
  --signal-soft: #4c3326;
  --success: #78d0ae;
  --success-soft: #294136;
  --danger: #ff9b93;
  --danger-soft: #4b2d2b;
  --warning: #e3b167;
  --feature-panel: #272d2a;
  --feature-panel-border: #56605b;
  --feature-panel-text: #f4f2ec;
  --feature-field: #202522;
  --feature-muted: #a7b0ab;
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .38);
  --shadow-md: 0 16px 34px rgba(0, 0, 0, .28);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, .22);
  --focus: 0 0 0 4px rgba(112, 200, 168, .18);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #151917;
    --bg-accent: #1c2d27;
    --surface: #202522;
    --surface-2: #272d2a;
    --surface-3: #313834;
    --text: #f4f2ec;
    --muted: #a7b0ab;
    --muted-strong: #c0c7c3;
    --line: #3a423e;
    --line-strong: #56605b;
    --accent: #70c8a8;
    --accent-strong: #8ed9bc;
    --accent-soft: #263e34;
    --signal: #f0a16d;
    --signal-soft: #4c3326;
    --success: #78d0ae;
    --success-soft: #294136;
    --danger: #ff9b93;
    --danger-soft: #4b2d2b;
    --warning: #e3b167;
    --feature-panel: #272d2a;
    --feature-panel-border: #56605b;
    --feature-panel-text: #f4f2ec;
    --feature-field: #202522;
    --feature-muted: #a7b0ab;
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .38);
    --shadow-md: 0 16px 34px rgba(0, 0, 0, .28);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, .22);
    --focus: 0 0 0 4px rgba(112, 200, 168, .18);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 14px calc(var(--drawer-peek) + 24px + env(safe-area-inset-bottom));
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, var(--bg-accent), transparent 32rem),
    radial-gradient(circle at 100% 100%, rgba(216, 117, 60, .09), transparent 27rem),
    var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

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

button,
select,
input[type="date"],
input[type="checkbox"] {
  cursor: pointer;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  color: #fff;
  background: var(--accent);
}

[hidden] {
  display: none !important;
}

.sr-only {
  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: 10000;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: .7rem 1rem;
  border-radius: 10px;
  color: #fff;
  background: var(--accent-strong);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-lg);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 22px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 22px rgba(31, 91, 75, .22);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: -.06em;
}

.brand-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1.25rem;
  letter-spacing: -.04em;
}

.brand-copy small {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .76rem;
  overflow-wrap: anywhere;
}

.topbar-status {
  min-width: 0;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .76rem;
  white-space: nowrap;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 14%, transparent);
}

.save-state.is-saving .save-dot {
  background: var(--warning);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 14%, transparent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.header-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted-strong);
  background: var(--surface-2);
  transition: transform .18s var(--ease), border-color .18s ease, background .18s ease, color .18s ease;
}

.header-button {
  padding: .65rem .85rem;
  font-size: .8rem;
  font-weight: 800;
}

.icon-button:hover,
.header-button:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

.icon-button:active,
.header-button:active {
  transform: translateY(0) scale(.97);
}

main {
  padding: clamp(18px, 3vw, 34px);
}

.capture-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(380px, 1.35fr);
  grid-template-areas:
    "copy form"
    "stats stats";
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 62%, var(--surface)), var(--surface) 68%);
  box-shadow: var(--shadow-md);
}

.capture-copy {
  grid-area: copy;
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1.35;
  text-transform: uppercase;
}

.capture-copy h1 {
  max-width: 13ch;
  margin: .7rem 0 0;
  font-size: clamp(2rem, 4.8vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.065em;
  overflow-wrap: normal;
}

.capture-lead {
  max-width: 48ch;
  margin: 1rem 0 0;
  color: var(--muted-strong);
  font-size: clamp(.96rem, 1.4vw, 1.08rem);
  line-height: 1.65;
}

.capture-form {
  grid-area: form;
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--feature-panel-border);
  border-radius: var(--radius-lg);
  color: var(--feature-panel-text);
  background: var(--feature-panel);
  box-shadow: var(--shadow-sm);
}

.capture-form > label {
  display: block;
  margin-bottom: .7rem;
  font-size: .83rem;
  font-weight: 850;
}

.capture-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.capture-row input,
.field input,
.field textarea,
.field select,
.inline-form input,
.compact-field select,
.compact-field input,
.search-box input,
.list-controls select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.capture-row input {
  min-height: 58px;
  padding: 0 17px;
  font-size: 1rem;
}

.capture-row input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.inline-form input:focus,
.compact-field select:focus,
.compact-field input:focus,
.search-box:focus-within,
.list-controls select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--focus);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 13px;
  padding: .68rem .95rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  transition: transform .18s var(--ease), box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(31, 91, 75, .2);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 91, 75, .25);
}

.primary-button:active {
  transform: scale(.98);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface);
}

.secondary-button.compact {
  min-height: 40px;
  padding: .55rem .75rem;
  font-size: .82rem;
}

.danger-button {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
  background: var(--danger-soft);
}

.danger-button:hover {
  transform: translateY(-1px);
  border-color: var(--danger);
}

.text-button {
  min-height: 38px;
  border: 0;
  padding: .45rem .7rem;
  color: var(--accent);
  background: transparent;
  font-size: .78rem;
}

.text-button:hover {
  background: var(--accent-soft);
}

.danger-text {
  color: var(--danger);
}

.capture-form .capture-row input,
.capture-form .compact-field select,
.capture-form .compact-field input,
.capture-form .quick-toggle {
  border-color: color-mix(in srgb, var(--feature-panel-border) 72%, var(--line));
  background: var(--feature-field);
}

.capture-form .compact-field > span,
.capture-form .composer-meta {
  color: var(--feature-muted);
}

.quick-options {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.compact-field {
  min-width: 0;
  display: grid;
  gap: .35rem;
}

.compact-field > span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.compact-field select,
.compact-field input {
  min-height: 42px;
  padding: .55rem .7rem;
}

.quick-toggle {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted-strong);
  background: var(--surface-2);
  font-size: .8rem;
  font-weight: 800;
}

.quick-toggle input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.quick-toggle:focus-within {
  box-shadow: var(--focus);
}

.quick-toggle:has(input:checked) {
  color: var(--signal);
  border-color: color-mix(in srgb, var(--signal) 40%, var(--line));
  background: var(--signal-soft);
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}

.composer-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-strip {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.status-item {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .45rem;
  min-height: 58px;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  transition: transform .18s var(--ease), border-color .18s ease, background .18s ease;
}

.status-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface);
}

/* Offene wichtige Aufgaben deutlich hervorheben */
.status-item.has-important {
  color: #ffffff;
  border-color: #9f1717;
  background: linear-gradient(145deg, #e53935, #b71c1c);
  box-shadow:
    0 10px 24px rgba(183, 28, 28, .30),
    inset 0 1px 0 rgba(255, 255, 255, .20);
}

.status-item.has-important strong {
  color: #ffffff;
}

.status-item.has-important span {
  color: rgba(255, 255, 255, .94);
  font-weight: 850;
}

.status-item.has-important:hover {
  color: #ffffff;
  border-color: #831313;
  background: linear-gradient(145deg, #ef4444, #a91515);
  box-shadow:
    0 13px 28px rgba(183, 28, 28, .38),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.status-item strong {
  flex: 0 0 auto;
  font-size: 1.25rem;
  line-height: 1;
}

.status-item span {
  min-width: 0;
  color: var(--muted);
  font-size: .72rem;
  overflow-wrap: anywhere;
}

.workspace {
  margin-top: clamp(18px, 3vw, 28px);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(14px, 2.2vw, 20px);
  border: 1px solid var(--feature-panel-border);
  border-radius: 18px;
  color: var(--feature-panel-text);
  background: var(--feature-panel);
}

.workspace-heading .section-kicker {
  color: var(--accent-strong);
}

.workspace-heading .search-box {
  border-color: color-mix(in srgb, var(--feature-panel-border) 72%, var(--line));
  background: var(--feature-field);
}

.workspace-heading > div {
  min-width: 0;
}

.workspace-heading h2 {
  margin: .4rem 0 0;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.search-box {
  flex: 0 1 320px;
  min-width: 210px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-2);
}

.search-box input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

.search-box kbd {
  flex: 0 0 auto;
  padding: .18rem .38rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: .62rem;
  font-family: inherit;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .8rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted-strong);
  background: transparent;
  font-size: .8rem;
  font-weight: 800;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.view-tab span {
  min-width: 24px;
  padding: .12rem .35rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: .66rem;
  text-align: center;
}

.view-tab:hover {
  border-color: var(--line);
  background: var(--surface-2);
}

.view-tab.is-active {
  color: #fff;
  background: var(--accent);
}

.view-tab.is-active span {
  color: var(--accent-strong);
  background: #fff;
}

.list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.list-controls > p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.list-controls select {
  min-height: 40px;
  max-width: 200px;
  padding: .5rem 2rem .5rem .7rem;
  font-size: .75rem;
}

.bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-height: 6px;
  margin: 4px 0 8px;
}

.task-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.task-shell {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(90deg, var(--success), var(--success) 50%, var(--signal) 50%, var(--signal));
}

.task-shell.is-menu-open {
  z-index: 80;
  overflow: visible;
}

.swipe-underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #fff;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  pointer-events: none;
}

.task-card {
  --swipe-x: 0px;
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  transform: translateX(var(--swipe-x));
  transition: transform .24s var(--ease), border-color .18s ease, box-shadow .18s ease, background .18s ease;
  touch-action: pan-y;
}

.task-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

/* Offene wichtige Aufgaben deutlich hervorheben */
.task-card.is-important-task {
  color: #ffffff;
  border-color: #9f1717;
  background: linear-gradient(145deg, #e53935, #b71c1c);
  box-shadow:
    0 10px 24px rgba(183, 28, 28, .30),
    inset 0 1px 0 rgba(255, 255, 255, .20);
}

.task-card.is-important-task:hover {
  color: #ffffff;
  border-color: #831313;
  background: linear-gradient(145deg, #ef4444, #a91515);
  box-shadow:
    0 13px 28px rgba(183, 28, 28, .38),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* Titel, Notiz und Mengenangabe */
.task-card.is-important-task .task-title,
.task-card.is-important-task .task-note,
.task-card.is-important-task .task-quantity {
  color: #ffffff;
}

/* Zusatzinformationen wie Liste, Datum und Wichtig */
.task-card.is-important-task .meta-pill {
  color: rgba(255, 255, 255, .96);
  background: rgba(255, 255, 255, .16);
}

.task-card.is-important-task .meta-pill.is-due,
.task-card.is-important-task .meta-pill.is-overdue,
.task-card.is-important-task .meta-pill.is-important {
  color: #ffffff;
  background: rgba(255, 255, 255, .20);
}

/* Abhakfeld */
.task-card.is-important-task .task-check {
  color: #b71c1c;
  border-color: rgba(255, 255, 255, .90);
  background: rgba(255, 255, 255, .12);
}

.task-card.is-important-task .task-check:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, .22);
}

/* Stern, Menü und weitere Aktionsschaltflächen */
.task-card.is-important-task .task-action,
.task-card.is-important-task .drag-handle {
  color: rgba(255, 255, 255, .94);
}

.task-card.is-important-task .task-action:hover,
.task-card.is-important-task .drag-handle:hover,
.task-card.is-important-task .action-menu[open] .task-action {
  color: #ffffff;
  background: rgba(255, 255, 255, .18);
}

.task-card.is-important-task .task-action.is-important {
  color: #ffffff;
  background: rgba(255, 255, 255, .20);
}

.task-card.is-dragging {
  opacity: .5;
}

.task-card.is-drop-target {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.task-card.is-completed {
  background: color-mix(in srgb, var(--surface) 82%, var(--success-soft));
}

.task-card.is-completed .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.task-check {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  color: #fff;
  background: transparent;
  transition: transform .18s var(--ease), border-color .18s ease, background .18s ease;
}

.task-check:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.task-check svg {
  width: 15px;
  opacity: 0;
}

.task-card.is-completed .task-check {
  border-color: var(--success);
  background: var(--success);
}

.task-card.is-completed .task-check svg {
  opacity: 1;
}

.task-main {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.task-quantity {
  flex: 0 0 auto;
  margin-top: .06rem;
  color: var(--accent);
  font-weight: 900;
}

.task-title {
  min-width: 0;
  margin: 0;
  font-size: .96rem;
  font-weight: 730;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-note {
  margin: .38rem 0 0;
  color: var(--muted-strong);
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: .62rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  max-width: 100%;
  padding: .24rem .48rem;
  border-radius: 999px;
  color: var(--muted-strong);
  background: var(--surface-2);
  font-size: .65rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.meta-pill.is-due {
  color: var(--warning);
  background: color-mix(in srgb, var(--signal-soft) 70%, var(--surface));
}

.meta-pill.is-overdue {
  color: var(--danger);
  background: var(--danger-soft);
}

.meta-pill.is-important {
  color: var(--signal);
  background: var(--signal-soft);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-action,
.drag-handle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  transition: transform .18s var(--ease), color .18s ease, background .18s ease;
}

.task-action:hover,
.drag-handle:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: var(--surface-2);
}

.task-action.is-important {
  color: var(--signal);
  background: var(--signal-soft);
}

.task-action.is-important svg {
  fill: currentColor;
}

.task-action.delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.drag-handle {
  cursor: grab;
}

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

.action-menu {
  position: relative;
  z-index: 90;
}

.action-menu > summary {
  list-style: none;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu[open] .task-action {
  color: var(--text);
  background: var(--surface-2);
}

.action-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  right: 0;
  min-width: 205px;
  max-width: min(280px, calc(100vw - 28px));
  max-height: min(62vh, 310px);
  display: grid;
  gap: 3px;
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.action-popover.opens-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.action-popover button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .75rem;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  font-size: .76rem;
  text-align: left;
}

.action-popover button:hover {
  background: var(--surface-2);
}

.action-popover button.is-danger {
  color: var(--danger);
}

.empty-state {
  display: grid;
  place-items: center;
  padding: clamp(34px, 6vw, 70px) 18px;
  text-align: center;
}

.empty-symbol {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 2rem;
  font-weight: 900;
}

.empty-state h3 {
  margin: 1rem 0 .35rem;
  font-size: 1.35rem;
}

.empty-state p {
  max-width: 44ch;
  margin: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 3vw, 34px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
}

.tool-drawer {
  position: fixed;
  z-index: 3000;
  isolation: isolate;
  left: 50%;
  bottom: env(safe-area-inset-bottom);
  width: min(980px, calc(100% - 20px));
  height: var(--drawer-peek);
  max-height: min(82dvh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 55px rgba(30, 35, 32, .2);
  transform: translateX(-50%);
  transition: height .42s var(--ease), box-shadow .25s ease;
  overflow: hidden;
  pointer-events: auto;
  will-change: height;
}

.tool-drawer.is-open {
  height: min(82dvh, 760px);
  box-shadow: 0 -24px 70px rgba(30, 35, 32, .28);
}

.drawer-handle {
  position: relative;
  z-index: 2;
  flex: 0 0 var(--drawer-peek);
  width: 100%;
  min-height: var(--drawer-peek);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.drawer-handle:focus-visible {
  outline: 0;
  box-shadow: inset var(--focus);
}

.drawer-grip {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--line-strong) 65%, transparent);
}

.drawer-handle-copy {
  min-width: 0;
  display: grid;
  gap: .12rem;
}

.drawer-handle-copy strong {
  font-size: .88rem;
}

.drawer-handle-copy small {
  color: var(--muted);
  font-size: .67rem;
  overflow-wrap: anywhere;
}

.drawer-handle > svg {
  transition: transform .35s var(--ease);
}

.tool-drawer.is-open .drawer-handle > svg {
  transform: rotate(180deg);
}

.drawer-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.tool-drawer.is-open .drawer-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .24s ease .08s, visibility 0s linear 0s;
}

.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.drawer-heading > div {
  min-width: 0;
}

.drawer-heading h2 {
  margin: .35rem 0 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

.drawer-heading p:last-child {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.tool-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
  transition: transform .18s var(--ease), border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tool-card:active {
  transform: scale(.98);
}

.tool-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.15rem;
  font-weight: 900;
}

.tool-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: .22rem;
}

.tool-card strong,
.tool-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tool-card strong {
  font-size: .86rem;
  line-height: 1.25;
}

.tool-card small {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.4;
}

.drawer-tip {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 13px;
  color: var(--muted-strong);
  background: var(--surface-2);
  font-size: .72rem;
  line-height: 1.5;
}

.modal {
  width: min(680px, calc(100% - 24px));
  max-height: min(88dvh, 850px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(12, 16, 14, .58);
  backdrop-filter: blur(7px);
}

.modal-card {
  padding: clamp(18px, 4vw, 30px);
}

.wide-card {
  width: 100%;
}

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

.modal-header > div {
  min-width: 0;
}

.modal-header h2 {
  margin: .35rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

.field {
  min-width: 0;
  display: grid;
  gap: .45rem;
  margin-bottom: 1rem;
}

.field > span {
  font-size: .78rem;
  font-weight: 850;
}

.field input,
.field textarea,
.field select {
  min-height: 46px;
  padding: .75rem .85rem;
}

.field textarea {
  resize: vertical;
}

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

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.switch-row span {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.switch-row strong {
  font-size: .84rem;
}

.switch-row small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.switch-row input {
  flex: 0 0 auto;
  width: 44px;
  height: 25px;
  appearance: none;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background .18s ease, border-color .18s ease;
}

.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .15);
  transition: transform .18s var(--ease);
}

.switch-row input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-row input:checked::after {
  transform: translateX(19px);
}

.move-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.inline-form input {
  min-height: 46px;
  padding: .7rem .85rem;
}

.managed-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.managed-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.managed-list-row > div {
  min-width: 0;
  display: grid;
  gap: .12rem;
}

.managed-list-row strong,
.managed-list-row small {
  overflow-wrap: anywhere;
}

.managed-list-row strong {
  font-size: .84rem;
}

.managed-list-row small {
  color: var(--muted);
  font-size: .7rem;
}

.dialog-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
}

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

.template-card {
  min-width: 0;
  display: grid;
  gap: .55rem;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.template-card h3 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.5;
}

.template-card ul {
  margin: .2rem 0 .4rem;
  padding-left: 1.15rem;
  color: var(--muted-strong);
  font-size: .72rem;
  line-height: 1.6;
}

.settings-card {
  display: grid;
}

.settings-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.settings-section:first-of-type {
  border-top: 0;
}

.settings-section > div:first-child {
  min-width: 0;
}

.settings-section h3 {
  margin: 0 0 .25rem;
  font-size: .92rem;
}

.settings-section p {
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Unsichtbares Dateifeld für den programmatisch geöffneten Importdialog */
.import-file-input {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.segmented-control button {
  min-height: 36px;
  padding: .45rem .65rem;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: .72rem;
  font-weight: 800;
}

.segmented-control button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 13px;
  color: var(--muted-strong);
  background: var(--success-soft);
  font-size: .72rem;
  line-height: 1.5;
}

.privacy-note svg {
  flex: 0 0 auto;
  color: var(--success);
}

.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: calc(var(--drawer-peek) + 20px + env(safe-area-inset-bottom));
  width: min(520px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
}

.toast span {
  min-width: 0;
  flex: 1;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.toast button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: .4rem .65rem;
  border: 0;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 850;
}

.noscript-message {
  position: fixed;
  inset: 12px;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 20px;
  color: #fff;
  background: #2a2f2c;
  text-align: center;
}

html[data-density="compact"] .capture-section {
  padding: clamp(18px, 3vw, 30px);
}

html[data-density="compact"] .workspace {
  padding: clamp(15px, 2.5vw, 24px);
}

html[data-density="compact"] .task-card {
  padding: 10px 11px;
}

html[data-density="compact"] .task-list {
  gap: 7px;
}

html[data-density="compact"] .task-meta {
  margin-top: .4rem;
}

@media (hover: hover) and (min-width: 760px) {
  .task-actions {
    opacity: .35;
    transition: opacity .18s ease;
  }

  .task-card:hover .task-actions,
  .task-card:focus-within .task-actions {
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .capture-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "form"
      "stats";
  }

  .capture-copy h1 {
    max-width: 16ch;
  }

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

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

@media (max-width: 700px) {
  body {
    padding: 0 0 calc(var(--drawer-peek) + env(safe-area-inset-bottom));
    background: var(--bg);
  }

  .app-shell {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px 16px;
  }

  .topbar-status {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .save-state {
    white-space: normal;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .brand-copy small {
    font-size: .7rem;
  }

  .install-button span {
    display: none;
  }

  main {
    padding: 14px;
  }

  .capture-section,
  .workspace {
    border-radius: 22px;
  }

  .capture-section {
    padding: 20px;
  }

  .capture-copy h1 {
    max-width: none;
    font-size: clamp(2rem, 11vw, 3.35rem);
  }

  .capture-row {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .capture-row .primary-button {
    width: 52px;
    padding: 0;
  }

  .capture-row .primary-button span {
    display: none;
  }

  .quick-options {
    grid-template-columns: 1fr 1fr;
  }

  .quick-toggle {
    grid-column: 1 / -1;
  }

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

  .workspace-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }

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

  .control-group {
    width: 100%;
    justify-content: stretch;
  }

  .control-group label {
    flex: 1 1 140px;
  }

  .list-controls select {
    max-width: none;
  }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 13px 10px;
  }

  .drag-handle {
    display: none;
  }

  .task-actions > .task-action:not(.is-important),
  .task-actions > .action-menu ~ * {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .tool-drawer {
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-radius: 22px 22px 0 0;
  }

  .drawer-panel {
    padding: 18px 14px;
  }

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

  .tool-card {
    min-height: 96px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
  }

  .tool-icon {
    width: 36px;
    height: 36px;
  }

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

  .settings-section {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .settings-actions {
    justify-content: flex-start;
  }

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

  .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-footer > div,
  .modal-footer > button {
    width: 100%;
  }

  .modal-footer > div > * {
    flex: 1 1 auto;
  }
}

/*
 * Smartphone-Layout: Hochformat und Querformat.
 * Die JavaScript-Klasse ist ein zusätzlicher iOS-Fallback, falls Safari
 * die Pointer-/Orientierungsabfrage beim Drehen nicht zuverlässig aktualisiert.
 */
@media (max-width: 600px),
       (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .capture-copy {
    display: none;
  }

  .capture-section {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "form"
      "stats";
    align-items: stretch;
    gap: 14px;
  }

  .capture-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .quick-options {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .quick-options > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .quick-options > .compact-field {
    position: relative;
    overflow: hidden;
    contain: inline-size;
  }

  .quick-options .compact-field select,
  .quick-options .compact-field input,
  .quick-options .compact-field input[type="date"] {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    inline-size: 100% !important;
    min-inline-size: 0 !important;
    max-inline-size: 100% !important;
    box-sizing: border-box;
  }

  .quick-options .compact-field input[type="date"] {
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
  }

  .quick-options .compact-field input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    margin: 0;
    text-align: left;
  }

  .quick-toggle {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Gleiche Regeln als JavaScript-gestützter iPhone-Fallback. */
html.is-phone-layout .capture-copy {
  display: none;
}

html.is-phone-layout .capture-section {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "form"
    "stats";
  align-items: stretch;
  gap: 14px;
}

html.is-phone-layout .capture-form {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

html.is-phone-layout .quick-options {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html.is-phone-layout .quick-options > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

html.is-phone-layout .quick-options > .compact-field {
  position: relative;
  overflow: hidden;
  contain: inline-size;
}

html.is-phone-layout .quick-options .compact-field select,
html.is-phone-layout .quick-options .compact-field input,
html.is-phone-layout .quick-options .compact-field input[type="date"] {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
  box-sizing: border-box;
}

html.is-phone-layout .quick-options .compact-field input[type="date"] {
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

html.is-phone-layout .quick-options .compact-field input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  margin: 0;
  text-align: left;
}

html.is-phone-layout .quick-toggle {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 420px) {
  .topbar {
    padding-inline: 12px;
  }

  .brand-copy small {
    max-width: 150px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .icon-button,
  .header-button {
    min-width: 42px;
    min-height: 42px;
  }

  main {
    padding: 10px;
  }

  .capture-section,
  .workspace {
    padding: 16px;
  }

  .capture-row input {
    padding-inline: 13px;
  }

  .quick-options {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-options > * {
    min-width: 0;
    max-width: 100%;
  }

  .compact-field select,
  .compact-field input,
  .compact-field input[type="date"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .quick-toggle {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .composer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .status-item {
    align-items: center;
    flex-direction: column;
    gap: .25rem;
    text-align: center;
  }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .task-actions > .task-action.is-important {
    display: none;
  }

  .drawer-handle {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    padding-inline: 13px;
  }

  .drawer-grip {
    width: 26px;
  }

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

  .tool-card {
    min-height: 90px;
    padding: 11px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .inline-form .primary-button {
    width: 100%;
  }

  .managed-list-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

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