:root {
  --bg: #2a2d32;
  --bg-deep: #23262b;
  --paper: #34383e;
  --ink: #f3f4f6;
  --muted: #a7adb6;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #e7e9ed;
  --accent-dark: #f7f8fa;
  --accent-ink: #1c1e22;
  --shadow: none;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  touch-action: manipulation;
}

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
}

button, input, textarea {
  font: inherit;
  color: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button { cursor: pointer; }

[hidden] { display: none !important; }

button:focus,
input:focus,
textarea:focus,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.03em;
}

.app {
  width: min(1080px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  overflow-x: hidden;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.top-block { flex: 1; min-width: 0; }

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-line .skill-name { flex: 1; width: auto; }

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: 32px; line-height: 1.05; }
h2 { margin: 0; font-size: 22px; line-height: 1.15; }

.primary, .ghost, .danger, .icon-btn, .file-btn {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.primary:hover { background: var(--accent-dark); }

.ghost, .file-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost:hover, .file-btn:hover { background: rgba(255, 255, 255, 0.05); }

.danger {
  background: transparent;
  color: #f0b4b4;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.icon-btn:focus,
.icon-btn:focus-visible,
.icon-btn:active {
  outline: none;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.icon-btn .ico { width: 22px; height: 22px; }

.composer, .panel, .sheet, .note, .label-row {
  background: var(--paper);
  border-radius: var(--radius);
}

.composer, .panel, .note, .label-row {
  border: 1px solid var(--line);
}

.composer { padding: 14px; margin-bottom: 14px; }

textarea, input[type="text"] {
  width: 100%;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
}

textarea {
  min-height: 72px;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.composer-bar, .sheet-actions, .transfer-row, .note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-bar { margin-top: 8px; }
#save-note { margin-left: auto; }

.hint, .foot, .meta, .empty, .field-label {
  color: var(--muted);
  font-size: 13px;
}

.hint { margin: 0; flex: 1; }

.columns { display: grid; gap: 12px; min-width: 0; max-width: 100%; }

.panel { padding: 14px; min-width: 0; max-width: 100%; }

.panel-head, .sheet-head, .folder-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head { margin-bottom: 10px; }

.count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stack { display: grid; gap: 8px; min-width: 0; max-width: 100%; }
.stack > * { min-width: 0; max-width: 100%; }

#unsorted-list,
#folder-notes { gap: 0; }

.notes-panel {
  background: transparent;
  border: 0;
  padding-left: 2px;
  padding-right: 2px;
}

#view-home[hidden],
#view-notes[hidden],
#view-tasks[hidden],
#view-ideas[hidden],
#view-goals[hidden],
#view-skills[hidden],
#view-skill[hidden],
#view-culture[hidden],
#view-mix[hidden],
#view-plan[hidden],
#view-folder[hidden] { display: none !important; }

.home-tasks {
  margin: 0 0 14px;
  padding: 8px 14px 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.home-tasks-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.home-tasks-head strong {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.home-tasks .task { padding: 8px 0; }
.home-tasks .task:last-child { border-bottom: 0; }
.home-tasks .task-text { overflow-wrap: anywhere; }
.home-tasks .empty { margin: 0 0 10px; }

.section-list { display: grid; gap: 10px; }

.section-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-align: left;
}

.section-row strong {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.section-mark {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #3e434b;
  color: var(--ink);
}

.section-mark-tasks { color: #7dcea0; }
.section-mark-ideas { color: #e6c07b; }
.section-mark-goals { color: #8eb4e8; }
.section-mark-skills { color: #c9a6e0; }
.section-mark-culture { color: #f0a3c4; }
.section-mark-mix { color: #8fd0d0; }
.section-mark-plan { color: #f0b27a; }
.section-mark-priorities { color: #e7c15a; }

#view-notes .note-back,
#view-tasks .note-back,
#view-ideas .note-back,
#view-goals .note-back,
#view-skills .note-back,
#view-skill .note-back,
#view-culture .note-back,
#view-mix .note-back,
#view-plan .note-back,
#view-priorities .note-back,
#view-folder .note-back { margin: 0 0 2px -4px; }

.priority-status { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.priority-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.priority-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: #3c4043;
  color: var(--ink);
  font-size: 16px;
  text-align: left;
}
.priority-tile[aria-pressed="true"] { background: #34383d; }
.priority-emoji { flex: none; width: 24px; font-size: 18px; text-align: center; }
.priority-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid #8e949d;
  border-radius: 50%;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
}
.priority-tile[aria-pressed="true"] .priority-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #1c1e22;
}
.priority-fold {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-align: left;
}
.priority-fold span:first-child { flex: 1; }
.priority-fold .chevron { color: var(--muted); transition: transform 0.15s ease; }
.priority-fold[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.priority-reset { margin-top: 12px; color: #f0b4b4; }
.priority-actions { display: flex; gap: 8px; margin-top: 12px; }
.priority-actions .primary,
.priority-actions .ghost { flex: 1; }
.priority-remind {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.priority-remind label { color: var(--muted); font-size: 15px; }
.priority-remind input {
  width: 112px;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: #3c4043;
  color: var(--ink);
  font-size: 16px;
  padding: 0 10px;
}
.priority-remind button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #3c4043;
  color: var(--ink);
  font-size: 15px;
}
.priority-remind button[aria-pressed="true"] { background: var(--accent); color: #1c1e22; }
.priority-add input:first-child { flex: none; width: 64px; text-align: center; }
.priority-item { align-items: center; }
.priority-item input {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}
.priority-item input:first-child { flex: none; width: 52px; min-height: 36px; text-align: center; font-size: 18px; }
.priority-board .empty { grid-column: 1 / -1; }
#view-priorities input { font-size: 16px; }

#view-folder .folder-title {
  justify-content: flex-start;
  min-width: 0;
}

#view-folder .folder-title h1 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 28px;
}

.folder-actions { margin-top: 22px; }

.plan-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
}

.plan-switch button {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 15px;
}

.plan-switch button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.plan-day {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 17px;
  font-weight: 650;
}

.plan-day span:first-child { flex: 1; min-width: 0; }

.plan-subhead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-restore {
  flex: none;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

#plan-body,
.plan-node,
.plan-children,
.plan-day { min-width: 0; }

.plan-children {
  margin: 0 0 2px 16px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

#view-plan .culture-lead { margin-bottom: 10px; font-size: 14px; }

#view-plan .plan-switch,
#view-culture .plan-switch { margin-bottom: 10px; }

#view-plan .plan-switch button,
#view-culture .plan-switch button {
  min-height: 36px;
  font-size: 14px;
}

#view-plan > .mini-add { margin-bottom: 4px; }

#view-plan > .mini-add input,
#view-plan > .mini-add .primary {
  min-height: 36px;
  font-size: 16px;
}

#view-plan input {
  font-size: 16px;
}

#view-plan .skill-block { margin-top: 2px; padding-top: 6px; }

#view-plan .section-title {
  min-height: 32px;
  font-size: 17px;
}

#view-plan .plan-row { padding: 0; gap: 4px; }

#view-plan .plan-row .line-input { min-height: 32px; }

#view-plan .plan-row .task-check {
  width: 22px;
  height: 22px;
}

#view-plan .plan-row .task-check .ico { width: 12px; height: 12px; }

#view-plan .plan-row .note-more {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  margin-right: 0;
}

#view-plan .plan-row .note-more .ico { width: 16px; height: 16px; }


.plan-add {
  min-height: 32px;
  margin-top: 2px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

.plan-task-form { display: grid; gap: 8px; margin: 4px 0 12px; }
.plan-task-form .mini-add { margin: 0; }
.plan-task-form .priority-scale { margin: 0; }

#view-plan .plan-compose input { min-height: 36px; }

.plan-count {
  flex: none;
  color: var(--muted);
  font-size: 14px;
}

#mix-roll { flex: none; white-space: nowrap; }

.mix-pick {
  margin: 0 0 18px;
  padding: 12px 12px 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.mix-kicker { margin: 0 2px 2px; color: var(--muted); font-size: 13px; }

.mix-pick .task { border-bottom: 0; }

.mix-gap { width: 28px; flex: none; }

.mix-open {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

#mix-list { min-width: 0; }

.mix-row { min-width: 0; overflow: hidden; }

.mix-row .task-body { min-width: 0; cursor: pointer; }

.mix-row .task-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.culture-lead { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

.goal-kinds { grid-template-columns: 1fr; }

.skill-row { min-height: 64px; }

.skill-name {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.mini-add {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}

.mini-add input,
.task-add input,
.step-add input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-deep);
  padding: 0 12px;
  font-size: 16px;
}

.skill-block { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.skill-head { display: flex; align-items: center; gap: 8px; }

.section-title {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.skill-task,
.skill-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.skill-task { padding: 8px 0 2px; }

.line-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 16px;
}

.skill-steps { margin: 2px 0 8px 36px; display: grid; gap: 4px; }

.step-check {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid #8e949d;
  background: transparent;
  color: #173324;
  display: grid;
  place-items: center;
  padding: 0;
}

.step-check[aria-pressed="true"] {
  background: #3cbf7a;
  border-color: #3cbf7a;
}

.step-check .ico { width: 12px; height: 12px; }

.skill-step .line-input { font-size: 16px; min-height: 36px; color: #d5d8de; }

.task-add,
.step-add { margin: 6px 0 0; }

.step-add { margin-left: 36px; }

.culture-mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  color: #f0a3c4;
}
.culture-mark .ico { width: 20px; height: 20px; }
.culture-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.culture-edit {
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.culture-edit .ico { width: 16px; height: 16px; }
.culture-shelf-fields { flex: 1; min-width: 0; display: grid; gap: 8px; }
.culture-shelf-form,
.culture-edit-form { align-items: flex-start; }
.culture-shelf-fields input,
.culture-edit-form input { font-size: 16px; }
.culture-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.culture-icons button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: #3c4043;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
}
.culture-icons button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.culture-icons .ico { width: 16px; height: 16px; }
.culture-item-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}
.culture-item-card {
  flex: 1;
  min-width: 0;
  display: grid;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-deep);
}
.culture-item-card input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--ink);
  font-size: 16px;
}
.culture-item-card input + input { border-top: 1px solid rgba(255, 255, 255, 0.08); }
#view-culture .culture-item:last-child { border-bottom: 0; }
.culture-link {
  display: block;
  max-width: 100%;
  margin: 3px 0 0;
  overflow: hidden;
  color: #8eb4e8;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-delete {
  margin-top: 28px;
  color: #f0b4b4;
}

.done-line-text { text-decoration: line-through; opacity: 0.45; }

.idea-take {
  width: 100%;
  min-height: 52px;
  margin: 0 0 18px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #3c4043;
  color: #a7adb6;
  text-align: left;
  font-size: 16px;
}

.idea-label {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.idea-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -6px 0 14px;
  overflow: hidden;
  scrollbar-width: none;
}

.idea-filters::-webkit-scrollbar { display: none; }

.idea-filters button,
.idea-pick {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #3c4043;
  color: var(--ink);
  font-size: 14px;
}

.idea-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.idea-filters button[aria-pressed="true"],
.idea-pick[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.idea-filters .idea-label-actions {
  flex: 1 0 100%;
  display: flex;
  gap: 8px;
}
.idea-filters .idea-label-actions button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.idea-filters .idea-label-actions button.danger { color: #e15d5d; }
.idea-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.idea-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.idea-card {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  color: #f4f5f7;
}

.idea-open {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 72px;
  padding: 12px 36px 12px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  overflow: hidden;
}

.idea-title,
.idea-text,
.idea-chip-name {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.idea-title {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.idea-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  white-space: pre-wrap;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.idea-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-width: 0;
}

.idea-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 650;
}

.idea-chip .ico { width: 14px; height: 14px; flex: none; }

.idea-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-pin {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(244, 245, 247, 0.7);
}

.idea-pin[aria-pressed="true"] { color: #fff; }
.idea-pin .ico { width: 18px; height: 18px; }

#idea-dialog {
  width: min(600px, calc(100vw - 24px));
  background: transparent;
}

.idea-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(78dvh, 680px);
  padding: 16px 16px 12px;
  border-radius: 12px;
  overflow: auto;
}

.idea-sheet input,
.idea-sheet textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: #f4f5f7;
}

.idea-sheet input {
  min-height: 36px;
  font-size: 20px;
  font-weight: 700;
}

.idea-sheet textarea {
  min-height: 140px;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
}

.idea-sheet input::placeholder,
.idea-sheet textarea::placeholder { color: rgba(244, 245, 247, 0.55); }

.idea-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.idea-colors button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
}

.idea-colors button[aria-checked="true"] {
  border-color: #f4f5f7;
}

.idea-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.idea-tools-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.idea-tools-row .primary { margin-left: auto; }

.idea-tool {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f5f7;
}

#idea-delete {
  background: transparent;
  color: #f0b4b4;
}

@media (min-width: 720px) {
  .idea-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1040px) {
  .idea-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.plus-btn,
.plus-inline,
.plan-plus {
  --plus-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231c1e22' d='M7.25 2h1.5v5.25H14v1.5H8.75V14h-1.5V8.75H2v-1.5h4.25z'/%3E%3C/svg%3E");
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  align-self: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: var(--plus-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.plus-btn { width: 26px; height: 26px; min-width: 26px; min-height: 26px; background-size: 12px 12px; }

.idea-filters button.plus-inline,
.idea-pick.plus-inline {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: var(--plus-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  color: transparent;
  font-size: 0;
}

.plan-plus {
  border: 1px solid var(--line);
  background-color: transparent;
  --plus-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23a7adb6' d='M7.25 2h1.5v5.25H14v1.5H8.75V14h-1.5V8.75H2v-1.5h4.25z'/%3E%3C/svg%3E");
  background-image: var(--plus-icon);
}

.task-group { margin-top: 20px; }
.task-group h2,
.panel-head h2 { margin: 0; }

.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.task-body { flex: 1; min-width: 0; }
.task-text { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.task-when { margin: 3px 0 0; color: #8e949d; font-size: 14px; font-weight: 400; }
.task-done .task-text { text-decoration: line-through; opacity: 0.45; }
.task-done .task-when { opacity: 0.45; }

.task-wrap > .task { border-bottom: 0; padding-bottom: 8px; }
.subtasks,
.subtask-form { margin: 0 0 8px 38px; }
.subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
}
.subtask .task-check,
.subtask .plus-inline { width: 22px; height: 22px; min-width: 22px; min-height: 22px; }
.subtask .task-check .ico { width: 12px; height: 12px; }
.subtask .line-input { min-height: 36px; }
button.priority-badge { border: 0; font-size: 14px; font-weight: 700; }
.plan-scale { margin: 0 0 10px; }
#view-plan .plan-node { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
#view-plan .plan-children .plan-node { border-bottom: 0; }
#view-plan .plan-node > .task { border-bottom: 0; padding-top: 8px; padding-bottom: 6px; }
#view-plan .task-edit { min-height: 28px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
#view-plan .plan-children { margin-top: 0; margin-bottom: 6px; }

.task-check {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1.75px solid #8e949d;
  background: transparent;
  color: #173324;
  display: grid;
  place-items: center;
  padding: 0;
}

.task-check[aria-pressed="true"] {
  background: #3cbf7a;
  border-color: #3cbf7a;
}

.task-check .ico { width: 16px; height: 16px; }

.priority-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.priority-scale button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
}

.priority-scale button[aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f3f4f6;
}

.priority-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
}

.priority-color {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

#priority-color {
  appearance: auto;
  -webkit-appearance: auto;
  width: 42px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.priority-badge {
  flex: none;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.task-done .priority-badge { opacity: 0.45; }

.kind-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.kind-switch button {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--ink);
}

.kind-switch button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

#task-remind-field[hidden] { display: none !important; }

#task-remind {
  min-height: 48px;
  border-radius: 14px;
  background: var(--bg-deep);
  padding: 0 12px;
  font-size: 16px;
}

.note {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0 11px;
}

.note:last-child { border-bottom: 0; }

.note-open {
  display: block;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  overflow: hidden;
}

.note-title {
  display: block;
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-sub {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #8e949d;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.note-date { flex: none; }

.note-snip {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#note-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  background: var(--bg);
}

#note-dialog::backdrop { background: var(--bg); }

.note-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(8px + var(--safe-top)) 16px calc(12px + var(--safe-bottom));
}

.note-page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.note-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
}

.note-back .ico { width: 22px; height: 22px; }

.note-screen .meta { margin: 0 0 12px; }

.note-editor {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  padding: 0;
  font-size: 17px;
  line-height: 1.45;
}

.note-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.note-head .note-title { flex: 1; min-width: 0; }

.note-more {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin-right: -8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.note-more .ico { width: 22px; height: 22px; }

.note-menu {
  position: fixed;
  z-index: 40;
  width: max-content;
  max-width: calc(100vw - 24px);
  height: auto;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #3e434b;
  color: var(--ink);
  display: grid;
}

.note-menu button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.note-actions { margin-top: 2px; flex-wrap: wrap; }

.note-actions .meta { margin-right: 4px; }

.note-actions button, .text-btn {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
}

.note-actions button:active,
.note-actions button:focus {
  background: transparent;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .note-actions button:hover,
  .text-btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
  }
}

#login-dialog { width: min(360px, calc(100vw - 32px)); }
#login-dialog .sheet { border-radius: 20px; padding: 20px; }
#login-password {
  width: 100%;
  min-height: 44px;
  margin: 0 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-deep);
  padding: 0 12px;
  font-size: 16px;
}
.login-error { margin: 0 0 12px; color: #f0a3a3; font-size: 14px; }
#confirm-dialog { width: min(360px, calc(100vw - 32px)); }

#confirm-dialog .sheet {
  border-radius: 20px;
  padding: 20px;
}

.confirm-text {
  margin: 0 0 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 30dvh;
  overflow: auto;
}

.label-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.label-row strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--mark, var(--ink));
  background: rgba(255, 255, 255, 0.06);
  background: color-mix(in srgb, var(--mark, #e7e9ed) 22%, transparent);
}

.ico { width: 18px; height: 18px; display: block; }

.chevron { color: var(--muted); font-size: 20px; line-height: 1; }

.empty { margin: 2px 2px 6px; }

.foot { margin-top: 18px; }
.foot p { margin: 0 0 8px; }

.transfer summary { cursor: pointer; }
.transfer-row { margin-top: 10px; justify-content: flex-start; }

.file-btn { display: inline-grid; place-items: center; }

dialog {
  width: min(520px, 100vw);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

.sheet {
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  border-radius: 0;
  overflow: auto;
}

.sheet-head { margin-bottom: 14px; }

.bar {
  height: 3px;
  border-radius: 99px;
  background: var(--bg-deep);
  overflow: hidden;
  margin-bottom: 14px;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.sort-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sort-note {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.label-pick { display: grid; gap: 8px; }

.label-pick button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-deep);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  font-weight: 600;
}

.sort-moves {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sort-moves .text-btn:disabled { opacity: 0.35; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { margin: 0 0 8px; }
.field input {
  min-height: 48px;
  border-radius: 14px;
  background: var(--bg-deep);
  padding: 0 12px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.icon-grid button {
  aspect-ratio: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--bg-deep);
  color: var(--ink);
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-grid button[aria-checked="true"] {
  border-color: #f4f5f7;
  background: #3e434b;
}

.icon-grid .ico { width: 22px; height: 22px; }

.colors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.colors button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}

.colors button[aria-checked="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
}

.done { padding: 18px 0 4px; }

.done-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.done-check {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #3cbf7a;
  color: #173324;
  display: grid;
  place-items: center;
}

.done-check .ico { width: 16px; height: 16px; }

.done-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 44px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  z-index: 30;
  white-space: nowrap;
}

.toast:has(button) { padding: 4px 5px 4px 16px; }

.toast[hidden] { display: none !important; }

.toast span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
}

.toast button {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #1c1e22;
  color: #f4f5f7;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.edit-box {
  width: 100%;
  min-height: 74px;
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


@media (min-width: 860px) {
  .app { padding: 36px 24px 32px; }
  .columns { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  dialog { max-height: min(820px, calc(100dvh - 48px)); }
  #note-dialog { max-height: none; height: 100dvh; }
  .sheet {
    border-radius: 20px;
    max-height: min(820px, calc(100dvh - 48px));
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .hint { display: none; }
  #save-note { width: 100%; }
}
