:root {
  color-scheme: light;
  --paper: #f7f9fd;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --ink: #17191f;
  --muted: #687181;
  --line: rgba(255, 255, 255, 0.64);
  --line-dark: rgba(23, 25, 31, 0.1);
  --blue: #2378ff;
  --green: #00a889;
  --coral: #ff6a45;
  --gold: #b77900;
  --violet: #8f6cff;
  --shadow: 0 24px 70px rgba(61, 74, 112, 0.18);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 46px rgba(65, 78, 115, 0.14);
  --field-bg: rgba(255, 255, 255, 0.6);
  --field-border: rgba(255, 255, 255, 0.74);
  --card-glow: rgba(61, 74, 112, 0.14);
  --grid-line: rgba(255, 255, 255, 0.42);
  --body-bg:
    radial-gradient(circle at 15% 10%, rgba(103, 180, 255, 0.42), transparent 32vw),
    radial-gradient(circle at 78% 18%, rgba(255, 176, 112, 0.34), transparent 30vw),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 44%, #fff7ef 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10141d;
  --surface: rgba(22, 28, 41, 0.58);
  --surface-strong: rgba(34, 42, 59, 0.76);
  --ink: #f7f9ff;
  --muted: #aab4c4;
  --line: rgba(255, 255, 255, 0.14);
  --line-dark: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.24);
  --field-bg: rgba(255, 255, 255, 0.08);
  --field-border: rgba(255, 255, 255, 0.16);
  --card-glow: rgba(0, 0, 0, 0.28);
  --grid-line: rgba(255, 255, 255, 0.08);
  --body-bg:
    radial-gradient(circle at 16% 10%, rgba(62, 126, 255, 0.28), transparent 32vw),
    radial-gradient(circle at 78% 18%, rgba(255, 106, 69, 0.16), transparent 30vw),
    linear-gradient(135deg, #10141d 0%, #182236 48%, #241c28 100%);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --paper: #10141d;
    --surface: rgba(22, 28, 41, 0.58);
    --surface-strong: rgba(34, 42, 59, 0.76);
    --ink: #f7f9ff;
    --muted: #aab4c4;
    --line: rgba(255, 255, 255, 0.14);
    --line-dark: rgba(255, 255, 255, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.24);
    --field-bg: rgba(255, 255, 255, 0.08);
    --field-border: rgba(255, 255, 255, 0.16);
    --card-glow: rgba(0, 0, 0, 0.28);
    --grid-line: rgba(255, 255, 255, 0.08);
    --body-bg:
      radial-gradient(circle at 16% 10%, rgba(62, 126, 255, 0.28), transparent 32vw),
      radial-gradient(circle at 78% 18%, rgba(255, 106, 69, 0.16), transparent 30vw),
      linear-gradient(135deg, #10141d 0%, #182236 48%, #241c28 100%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    var(--body-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 70%, white);
  outline-offset: 3px;
}

a {
  color: var(--blue);
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.78;
  pointer-events: none;
}

.ambient-one {
  top: 90px;
  left: 330px;
  width: 260px;
  height: 260px;
  background: rgba(47, 131, 255, 0.22);
}

.ambient-two {
  right: 62px;
  top: 80px;
  width: 340px;
  height: 340px;
  background: rgba(255, 121, 76, 0.16);
}

.ambient-three {
  right: 22%;
  bottom: 42px;
  width: 210px;
  height: 210px;
  background: rgba(0, 168, 137, 0.15);
}

.app-settings-button {
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
  padding: 16px;
  gap: 16px;
}

.sidebar,
.workspace,
.stats div,
.today-summary,
.task-card,
.empty,
dialog,
.modal-form {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 32px);
  padding: 20px;
  border-radius: 28px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px;
}

.brand-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-main img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(23, 25, 31, 0.18);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand span,
.eyebrow,
.stats p,
.task-meta,
.empty p,
.project-empty,
.project-task-row small {
  color: var(--muted);
}

