:root {
  --paper: #fffaf0;
  --paper-strong: #fff4d7;
  --ink: #332c24;
  --text: #675548;
  --muted: #9a8270;
  --line: #f0cfa8;
  --line-strong: #dbad72;
  --shadow-sm: 0 5px 12px rgba(111, 77, 42, 0.1);
  --shadow-md: 0 16px 34px rgba(111, 77, 42, 0.14);
  --red: #f07167;
  --orange: #f4a261;
  --yellow: #f6c945;
  --green: #53b788;
  --blue: #4d96d7;
  --violet: #8f7adf;
  --cream: rgba(255, 252, 244, 0.9);
  --radius: 10px;
  color: var(--ink);
  font-family: "Nunito", "Comic Sans MS", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(255, 246, 219, 0.72), rgba(231, 247, 255, 0.78) 42%, rgba(236, 250, 240, 0.76)),
    #fffdf7;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 14% 18%, rgba(246, 201, 69, 0.2) 0 8px, transparent 9px),
    radial-gradient(circle at 84% 24%, rgba(77, 150, 215, 0.16) 0 7px, transparent 8px),
    linear-gradient(90deg, rgba(219, 173, 114, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(219, 173, 114, 0.1) 1px, transparent 1px);
  background-size: 170px 170px, 210px 210px, 34px 34px, 34px 34px;
  opacity: 0.72;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(77, 150, 215, 0.24);
  outline-offset: 2px;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 24px));
  min-height: calc(100vh - 16px);
  height: calc(100vh - 16px);
  margin: 8px auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 260px;
  grid-template-rows: auto auto auto minmax(0, 1fr) minmax(0, 0.92fr) auto;
  grid-template-areas:
    "header header header"
    "message message message"
    "doing todo quick"
    "doing todo done"
    "doing todo done"
    "energy energy energy";
  gap: 12px;
  overflow: hidden;
  border: 2px solid rgba(219, 173, 114, 0.68);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.34);
  box-shadow: 0 24px 58px rgba(111, 77, 42, 0.13);
  backdrop-filter: blur(16px);
}

.app-header,
.quick-add,
.kanban-column,
.task-card,
.empty-state,
.energy-meter,
.login-panel,
.app-message {
  outline: 1px solid rgba(255, 255, 255, 0.66);
}

.app-header {
  grid-area: header;
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(430px, 1.45fr) auto;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border: 2px solid rgba(219, 173, 114, 0.65);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 249, 231, 0.96), rgba(235, 249, 255, 0.92)), var(--paper);
  box-shadow: var(--shadow-sm);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -18px;
  width: 148px;
  height: 48px;
  border: 2px dashed rgba(244, 162, 97, 0.32);
  border-radius: 999px;
  transform: rotate(-8deg);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.header-hero,
.header-dashboard,
.header-actions {
  position: relative;
  z-index: 1;
}

.header-hero {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 6px 2px 6px 6px;
}

h1 {
  max-width: 12em;
  color: var(--ink);
  font-size: 2.12rem;
  line-height: 1.04;
  font-weight: 950;
  letter-spacing: 0;
}

.header-note {
  margin-top: 7px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
}

.header-dashboard {
  display: grid;
  grid-template-columns: minmax(124px, 1fr) minmax(116px, 0.8fr) minmax(132px, 1fr);
  gap: 9px;
  min-width: 0;
}

.info-tile {
  display: grid;
  align-content: center;
  min-height: 78px;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid rgba(77, 150, 215, 0.22);
  border-radius: 13px;
  background: rgba(255, 254, 253, 0.78);
  box-shadow: inset 0 -3px 0 rgba(77, 150, 215, 0.08);
}

.info-tile span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1;
}

.info-tile strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.12;
}

.info-tile-date {
  background: #fff4d7;
  border-color: rgba(246, 201, 69, 0.42);
}

.info-tile-time {
  background: #e8f5ff;
  border-color: rgba(77, 150, 215, 0.28);
}

.info-tile-time strong {
  color: #226da8;
  font-size: 1.18rem;
}

.user-badge {
  background: #e5f8ec;
  border-color: rgba(83, 183, 136, 0.3);
}

.user-badge strong {
  color: #237958;
  font-size: 1.1rem;
}

.user-badge em {
  margin-top: 4px;
  color: #2d7258;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
}

.header-actions {
  display: grid;
  grid-template-columns: minmax(146px, 1fr);
  align-content: center;
  justify-items: stretch;
  gap: 9px;
  min-width: 150px;
}

.live-pill,
.secondary-button,
.quick-submit,
.card-actions button {
  min-height: 38px;
  border-radius: 999px;
  font-weight: 950;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 2px solid rgba(83, 183, 136, 0.28);
  background: #e5f8ec;
  color: #207a57;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(83, 183, 136, 0.12);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(83, 183, 136, 0.35);
  animation: pulse 1.8s infinite;
}

