:root {
  color-scheme: light;
  --ink: #132238;
  --muted: #63758c;
  --line: #cdddec;
  --paper: #f8fbff;
  --wash: #eaf4ff;
  --mint: #2f80c9;
  --mint-dark: #1d5d98;
  --coral: #3d9be9;
  --gold: #6aaee8;
  --blue: #2f80c9;
  --shadow: 0 18px 45px rgba(29, 93, 152, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7fbff 0%, #eaf4ff 48%, #f3f9ff 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  position: relative;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after,
[data-tooltip]::before {
  position: absolute;
  left: 50%;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: #132238;
  color: white;
  box-shadow: 0 10px 24px rgba(19, 34, 56, 0.2);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

[data-tooltip]::before {
  content: "";
  bottom: calc(100% + 4px);
  border: 6px solid transparent;
  border-top-color: #132238;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

button:hover {
  background: var(--mint-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.ghost:hover {
  background: var(--wash);
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.workspace,
.panel {
  min-width: 0;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.9;
}

h2 {
  font-size: 1rem;
}

.sync-state {
  width: 86px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 750;
}

.quick-add,
.focus-strip,
.lane,
.panel > div {
  border: 1px solid rgba(205, 221, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.quick-add {
  padding: 14px;
}

.task-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
}

.task-entry input {
  min-width: 0;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
}

.task-entry button {
  width: 48px;
  font-size: 1.6rem;
}

.assess-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.assess-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input[type="range"] {
  accent-color: var(--mint);
}

.controls,
.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.controls {
  margin: 18px 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(360px, 100%);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.segmented button {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--ink);
  color: white;
}

.tool-row button {
  padding: 0 14px;
}

.focus-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  background: #132238;
  color: white;
}

.focus-strip .eyebrow {
  color: #b9d7f2;
}

.focus-strip h2 {
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  line-height: 1.15;
}

.focus-strip button {
  width: 94px;
  background: var(--coral);
}

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

.lane {
  min-height: 440px;
  padding: 14px;
}

.lane h2 {
  margin-bottom: 12px;
}

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

.task {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: start;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.task.selected {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(47, 128, 201, 0.16);
}

.task.done {
  background: #eef5fc;
}

.check {
  width: 28px;
  min-height: 28px;
  border: 1px solid var(--line);
  background: white;
  color: var(--mint-dark);
}

.check.done {
  background: var(--mint);
  color: white;
}

.task-title {
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.25;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.priority-pill,
.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.priority-pill {
  background: rgba(47, 128, 201, 0.15);
  color: #1d5d98;
}

.mini-badge {
  background: var(--wash);
  color: var(--muted);
}

.task-indicators {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(19, 34, 56, 0.08);
}

.indicator.impact,
.metric-fill.impact {
  background: #1f8acb;
}

.indicator.urgency,
.metric-fill.urgency {
  background: #55aee9;
}

.indicator.effort,
.metric-fill.effort {
  background: #7a8fe8;
}

.indicator.low {
  background: #c7dced;
}

.indicator.medium {
  background: #7fb8e5;
}

.indicator.high {
  filter: saturate(1.08);
}

.delete {
  width: 32px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}

.delete:hover {
  background: #e7f2ff;
  color: #1d5d98;
}

.panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel > div {
  padding: 16px;
}

.timer {
  background: #19395f;
  color: white;
}

.timer .eyebrow {
  color: #b9d7f2;
}

#timerDisplay {
  margin: 8px 0 14px;
  font-size: 3rem;
  font-weight: 850;
  line-height: 1;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.current-state {
  display: grid;
  gap: 12px;
}

.state-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.state-head strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(47, 128, 201, 0.13);
  color: var(--mint-dark);
  font-size: 1.25rem;
}

.current-state input {
  width: 100%;
}

.state-label {
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

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

.stats div {
  display: grid;
  gap: 3px;
  min-height: 76px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
}

.stats strong {
  font-size: 1.7rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

#selectedTask {
  min-height: 48px;
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.25;
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--wash);
}

.score-card span {
  color: var(--muted);
  font-weight: 800;
}

.score-card strong {
  font-size: 1.6rem;
}

.details-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

#detailsTitle {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.notes-label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#taskNotes {
  min-height: 132px;
  margin: 8px 0 12px;
  background: white;
}

#taskNotes:disabled {
  background: #eef5fc;
  color: var(--muted);
}

.detail-metrics {
  display: grid;
  gap: 9px;
  margin: 0 0 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: center;
}

.metric-row > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.metric-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--wash);
}

.metric-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.metric-fill.low {
  filter: saturate(0.62) brightness(1.18);
}

.metric-fill.medium {
  filter: saturate(0.82) brightness(1.08);
}

.metric-fill.high {
  filter: saturate(1.08);
}

.metric-row strong {
  color: var(--ink);
  font-size: 0.84rem;
  text-align: right;
}

.attachment-tools {
  display: grid;
  gap: 8px;
}

.file-button {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.file-button:hover {
  background: #1d5d98;
}

#attachmentInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attachment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.attachment a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.attachment span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.attachment button {
  width: 32px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
}

.attachment button:hover {
  background: #e7f2ff;
  color: #1d5d98;
}

dialog {
  width: min(620px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(19, 34, 56, 0.46);
}

.dialog-card {
  padding: 16px;
  border-radius: 8px;
  background: white;
}

.dialog-card header,
.dialog-card menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.dialog-card header button {
  width: 36px;
  min-height: 36px;
  background: transparent;
  color: var(--ink);
  font-size: 1.4rem;
}

textarea {
  width: 100%;
  resize: vertical;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.empty.compact {
  padding: 10px;
  font-size: 0.82rem;
}

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

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

  .details {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .controls,
  .focus-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .assess-grid,
  .columns,
  .panel {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

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

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(61, 155, 233, 0.22), transparent 30%),
    linear-gradient(135deg, #f7fbff 0%, #eaf4ff 50%, #f3f9ff 100%);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.72fr);
  gap: 18px;
  width: min(1060px, 100%);
  align-items: stretch;
}

.auth-story,
.auth-card {
  border: 1px solid rgba(205, 221, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.auth-story {
  display: grid;
  align-content: center;
  min-height: 620px;
  padding: clamp(24px, 5vw, 56px);
  overflow: hidden;
  position: relative;
}

.auth-story::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  border: 42px solid rgba(47, 128, 201, 0.12);
  border-radius: 999px;
}

.auth-icon {
  width: 82px;
  height: 82px;
  margin-bottom: 22px;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(29, 93, 152, 0.2);
}

.auth-story h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.92;
}

.auth-copy {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.55;
}

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

.benefit-grid div {
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.benefit-grid strong,
.benefit-grid span {
  display: block;
}

.benefit-grid strong {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.92rem;
}

.benefit-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.42;
}

.auth-card {
  display: grid;
  align-content: center;
  min-height: 620px;
  padding: clamp(20px, 4vw, 34px);
}

.auth-card h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 8vw, 3.5rem);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-form input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.auth-message {
  min-height: 22px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.auth-card > .ghost {
  width: 100%;
}

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

  .auth-story,
  .auth-card {
    min-height: auto;
  }

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

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

.account-chip {
  max-width: 260px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logoutButton {
  min-height: 36px;
  padding: 0 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 780px) {
  .top-actions {
    justify-content: stretch;
  }

  .account-chip,
  #logoutButton,
  .sync-state {
    width: 100%;
    max-width: none;
  }
}

.account-chip {
  border: 1px solid var(--line);
  min-height: 36px;
  text-align: left;
}

.profile-card {
  width: min(520px, calc(100vw - 24px));
}

.profile-label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-label input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.auth-help {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-actions .ghost {
  width: 100%;
}

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

.steps-badge {
  background: rgba(47, 128, 201, 0.12);
  color: var(--mint-dark);
}

.subtask-section {
  margin: 0 0 14px;
}

.subtask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  margin: 8px 0 10px;
}

.subtask-form input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: white;
  color: var(--ink);
}

.subtask-form input:disabled {
  background: #eef5fc;
  color: var(--muted);
}

.subtask-form button {
  width: 42px;
  min-height: 42px;
  font-size: 1.25rem;
}

.subtask-list {
  display: grid;
  gap: 8px;
}

.subtask {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.subtask.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.subtask-check,
.subtask-delete {
  min-height: 28px;
  width: 28px;
  border: 1px solid var(--line);
  background: white;
  color: var(--mint-dark);
}

.subtask-check.done {
  background: var(--mint);
  color: white;
}

.subtask-delete {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
}

.subtask-delete:hover,
.subtask-check:hover {
  background: #e7f2ff;
  color: #1d5d98;
}

.subtask-check:disabled,
.subtask-delete:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