.primary-action,
.secondary-action,
.filter,
.status-pill,
.project-task-row,
.task-action,
.danger-action {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(61, 74, 112, 0.1);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(31, 35, 45, 0.96), rgba(67, 76, 98, 0.88));
  color: white;
}

.pill-action {
  min-height: 48px;
  border-radius: 999px;
}

.secondary-action {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(61, 74, 112, 0.1);
}

.icon-button svg,
.task-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.project-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 2px 2px 12px;
}

.project-group {
  border-radius: 20px;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.project-group.is-active {
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 24px rgba(61, 74, 112, 0.08);
}

.project-button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: 20px;
  color: var(--ink);
  list-style: none;
}

.project-button::-webkit-details-marker {
  display: none;
}

.project-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.66);
}

.project-count {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.project-chevron {
  color: var(--muted);
  transition: transform 160ms ease;
}

.project-group[open] .project-chevron {
  transform: rotate(180deg);
}

.project-task-menu {
  display: grid;
  gap: 6px;
  padding: 0 10px 12px 26px;
}

.project-task-row {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.project-task-row::before {
  align-self: stretch;
  border-radius: 999px;
  background: var(--task-color, var(--blue));
  content: "";
  grid-row: 1 / span 2;
}

.project-task-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 780;
}

.project-task-row small {
  font-size: 12px;
  font-weight: 720;
}

.project-task-row.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.project-empty {
  padding: 8px 4px;
  font-size: 13px;
}

.project-deadline {
  padding: 8px 4px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: calc(100vh - 32px);
  padding: 26px;
  border-radius: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  overflow-wrap: anywhere;
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.02;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.stats div {
  padding: 18px;
  border-radius: 22px;
}

.stats span {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
  font-weight: 850;
}

.today-summary {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 12%, transparent), transparent 48%),
    var(--surface);
}

.summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.summary-heading h2 {
  font-size: 22px;
}

.summary-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-project-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(220px, 100%);
  min-height: 30px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--summary-project-color, var(--blue)) 18%, transparent), rgba(255, 255, 255, 0.3));
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.summary-project-pill::before {
  width: 8px;
  height: 8px;
  margin-right: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--summary-project-color, var(--blue));
  content: "";
}

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

.summary-metric,
.summary-next {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.summary-metric span {
  display: block;
  margin-bottom: 2px;
  font-size: 28px;
  font-weight: 850;
}

.summary-metric p,
.summary-next span,
.summary-next p {
  color: var(--muted);
}

.summary-next {
  display: grid;
  gap: 4px;
}

.summary-next strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-next p {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.32);
  width: fit-content;
}

.filter {
  min-width: 78px;
  padding: 0 16px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.filter.is-active {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 10px 22px rgba(61, 74, 112, 0.12);
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 14px;
}

.task-card {
  display: grid;
  gap: 14px;
  min-height: 198px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--task-color, var(--blue)) 16%, transparent), transparent 54%),
    var(--surface);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.task-card::before {
  display: block;
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: var(--task-color, var(--blue));
  content: "";
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 24px 54px rgba(61, 74, 112, 0.18);
}

.task-card.is-done {
  opacity: 0.7;
}

.task-card.is-done h3 {
  text-decoration: line-through;
}

.task-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card h3 {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.task-meta {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.task-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-notes {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.attachment-list,
.file-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-list a,
.attachment-list span,
.attachment-chip,
.file-list span {
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip {
  cursor: pointer;
  text-decoration: underline;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.task-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
}

.danger-action {
  color: var(--coral);
}

.empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 30px;
  border-style: dashed;
  border-radius: 24px;
  text-align: center;
}

.empty img {
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
}

.empty h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 28px;
  margin: auto;
  overflow: auto;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

dialog::backdrop {
  background: rgba(31, 39, 56, 0.24);
  backdrop-filter: blur(10px);
}

.modal-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
}

.form-section {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.24);
}

.form-section h3 {
  font-size: 17px;
}

.form-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.3);
}