.secondary-button {
  padding: 7px 14px;
  border: 2px solid var(--line-strong);
  background: #fffefd;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 2px solid rgba(219, 173, 114, 0.68);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 249, 231, 0.96), rgba(232, 245, 255, 0.92)), var(--paper);
  box-shadow: var(--shadow-md);
}

.login-panel h1 {
  font-size: 2rem;
}

.login-panel p {
  color: var(--text);
  font-weight: 900;
}

.login-panel label,
.quick-add label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 950;
}

.login-panel input,
.quick-add input {
  width: 100%;
  min-height: 44px;
  border: 2px solid rgba(219, 173, 114, 0.72);
  border-radius: var(--radius);
  background: #fffefd;
  color: var(--ink);
  padding: 10px 12px;
  outline: 0;
  box-shadow: inset 0 -2px 0 rgba(111, 77, 42, 0.06);
}

.app-message {
  grid-area: message;
  position: relative;
  z-index: 2;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 2px solid rgba(77, 150, 215, 0.28);
  border-radius: 12px;
  background: #e8f5ff;
  color: #226da8;
  font-size: 0.86rem;
  font-weight: 950;
  box-shadow: var(--shadow-sm);
}

.app-message-error {
  border-color: rgba(240, 113, 103, 0.34);
  background: #fff0ee;
  color: #b94a42;
}

.quick-add {
  position: relative;
  z-index: 2;
  grid-area: quick;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 2px dashed rgba(219, 173, 114, 0.78);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 247, 218, 0.9), rgba(255, 255, 255, 0.88)), var(--paper);
  box-shadow: var(--shadow-sm);
}

.quick-add label {
  font-size: 0.76rem;
}

.quick-add input {
  min-height: 34px;
  padding: 7px 10px;
}

.quick-add input::placeholder {
  color: #af927e;
}

.quick-submit {
  min-height: 34px;
  padding: 7px 10px;
  background: var(--blue);
  color: white;
  font-size: 0.78rem;
  box-shadow: 0 7px 0 #2f75af;
}

.kanban-board {
  display: contents;
}

.kanban-column {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 2px solid rgba(219, 173, 114, 0.62);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.8);
  box-shadow: var(--shadow-md);
}

.column-doing {
  grid-area: doing;
}

.column-todo {
  grid-area: todo;
}

.column-done {
  grid-area: done;
}

.column-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 13px 15px 13px 17px;
  border-bottom: 2px solid rgba(240, 207, 168, 0.78);
  background: var(--paper);
}

.column-header::before {
  content: "";
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--violet);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  transform: rotate(-8deg);
}

.column-header > div {
  flex: 1;
  min-width: 0;
}

.column-header h2 {
  color: var(--ink);
  font-size: 1.26rem;
  line-height: 1;
  font-weight: 950;
}

.column-header p {
  margin-top: 5px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.22;
  font-weight: 850;
}

.column-header > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: #ffffff;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: inset 0 -3px 0 rgba(111, 77, 42, 0.08);
}

.column-todo .column-header {
  background: linear-gradient(90deg, #f5efff, #fffdf7);
}

.column-todo .column-header::before {
  background: var(--violet);
}

.column-todo .column-header > span {
  color: var(--violet);
}

.column-doing .column-header {
  background: linear-gradient(90deg, #e8f5ff, #fffdf7);
}

.column-doing .column-header::before {
  background: var(--blue);
}

.column-doing .column-header > span {
  color: var(--blue);
}

.column-done .column-header {
  background: linear-gradient(90deg, #e8f8ef, #fffdf7);
}

.column-done .column-header::before {
  background: var(--green);
}

.column-done .column-header > span {
  color: var(--green);
}

.task-stack {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 16px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 2px dashed rgba(219, 173, 114, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-weight: 950;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "top actions"
    "title actions"
    "tags meta";
  align-items: center;
  gap: 5px 10px;
  padding: 9px 10px 9px 14px;
  border: 2px solid rgba(240, 207, 168, 0.9);
  border-radius: var(--radius);
  background: #fffefa;
  box-shadow: 0 5px 0 rgba(240, 207, 168, 0.28), var(--shadow-sm);
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: var(--violet);
}

.task-doing::before {
  background: var(--blue);
}

.task-done {
  background: #fafffb;
}

.task-done::before {
  background: var(--green);
}

.task-card-top,
.task-meta,
.tag-row,
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.task-card-top {
  grid-area: top;
  justify-content: flex-start;
  padding-left: 5px;
}

.priority,
.recent-reminder,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 950;
}

.priority-high {
  background: #ffe2dc;
  color: #b6453b;
}

.priority-medium {
  background: #fff0bd;
  color: #8b6113;
}

.priority-low {
  background: #def6e8;
  color: #237958;
}

.recent-reminder {
  background: #ffedd0;
  color: #b05a1b;
  box-shadow: inset 0 -2px 0 rgba(176, 90, 27, 0.1);
}

.task-card time {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
}

.task-card h3 {
  grid-area: title;
  padding-left: 5px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.22;
  font-weight: 950;
}

.task-meta {
  grid-area: meta;
  justify-content: flex-end;
  padding-left: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.tag-row {
  grid-area: tags;
  min-width: 0;
  padding-left: 5px;
}

.tag-row span {
  background: #fff2df;
  color: var(--text);
}

.card-actions {
  grid-area: actions;
  justify-content: flex-end;
  align-self: center;
  max-width: 150px;
}

.card-actions button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(219, 173, 114, 0.62);
  background: #fff9ed;
  color: var(--text);
  font-size: 0.66rem;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(111, 77, 42, 0.05);
}

.card-actions button:hover,
.secondary-button:hover,
.quick-submit:hover {
  transform: translateY(-2px);
}

.card-actions button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 7px 14px rgba(111, 77, 42, 0.1);
}

.quick-submit:hover {
  box-shadow: 0 11px 0 #2f75af;
}

.column-doing .column-header,
.column-done .column-header {
  min-height: 54px;
  padding: 9px 13px;
}

.column-doing .column-header::before,
.column-done .column-header::before {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.column-doing .column-header h2,
.column-done .column-header h2 {
  font-size: 1.08rem;
}

.column-doing .column-header p,
.column-done .column-header p {
  margin-top: 3px;
  font-size: 0.72rem;
}

.column-doing .column-header > span,
.column-done .column-header > span {
  width: 30px;
  height: 30px;
  font-size: 0.86rem;
}

.column-doing .task-stack,
.column-done .task-stack {
  gap: 7px;
  padding: 8px;
}

.column-doing .task-card,
.column-done .task-card {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "top meta"
    "title title"
    "tags actions";
  align-items: center;
  gap: 4px 8px;
  padding: 8px 9px 8px 13px;
  box-shadow: 0 4px 0 rgba(240, 207, 168, 0.24), var(--shadow-sm);
}

.column-doing .task-card h3,
.column-done .task-card h3 {
  padding-right: 2px;
  font-size: 0.82rem;
  line-height: 1.18;
}

.column-doing .card-actions,
.column-done .card-actions {
  justify-content: flex-end;
  max-width: 142px;
}

.column-doing .card-actions button,
.column-done .card-actions button {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 0.64rem;
}

.column-doing .task-meta,
.column-done .task-meta {
  justify-content: flex-end;
  white-space: nowrap;
}

.energy-meter {
  grid-area: energy;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border: 2px solid rgba(219, 173, 114, 0.62);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 247, 218, 0.92), rgba(230, 248, 239, 0.9)), var(--paper);
  box-shadow: var(--shadow-sm);
}

.energy-meter-text {
  display: grid;
  gap: 2px;
  min-width: 96px;
}

.energy-meter-text span,
.energy-meter p {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 950;
}

.energy-meter-text strong {
  color: #237958;
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 950;
}

.energy-meter p {
  white-space: nowrap;
}

.energy-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  gap: 6px;
  min-height: 22px;
  padding: 5px;
  border: 2px solid rgba(83, 183, 136, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -3px 0 rgba(111, 77, 42, 0.06);
}

.energy-segment {
  display: block;
  min-width: 0;
  border-radius: 999px;
  background: #efe1cf;
  box-shadow: inset 0 -2px 0 rgba(111, 77, 42, 0.08);
  transform: scaleX(0.74);
  transform-origin: left center;
  transition: background 700ms ease, transform 700ms ease;
}

.energy-segment-filled {
  background: linear-gradient(90deg, var(--green), #8bd89a);
  transform: scaleX(1);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(83, 183, 136, 0.35);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(83, 183, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(83, 183, 136, 0);
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 14px, 720px);
    height: auto;
    min-height: calc(100vh - 14px);
    margin: 7px auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "header"
      "message"
      "quick"
      "todo"
      "doing"
      "done"
      "energy";
    overflow: visible;
  }

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

  .header-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kanban-column {
    min-height: 260px;
  }

  .task-stack {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
    gap: 9px;
    border-radius: 14px;
  }

  .app-header,
  .login-panel,
  .quick-add,
  .kanban-column,
  .energy-meter {
    border-radius: 12px;
  }

  h1 {
    font-size: 1.62rem;
  }

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

  .info-tile {
    min-height: 58px;
  }

  .live-pill {
    white-space: normal;
  }

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

  .task-card,
  .column-doing .task-card,
  .column-done .task-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "title"
      "tags"
      "meta"
      "actions";
  }

  .task-meta,
  .card-actions,
  .column-doing .task-meta,
  .column-done .task-meta,
  .column-doing .card-actions,
  .column-done .card-actions {
    justify-content: flex-start;
    max-width: none;
  }

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

  .energy-meter p {
    white-space: normal;
  }
}