.segment,
.chip {
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.is-active,
.chip:hover {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 10px 20px rgba(61, 74, 112, 0.11);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
}

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

.settings-dialog {
  width: min(640px, calc(100vw - 28px));
}

.settings-dialog.welcome-dialog {
  width: min(720px, calc(100vw - 28px));
}

.settings-form {
  gap: 18px;
}

.welcome-dialog .settings-form {
  gap: 12px;
  padding: 18px;
}

.welcome-dialog .modal-form header {
  align-items: flex-start;
}

.welcome-dialog .settings-section {
  gap: 10px;
  padding: 14px;
}

.welcome-dialog .settings-note {
  margin: 0;
}

.welcome-dialog .secondary-settings-section {
  display: none;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.24);
}

.settings-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.is-active {
  color: var(--green);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.plan-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 18%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.28);
}

.welcome-dialog .plan-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px;
}

.welcome-dialog .plan-card p {
  grid-column: 1 / -1;
  margin: 0;
}

.plan-card strong,
.plan-card span {
  color: var(--ink);
}

.plan-card p {
  color: var(--muted);
}

.modal-form header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 750;
}

.color-field {
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.is-disabled {
  opacity: 0.58;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--field-border);
  border-radius: 16px;
  padding: 10px 12px;
  background: var(--field-bg);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

select {
  appearance: none;
  -webkit-appearance: none;
}

.project-select-field {
  position: relative;
  --selected-project-color: var(--blue);
}

.select-shell {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 4px 10px;
  border: 1px solid var(--field-border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--selected-project-color) 16%, transparent), transparent 62%),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 26px rgba(61, 74, 112, 0.1);
  color: var(--ink);
  text-align: left;
}

.select-shell:focus-within {
  outline: 3px solid color-mix(in srgb, var(--selected-project-color) 54%, white);
  outline-offset: 3px;
}

.select-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--option-color, var(--selected-project-color));
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.54);
}

.select-value {
  overflow: hidden;
  padding-inline: 8px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  justify-self: end;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.project-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 92%, white);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.project-select-field.is-open .project-picker-menu {
  display: grid;
}

.project-select-field.is-open .select-chevron {
  transform: rotate(180deg);
}

.project-picker-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.project-picker-option:hover,
.project-picker-option.is-selected {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--option-color) 14%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.58);
}

.project-picker-option span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="color"] {
  height: 48px;
  padding: 6px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 12px;
}

.upload-card {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.upload-card span,
.upload-card strong {
  display: block;
}

.upload-card strong {
  color: var(--muted);
  font-size: 14px;
}

.upload-card input {
  margin-top: 12px;
}

textarea {
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: rgba(23, 25, 31, 0.84);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.undo-toast {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(460px, calc(100vw - 44px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: rgba(23, 25, 31, 0.9);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.undo-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sidebar {
    min-height: auto;
  }

  .workspace {
    min-height: auto;
    padding: 20px;
  }

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

  .topbar-actions,
  .stats,
  .summary-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    display: grid;
    grid-template-columns: 42px repeat(3, minmax(0, 1fr));
  }

  .topbar-actions .secondary-action,
  .topbar-actions .danger-action,
  .topbar-actions .primary-action {
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
  }

  .filters {
    width: 100%;
  }

  .filter {
    flex: 1;
    min-width: 0;
  }

  h1 {
    font-size: 32px;
  }

  .button-row {
    display: grid;
  }
}

@media (max-width: 380px) {
  .workspace {
    padding: 16px;
  }

  .topbar-actions {
    grid-template-columns: 42px 1fr;
  }

  .topbar-actions .primary-action {
    grid-column: span 2;
  }

  .task-actions,
  .undo-toast {
    align-items: stretch;
    flex-direction: column;
  }
}
