:root {
  color-scheme: light;
  --page: #f4f6f1;
  --surface: #ffffff;
  --surface-muted: #fafbf8;
  --ink: #1d211d;
  --muted: #6c736b;
  --line: #dce1d9;
  --green: #276749;
  --green-dark: #1d4e39;
  --green-soft: #e1eee5;
  --coral: #e36951;
  --danger: #b63e35;
  --shadow: 0 20px 60px rgba(32, 42, 34, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(39, 103, 73, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 103, 73, 0.03) 1px, transparent 1px),
    var(--page);
  background-size: 32px 32px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(227, 105, 81, 0.28);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

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

.app-frame {
  width: min(1440px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  display: grid;
  height: 62px;
  padding: 0 22px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 4px solid var(--green);
  border-right-color: var(--coral);
  border-radius: 50%;
  transform: rotate(-35deg);
}

.brand-name {
  font-size: 17px;
  white-space: nowrap;
}

.view-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f2f4ef;
}

.view-button {
  display: flex;
  min-width: 100px;
  height: 34px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.view-button + .view-button {
  border-left: 1px solid var(--line);
}

.view-button.active {
  color: var(--green-dark);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(22, 38, 27, 0.08);
  font-weight: 700;
}

.view-button svg {
  width: 15px;
  height: 15px;
}

.brand-help-button {
  min-width: 0;
  height: 26px;
  margin-left: 3px;
  padding: 0 8px;
  gap: 5px;
  border: 1px solid #d5d9d3;
  border-radius: 5px;
  color: #7d847c;
  background: #f2f3f0;
  font-size: 11px;
  font-weight: 620;
}

.brand-help-button:hover {
  border-color: #c4c9c2;
  color: #555d55;
  background: #e9ebe7;
}

.brand-help-button.active {
  border-color: #bec4bc;
  color: #4f574f;
  background: #e4e7e2;
  box-shadow: none;
  font-weight: 680;
}

.brand-help-button svg {
  width: 13px;
  height: 13px;
}

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

.header-sound-toggle {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
}

.language-toggle {
  display: inline-flex;
  height: 34px;
  padding: 0 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.language-toggle:hover {
  border-color: #b6c0b4;
  background: #f3f5f0;
}

.language-toggle svg {
  width: 15px;
  height: 15px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.help-page {
  min-height: calc(100vh - 96px);
  padding: 44px clamp(24px, 5vw, 72px) 36px;
  background: var(--surface-muted);
}

.help-hero {
  display: flex;
  max-width: 1240px;
  margin: 0 auto 28px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.help-hero-copy {
  max-width: 850px;
}

.help-hero h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.12;
}

.help-hero h1 span {
  display: block;
}

.help-problem-copy {
  max-width: 720px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.help-purpose-statement {
  margin-bottom: 0;
  padding: 9px 0 9px 14px;
  border-left: 3px solid var(--coral);
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.5;
}

.help-method {
  display: grid;
  max-width: 1240px;
  margin: 0 auto 34px;
  padding: 28px 0;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.6fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.help-method-heading h2,
.help-steps-heading h2 {
  margin-bottom: 10px;
  font-size: 23px;
  line-height: 1.35;
}

.help-method-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.help-method-flow {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
}

.help-method-flow li {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 12px 10px;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 720;
  text-align: center;
}

.help-method-flow li:not(:last-child)::after {
  position: absolute;
  top: 25px;
  right: -5px;
  color: #aeb5ac;
  content: "→";
  font-size: 15px;
}

.help-method-flow svg {
  width: 26px;
  height: 26px;
  padding: 5px;
  border: 1px solid #cbd8ce;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.help-steps-heading {
  max-width: 1240px;
  margin: 0 auto 16px;
}

.help-steps-heading h2 {
  margin-bottom: 0;
}

.help-steps {
  display: grid;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
}

.help-step {
  display: flex;
  min-height: 340px;
  padding: 22px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 7px;
  background: var(--surface);
}

.help-step:nth-child(2) {
  border-top-color: #d59b32;
}

.help-step:nth-child(3) {
  border-top-color: #3e7298;
}

.help-step:nth-child(4) {
  border-top-color: var(--coral);
}

.help-step-number {
  align-self: flex-end;
  color: #a7aea6;
  font-size: 12px;
  font-weight: 780;
}

.help-step-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 10px 0 24px;
  place-items: center;
  border: 1px solid #cbd8ce;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
}

.help-step:nth-child(2) .help-step-icon {
  border-color: #ead6ae;
  color: #8b621e;
  background: #fbf3df;
}

.help-step:nth-child(3) .help-step-icon {
  border-color: #c5d8e5;
  color: #315f80;
  background: #e8f1f6;
}

.help-step:nth-child(4) .help-step-icon {
  border-color: #efc7bf;
  color: #a74d3b;
  background: #fae9e5;
}

.help-step-icon svg {
  width: 20px;
  height: 20px;
}

.help-step-copy {
  flex: 1;
}

.help-step-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.help-step h2 {
  margin-bottom: 12px;
  font-size: 19px;
  line-height: 1.35;
}

.help-step-copy > p:last-child {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.help-link {
  display: inline-flex;
  min-height: 36px;
  padding: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--green-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.help-link:hover {
  color: var(--coral);
}

.help-link svg {
  width: 15px;
  height: 15px;
}

.help-footer {
  display: flex;
  max-width: 1240px;
  margin: 22px auto 0;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.help-footer > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.help-footer strong {
  font-size: 15px;
}

.help-footer span {
  color: var(--muted);
  font-size: 12px;
}

.help-footer .primary-button span {
  color: inherit;
  font-size: inherit;
}

.calendar-layout,
.focus-layout {
  display: grid;
  min-height: calc(100vh - 96px);
  grid-template-columns: minmax(0, 1fr) 360px;
}

.calendar-main,
.focus-main {
  min-width: 0;
}

.calendar-toolbar {
  display: flex;
  height: 84px;
  padding: 0 22px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.calendar-toolbar h1 {
  margin-bottom: 5px;
  font-size: 26px;
  line-height: 1.15;
}

.calendar-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.month-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  border-color: #b6c0b4;
  background: #f3f5f0;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.primary-icon {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.primary-icon:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.secondary-button,
.primary-button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-weight: 680;
  cursor: pointer;
}

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

.secondary-button:hover:not(:disabled) {
  border-color: #b6c0b4;
  background: #f3f5f0;
}

.primary-button {
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.primary-button svg,
.secondary-button svg {
  width: 16px;
  height: 16px;
}

.primary-button.compact {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 13px;
}

.today-button {
  padding-right: 14px;
  padding-left: 14px;
  font-size: 13px;
}

.weekday-row {
  display: grid;
  height: 36px;
  padding: 0 22px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fafbf8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.calendar-grid {
  display: grid;
  height: calc(100vh - 217px);
  min-height: 540px;
  margin: 0 22px 18px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(82px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.calendar-day {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  z-index: 1;
  box-shadow: inset 0 0 0 1px #a9b8aa;
}

.calendar-day.selected {
  z-index: 2;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-day.outside {
  opacity: 0.52;
}

.day-top {
  display: flex;
  width: 100%;
  flex: 0 0 26px;
  min-height: 26px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.day-number {
  display: inline-grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}

.day-note-input {
  height: 25px;
  min-width: 0;
  padding: 0 5px;
  flex: 1;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  font-weight: 650;
  line-height: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.calendar-day:hover .day-note-input,
.day-note-input:focus {
  border-color: #c5ccc2;
  background: rgba(255, 255, 255, 0.72);
}

.day-note-input:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(39, 103, 73, 0.1);
}

.calendar-day.today .day-number {
  color: #fff;
  background: var(--green);
}

.day-minutes {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.day-minutes svg {
  width: 11px;
  height: 11px;
}

.day-task-scroll {
  width: 100%;
  min-height: 0;
  padding-top: 2px;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: transparent transparent;
  scrollbar-width: none;
}

.day-task-scroll::-webkit-scrollbar {
  width: 0;
}

.calendar-day:hover .day-task-scroll,
.calendar-day:focus-visible .day-task-scroll {
  scrollbar-color: #aeb8ac transparent;
  scrollbar-width: thin;
}

.calendar-day:hover .day-task-scroll::-webkit-scrollbar,
.calendar-day:focus-visible .day-task-scroll::-webkit-scrollbar {
  width: 7px;
}

.day-task-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 6px;
  background: #aeb8ac;
  background-clip: padding-box;
}

.day-task-preview {
  display: flex;
  min-width: 0;
  padding: 2px 0;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.5;
}

.day-task-preview.completed {
  color: var(--muted);
  text-decoration: line-through;
}

.task-dot {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.day-task-preview.completed .task-dot {
  background: var(--green);
}

.day-task-preview span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-tasks {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.day-panel,
.focus-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface-muted);
}

.day-panel {
  --day-task-section-height: 310px;
}

.day-header {
  padding: 24px 22px 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 760;
}

.day-header h2,
.focus-side h2 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.35;
}

.day-stats,
.focus-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.day-stats span,
.focus-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.day-stats svg,
.focus-summary svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.add-task-form {
  display: grid;
  padding: 18px 18px 10px;
  grid-template-columns: 1fr 38px;
  gap: 8px;
}

input,
select,
textarea {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

input,
select {
  height: 38px;
}

textarea {
  padding-top: 9px;
  padding-bottom: 9px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 103, 73, 0.1);
  outline: 0;
}

.project-entry {
  margin: 0 18px 12px;
}

.panel-section {
  min-height: 0;
  border-top: 1px solid var(--line);
}

.task-section {
  display: flex;
  height: var(--day-task-section-height);
  flex: 0 0 var(--day-task-section-height);
  flex-direction: column;
  overflow: hidden;
}

.records-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border-top: 0;
}

.day-panel .task-list,
.day-panel .record-list,
.day-panel .empty-state {
  min-height: 0;
  max-height: none;
  flex: 1;
}

.day-list-splitter {
  position: relative;
  height: 13px;
  flex: 0 0 13px;
  cursor: row-resize;
  touch-action: none;
}

.day-list-splitter::before {
  position: absolute;
  top: 5px;
  right: 18px;
  left: 18px;
  height: 3px;
  border-radius: 2px;
  background: #c8cec5;
  content: "";
  transition: background-color 140ms ease;
}

.day-list-splitter:hover::before,
.day-list-splitter:focus-visible::before,
.day-list-splitter.dragging::before {
  background: var(--green);
}

.day-list-splitter:focus-visible {
  outline: 3px solid rgba(227, 105, 81, 0.28);
  outline-offset: -2px;
}

.section-title {
  display: flex;
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
}

.section-title h3 {
  margin-bottom: 0;
  font-size: 13px;
}

.section-title > span {
  color: var(--muted);
  font-size: 11px;
}

.task-list,
.record-list {
  margin: 0;
  padding: 0 18px;
  overflow-y: auto;
  list-style: none;
}

.task-list {
  max-height: 255px;
}

.task-item,
.record-item {
  display: grid;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.task-item {
  grid-template-columns: 26px minmax(0, 1fr) 28px 28px;
  gap: 5px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.task-item:hover {
  background: #f7f9f5;
}

.task-check,
.task-action {
  display: inline-grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.task-check:hover,
.task-action:hover {
  background: #edf1ea;
}

.task-check svg,
.task-action svg {
  width: 16px;
  height: 16px;
}

.task-action.play {
  color: var(--green);
}

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

.task-copy {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 12px;
  font-weight: 580;
  text-align: left;
  cursor: pointer;
}

.segment-panel {
  display: grid;
  padding: 4px 0 10px 31px;
  grid-column: 1 / -1;
  gap: 8px;
}

.segment-open-button {
  display: inline-flex;
  width: fit-content;
  padding: 4px 0;
  align-items: center;
  gap: 6px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.segment-open-button svg,
.segment-select svg {
  width: 14px;
  height: 14px;
}

.segment-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.segment-setup-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.segment-setup label,
.segment-minutes {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.segment-setup input,
.segment-minutes input {
  width: 54px;
  height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.segment-summary-copy {
  display: flex;
  margin-bottom: 6px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}

.segment-summary-copy span {
  color: var(--muted);
}

.segment-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5e9e2;
}

.segment-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.segment-list {
  display: grid;
  gap: 5px;
}

.segment-row {
  display: grid;
  min-height: 32px;
  grid-template-columns: minmax(82px, 1fr) auto 64px 30px;
  align-items: center;
  gap: 6px;
}

.segment-row.read-only {
  grid-template-columns: minmax(82px, 1fr) auto 64px;
}

.segment-row.read-only .segment-minutes input {
  opacity: 0.72;
}

.segment-row.completed {
  opacity: 0.68;
}

.segment-select {
  display: inline-flex;
  min-width: 0;
  padding: 4px;
  align-items: center;
  gap: 5px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.segment-actual {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.segment-delete {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segment-delete:hover:not(:disabled) {
  color: var(--danger);
  background: #fff0ed;
}

.segment-delete svg {
  width: 14px;
  height: 14px;
}

.segment-add-button {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  padding: 5px 8px;
  align-items: center;
  gap: 6px;
  border: 1px dashed #b8c3b7;
  border-radius: 5px;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.segment-add-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.segment-add-button svg {
  width: 14px;
  height: 14px;
}

.segment-footer-actions,
.segment-confirmed-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.segment-confirmed-summary {
  min-height: 38px;
}

.segment-confirmed-summary > div {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.segment-confirmed-summary > div svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.segment-confirmed-summary > div strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.segment-confirmed-summary .secondary-button {
  flex: 0 0 auto;
}

.segment-confirm-button {
  flex: 0 0 auto;
}

.task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 560;
}

.task-segment-summary {
  margin-top: 3px;
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.task-item.completed .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.record-item {
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 8px 0;
}

.record-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.record-icon svg {
  width: 14px;
  height: 14px;
}

.record-copy {
  min-width: 0;
}

.record-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-copy span,
.record-duration {
  color: var(--muted);
  font-size: 10px;
}

.record-duration {
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 100px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 20px;
  height: 20px;
  margin-bottom: 7px;
  color: var(--green);
}

.empty-state p {
  margin-bottom: 0;
  font-size: 11px;
}

.focus-layout {
  grid-template-columns: minmax(620px, 1fr) 320px;
}

.focus-main {
  display: flex;
  min-height: calc(100vh - 96px);
  padding: 30px 40px 32px;
  flex-direction: column;
}

.back-button {
  display: inline-flex;
  width: fit-content;
  padding: 4px 0;
  align-items: center;
  gap: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.back-button:hover {
  color: var(--green);
}

.back-button svg {
  width: 16px;
  height: 16px;
}

.focus-heading {
  display: flex;
  margin-top: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.focus-heading h1 {
  margin-bottom: 0;
  font-size: 27px;
}

.focus-form {
  margin-top: 24px;
}

.focus-segment-workspace {
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.focus-segment-workspace.compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.focus-segment-workspace.compact .focus-segment-heading {
  margin: 0;
  grid-column: 2;
  grid-row: 1;
}

.focus-segment-workspace.compact .focus-segment-heading div {
  display: none;
}

.focus-segment-workspace.compact .focus-segment-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.focus-segment-workspace.compact #focusSegmentContent {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.focus-segment-workspace.compact .segment-panel {
  display: block;
}

.focus-segment-workspace.compact .segment-open-button {
  padding: 5px 0;
  font-size: 13px;
}

.focus-segment-heading {
  display: flex;
  margin-bottom: 10px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.focus-segment-heading div > span,
.focus-segment-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.focus-segment-heading div > span {
  font-size: 12px;
  font-weight: 700;
}

.focus-segment-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.focus-segment-workspace .segment-panel {
  padding: 0;
}

.focus-segment-workspace .segment-list {
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.segment-allocation {
  margin-bottom: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--coral);
  background: #fff7f4;
  color: #7f3d31;
  font-size: 12px;
  font-weight: 700;
}

.focus-segment-workspace .segment-open-button {
  font-size: 12px;
}

.focus-segment-workspace .segment-setup label,
.focus-segment-workspace .segment-minutes,
.focus-segment-workspace .segment-summary-copy,
.focus-segment-workspace .segment-select {
  font-size: 11px;
}

.focus-segment-workspace .segment-setup .primary-button,
.focus-segment-workspace .segment-setup .secondary-button {
  font-size: 12px;
}

.segment-allocation.complete {
  border-left-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.segment-allocation.over {
  border-left-color: var(--danger);
  color: var(--danger);
}

.focus-form label > span,
.duration-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.focus-form > label input {
  width: 100%;
}

.focus-form-row {
  display: grid;
  margin-top: 16px;
  grid-template-columns: minmax(150px, 0.6fr) minmax(350px, 1.4fr);
  gap: 18px;
}

.focus-create-actions {
  display: flex;
  margin-top: 14px;
  justify-content: flex-end;
}

.focus-create-actions .primary-button {
  min-width: 128px;
}

.date-field input {
  width: 100%;
}

.duration-options {
  display: grid;
  grid-template-columns: repeat(3, 46px) minmax(120px, 1fr);
  gap: 7px;
}

.duration-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.duration-button.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 700;
}

.custom-duration {
  display: flex;
  overflow: hidden;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.custom-duration:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 103, 73, 0.1);
}

.custom-duration input {
  width: 100%;
  height: 36px;
  border: 0;
  box-shadow: none;
}

.custom-duration span {
  padding-right: 10px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.timer-stage {
  display: grid;
  min-height: 304px;
  flex: 1;
  place-items: center;
}

.timer-ring {
  position: relative;
  display: grid;
  width: 270px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), #e6eae3 0);
}

.timer-ring::before {
  position: absolute;
  width: calc(100% - 18px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.timer-face {
  position: relative;
  z-index: 1;
  display: flex;
  width: 76%;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.focus-countdown {
  position: absolute;
  z-index: 2;
  display: grid;
  width: calc(100% - 18px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--green-dark);
  pointer-events: none;
}

.focus-countdown span {
  font-size: 96px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.focus-countdown span.animate {
  animation: focus-countdown-step 700ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes focus-countdown-step {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  24% {
    opacity: 1;
    transform: scale(1);
  }

  76% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

.timer-status {
  color: var(--green);
  font-size: 12px;
  font-weight: 730;
}

#timerDisplay {
  margin-top: 7px;
  font-size: 59px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  line-height: 1.1;
}

.timer-task {
  min-height: 36px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.timer-actions {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) minmax(150px, 1fr) 38px;
  gap: 9px;
}

.cycle-prompt {
  display: flex;
  margin-bottom: 14px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #b9cfbf;
  border-radius: 6px;
  background: var(--green-soft);
}

.cycle-prompt strong,
.cycle-prompt span {
  display: block;
}

.cycle-prompt strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.cycle-prompt span {
  color: var(--muted);
  font-size: 10px;
}

.cycle-prompt-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.cycle-prompt-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 10px;
}

.focus-side {
  --focus-task-section-height: 300px;
  padding: 28px 24px;
}

.focus-summary {
  padding-bottom: 4px;
}

.focus-add-task {
  padding: 18px 0 14px;
}

.focus-side-section {
  min-height: 0;
  margin: 0 -24px;
  border-top: 1px solid var(--line);
}

.focus-task-section {
  display: flex;
  height: var(--focus-task-section-height);
  flex: 0 0 var(--focus-task-section-height);
  flex-direction: column;
  overflow: hidden;
}

.focus-list-splitter {
  position: relative;
  height: 13px;
  margin: 0 -24px;
  flex: 0 0 13px;
  cursor: row-resize;
  touch-action: none;
}

.focus-list-splitter::before {
  position: absolute;
  top: 5px;
  right: 24px;
  left: 24px;
  height: 3px;
  border-radius: 2px;
  background: #c8cec5;
  content: "";
  transition: background-color 140ms ease;
}

.focus-list-splitter:hover::before,
.focus-list-splitter:focus-visible::before,
.focus-list-splitter.dragging::before {
  background: var(--green);
}

.focus-list-splitter:focus-visible {
  outline: 3px solid rgba(227, 105, 81, 0.28);
  outline-offset: -2px;
}

.focus-records-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border-top: 0;
}

.focus-section-title,
.focus-record-title {
  padding-right: 24px;
  padding-left: 24px;
}

.focus-task-list {
  max-height: none;
  padding-right: 24px;
  padding-left: 24px;
  flex: 1;
}

.focus-task-empty {
  min-height: 0;
  flex: 1;
}

.focus-record-title {
  padding-top: 12px;
  padding-bottom: 8px;
}

.focus-side .record-list {
  padding-right: 24px;
  padding-left: 24px;
  flex: 1;
}

.task-item.newly-added {
  background: #e1eee5;
  box-shadow: inset 3px 0 0 var(--green);
  animation: new-task-highlight 1.8s ease-out;
}

@keyframes new-task-highlight {
  0%,
  45% {
    background: #d2e7d8;
  }

  100% {
    background: transparent;
  }
}

.focus-empty {
  flex: 1;
}

.running-pill {
  display: flex;
  max-width: 260px;
  height: 36px;
  padding: 0 12px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.running-pill strong {
  font-variant-numeric: tabular-nums;
}

.running-pill span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.running-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}

.projects-layout {
  display: grid;
  min-height: calc(100vh - 96px);
  grid-template-columns: minmax(0, 1fr) 340px;
}

.projects-main {
  min-width: 0;
  padding: 30px 34px 40px;
}

.projects-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.projects-heading-actions {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: 12px;
}

.projects-heading h1 {
  margin-bottom: 7px;
  font-size: 28px;
}

.projects-heading > div > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.project-summary {
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

.project-summary b {
  color: var(--ink);
  font-size: 18px;
}

.goal-view-switcher {
  display: grid;
  padding: 3px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f3ef;
}

.goal-view-switcher button {
  display: inline-flex;
  min-width: 112px;
  height: 31px;
  padding: 0 11px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
}

.goal-view-switcher button:hover {
  color: var(--green-dark);
}

.goal-view-switcher button[aria-selected="true"] {
  color: var(--green-dark);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(22, 38, 27, 0.1);
}

.goal-view-switcher svg {
  width: 14px;
  height: 14px;
}

.project-create-form {
  display: grid;
  margin-top: 26px;
  padding-bottom: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.project-tree {
  padding-top: 18px;
}

.goal-view-panel[hidden] {
  display: none;
}

.goal-map-panel {
  padding-top: 14px;
}

.goal-map-toolbar {
  display: flex;
  min-height: 38px;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.goal-map-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.goal-map-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.goal-map-controls .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.goal-map-viewport {
  position: relative;
  height: max(520px, calc(100vh - 306px));
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #fafcf9;
  background-image: radial-gradient(#d4dbd2 1px, transparent 1px);
  background-size: 20px 20px;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
}

.goal-map-viewport.dragging {
  cursor: grabbing;
  user-select: none;
}

.goal-map-viewport:focus-visible {
  outline: 3px solid rgba(227, 105, 81, 0.28);
  outline-offset: 2px;
}

.goal-map-scene {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.goal-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.goal-map-connections,
.goal-map-nodes {
  position: absolute;
  inset: 0;
}

.goal-map-connections {
  overflow: visible;
  pointer-events: none;
}

.goal-map-connections path {
  fill: none;
  stroke: #acb8aa;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.goal-map-node {
  position: absolute;
  display: grid;
  width: 220px;
  height: 58px;
  padding: 6px 7px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  border: 1px solid #ccd5ca;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(32, 42, 34, 0.08);
}

.goal-map-node.root {
  border-color: #9fbaa7;
  background: #f1f7f2;
}

.goal-map-node.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(39, 103, 73, 0.13), 0 9px 22px rgba(32, 42, 34, 0.1);
}

.goal-map-node-main {
  display: flex;
  min-width: 0;
  height: 44px;
  padding: 0 5px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.goal-map-node-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-map-node-main strong {
  font-size: 14px;
  line-height: 1.45;
}

.goal-map-meta {
  display: flex;
  width: 100%;
  min-width: 0;
  margin-top: 2px;
  align-items: center;
  gap: 5px;
}

.goal-map-deadline {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #7b5931;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-map-priority {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
}

.goal-map-node-actions {
  display: flex;
  min-height: 28px;
  justify-content: flex-end;
  gap: 2px;
}

.goal-map-node-actions .tree-icon-button {
  width: 26px;
  height: 28px;
}

.goal-map-node-actions .tree-icon-button svg {
  width: 13px;
  height: 13px;
}

.goal-map-rename-input {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 7px;
  width: calc(100% - 70px);
  height: 32px;
  padding: 0 7px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 680;
}

.goal-map-empty {
  position: absolute;
  inset: 0;
  min-height: 0;
  background: rgba(250, 252, 249, 0.88);
}

.project-node {
  --depth: 0;
  margin-left: calc(var(--depth) * 26px);
}

.project-node-row {
  display: grid;
  min-height: 50px;
  grid-template-columns: 30px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.project-node-row.selected {
  background: #f2f7f2;
  box-shadow: inset 3px 0 0 var(--green);
}

.tree-icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tree-icon-button:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.tree-icon-button:disabled {
  visibility: hidden;
}

.tree-icon-button svg {
  width: 15px;
  height: 15px;
}

.project-kind {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-soft);
}

.project-kind svg {
  width: 14px;
  height: 14px;
}

.project-node-copy {
  min-width: 0;
  padding: 3px 0;
}

.project-title-input {
  width: 100%;
  height: 26px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 680;
}

.project-title-input:hover {
  border-color: var(--line);
  background: var(--surface);
}

.project-node-meta {
  position: relative;
  top: -1px;
  display: flex;
  min-height: 14px;
  padding-left: 6px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.project-deadline {
  color: #7b5931;
  font-weight: 650;
}

.project-priority {
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.priority-low {
  color: #4c6253;
  background: #e9eee9;
}

.priority-medium {
  color: #80551e;
  background: #f7ebd7;
}

.priority-high {
  color: #9d352e;
  background: #f9e3e0;
}

.scheduled-label {
  color: var(--green-dark);
  font-weight: 650;
}

.project-node-actions {
  display: flex;
  padding-right: 8px;
  gap: 2px;
}

.tree-danger:hover {
  color: var(--danger);
  background: #f9e9e7;
}

.projects-empty,
.project-detail-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.projects-empty svg,
.project-detail-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: var(--green);
}

.projects-empty h2,
.project-detail-empty h2 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 16px;
}

.projects-empty p,
.project-detail-empty p {
  max-width: 300px;
  margin-bottom: 0;
  font-size: 11px;
  line-height: 1.6;
}

.project-detail {
  min-width: 0;
  padding: 30px 24px;
  border-left: 1px solid var(--line);
  background: var(--surface-muted);
}

.project-detail h2 {
  margin-bottom: 5px;
  font-size: 21px;
}

.project-path {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.project-fields {
  display: grid;
  margin-bottom: 16px;
  gap: 12px;
}

.project-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.project-fields label > span,
.project-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.deadline-picker {
  position: relative;
}

.deadline-picker-trigger {
  display: flex;
  width: 100%;
  height: 38px;
  padding: 0 10px 0 12px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.deadline-picker-trigger:hover,
.deadline-picker-trigger[aria-expanded="true"] {
  border-color: var(--green);
}

.deadline-picker-trigger[aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(39, 103, 73, 0.1);
}

.deadline-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-picker-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--green);
}

.deadline-picker-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: min(310px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid #cdd4ca;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(32, 42, 34, 0.18);
}

.deadline-picker-header {
  display: grid;
  margin-bottom: 9px;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 6px;
}

.deadline-picker-header strong {
  font-size: 13px;
  text-align: center;
}

.deadline-picker-nav {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
}

.deadline-picker-nav:hover {
  background: #f2f4ef;
}

.deadline-picker-nav svg {
  width: 14px;
  height: 14px;
}

.deadline-picker-weekdays,
.deadline-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.deadline-picker-weekdays {
  margin-bottom: 4px;
}

.deadline-picker-weekdays span {
  padding: 4px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  text-align: center;
}

.deadline-picker-day {
  position: relative;
  display: grid;
  height: 34px;
  min-width: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.deadline-picker-day:hover {
  background: #eef3ed;
}

.deadline-picker-day.outside {
  color: #a7ada5;
}

.deadline-picker-day.today::after {
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.deadline-picker-day.selected {
  color: #fff;
  background: var(--green);
  font-weight: 760;
}

.deadline-picker-day.selected:hover {
  background: var(--green-dark);
}

.deadline-picker-day.selected::after {
  background: #fff;
}

.deadline-picker-actions {
  display: flex;
  margin-top: 8px;
  padding-top: 9px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.deadline-picker-actions button {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}

.deadline-picker-actions button:hover {
  color: var(--coral);
}

.project-fields input,
.project-fields select,
.project-fields textarea {
  width: 100%;
}

.project-fields textarea {
  min-height: 74px;
}

.detail-add-child {
  width: 100%;
  margin-top: 20px;
}

.focus-assignment {
  margin-top: 8px;
}

.focus-toggle {
  display: flex;
  min-height: 58px;
  padding: 0 2px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.focus-toggle span {
  min-width: 0;
}

.focus-toggle strong,
.focus-toggle small {
  display: block;
}

.focus-toggle strong {
  font-size: 13px;
}

.focus-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.focus-toggle input {
  width: 40px;
  height: 22px;
  margin: 0;
  appearance: none;
  border: 1px solid #b8c0b6;
  border-radius: 11px;
  background: #dfe3dd;
  cursor: pointer;
  transition: background 150ms ease;
}

.focus-toggle input::before {
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.focus-toggle input:checked {
  border-color: var(--green);
  background: var(--green);
}

.focus-toggle input:checked::before {
  transform: translateX(18px);
}

.schedule-fields {
  display: grid;
  margin-top: 18px;
  gap: 13px;
}

.schedule-fields label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.schedule-fields input {
  width: 100%;
}

.minutes-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.minutes-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 103, 73, 0.1);
}

.minutes-input input {
  border: 0;
  box-shadow: none;
}

.minutes-input em {
  padding-right: 12px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.schedule-save {
  width: 100%;
  margin-top: 18px;
}

.project-children-section {
  margin-top: 8px;
}

.detail-section-title {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.detail-section-title h3 {
  margin-bottom: 0;
  font-size: 12px;
}

.detail-section-title span {
  color: var(--muted);
  font-size: 10px;
}

.project-children-list {
  display: grid;
}

.project-child-link {
  display: grid;
  min-width: 0;
  min-height: 54px;
  padding: 7px 4px;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-child-link:hover {
  background: #edf3ed;
}

.project-child-link > span:first-child {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-soft);
}

.project-child-link svg {
  width: 14px;
  height: 14px;
}

.project-child-link > span:nth-child(2) {
  min-width: 0;
}

.project-child-link strong,
.project-child-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-child-link strong {
  font-size: 12px;
}

.project-child-link small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.project-child-link > svg {
  color: var(--muted);
}

.project-resources {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.project-resource-list {
  display: grid;
}

.project-resource-item {
  display: grid;
  min-height: 48px;
  grid-template-columns: 26px minmax(0, 1fr) 26px 26px;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.resource-kind {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-soft);
}

.resource-kind svg,
.project-resource-item .tree-icon-button svg {
  width: 13px;
  height: 13px;
}

.resource-copy {
  min-width: 0;
}

.resource-copy strong,
.resource-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-copy strong {
  font-size: 11px;
}

.resource-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.project-resource-item .tree-icon-button {
  width: 24px;
  height: 24px;
}

.project-resource-empty {
  padding: 16px 0 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.resource-form {
  display: grid;
  margin-top: 12px;
  grid-template-columns: 88px minmax(0, 1fr) 38px;
  gap: 7px;
}

.resource-form select,
.resource-form input {
  font-size: 11px;
}

.resource-form #resourceAddressInput {
  grid-column: 1 / 3;
}

.resource-form #resourceAppSelect {
  grid-column: 2;
}

.resource-form button {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: stretch;
  height: auto;
}

.resource-form.app-mode button {
  grid-row: 1;
}

.resource-file-button {
  width: 100%;
  margin-top: 9px;
}

.resource-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.project-resource-item .tree-icon-button:disabled {
  visibility: visible;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 6px;
  color: #fff;
  background: #222720;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(28, 36, 30, 0.2);
}

.confirm-dialog::backdrop {
  background: rgba(29, 33, 29, 0.38);
}

.confirm-dialog-content {
  display: grid;
  padding: 22px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
}

.confirm-dialog-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: #fff0ed;
}

.confirm-dialog-icon svg {
  width: 18px;
  height: 18px;
}

.confirm-dialog h2 {
  margin-bottom: 7px;
  font-size: 18px;
  line-height: 1.35;
}

.confirm-dialog p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  margin-top: 6px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .app-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .calendar-layout,
  .focus-layout,
  .projects-layout {
    grid-template-columns: 1fr;
  }

  .day-panel,
  .focus-side,
  .project-detail {
    min-height: 520px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .calendar-grid {
    height: 680px;
  }

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

  .help-method {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .help-step {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .app-header {
    height: auto;
    min-height: 62px;
    padding: 12px 16px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .view-switcher {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .view-button {
    min-width: 0;
    padding: 0 5px;
    font-size: 12px;
  }

  .view-button svg {
    width: 14px;
    height: 14px;
  }

  .brand-help-button {
    padding: 0 7px;
  }

  .header-action .primary-button span {
    display: none;
  }

  .calendar-toolbar {
    height: auto;
    padding: 18px 14px;
    align-items: flex-start;
  }

  .calendar-toolbar h1 {
    font-size: 22px;
  }

  .calendar-toolbar p {
    display: none;
  }

  .weekday-row {
    padding: 0 6px;
  }

  .calendar-grid {
    height: 570px;
    min-height: 570px;
    margin: 0 6px 12px;
    grid-template-rows: repeat(6, 94px);
  }

  .calendar-day {
    padding: 5px;
  }

  .day-top {
    flex-basis: 27px;
  }

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

  .cycle-prompt-actions button {
    flex: 1;
  }

  .day-minutes span {
    display: none;
  }

  .focus-main {
    min-height: 700px;
    padding: 24px 18px;
  }

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

  .duration-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .custom-duration {
    grid-column: 1 / -1;
  }

  #timerDisplay {
    font-size: 50px;
  }

  .projects-main {
    padding: 24px 14px 32px;
  }

  .projects-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .projects-heading-actions {
    width: 100%;
    align-items: stretch;
  }

  .goal-view-switcher button {
    min-width: 0;
  }

  .project-summary {
    justify-content: space-between;
  }

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

  .project-node {
    margin-left: calc(var(--depth) * 14px);
  }

  .project-node-row {
    grid-template-columns: 26px 26px minmax(0, 1fr) auto;
  }

  .project-node-actions .tree-icon-button[data-action="schedule"] {
    display: none;
  }

  .goal-map-toolbar {
    align-items: flex-start;
  }

  .goal-map-toolbar p {
    max-width: 210px;
    line-height: 1.5;
  }

  .goal-map-viewport {
    height: 500px;
    min-height: 500px;
  }

  .help-page {
    padding: 28px 14px 24px;
  }

  .help-hero {
    margin-bottom: 24px;
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .help-hero h1 {
    font-size: 32px;
  }

  .help-method {
    padding: 24px 0;
  }

  .help-method-heading h2,
  .help-steps-heading h2 {
    font-size: 21px;
  }

  .help-method-flow {
    grid-template-columns: 1fr;
  }

  .help-method-flow li {
    min-height: 44px;
    padding: 7px 8px;
    align-items: center;
    flex-direction: row;
    text-align: left;
  }

  .help-method-flow li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -7px;
    left: 18px;
    content: "↓";
  }

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

  .help-step {
    min-height: 270px;
  }

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

  .help-footer .primary-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand {
    gap: 7px;
    font-size: 14px;
  }

  .brand-help-button {
    width: 28px;
    min-width: 28px;
    padding: 0;
  }

  .brand-help-button span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Drag interactions */
.day-task-preview.task-draggable {
  min-height: 23px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
}

.day-task-preview.task-draggable:hover {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(39, 103, 73, 0.18);
}

.day-task-preview.task-drag-locked {
  cursor: not-allowed;
  opacity: 0.68;
}

.day-task-preview.timing {
  color: #a34e3c;
  text-decoration: none;
}

.calendar-day.task-drop-target {
  z-index: 4;
  background: #e7f2ea;
  box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-day.task-drop-target::after {
  position: absolute;
  right: 7px;
  bottom: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.86);
  content: attr(data-drop-label);
  font-size: 9px;
  font-weight: 720;
}

.task-item {
  position: relative;
  grid-template-columns: 22px 26px minmax(0, 1fr) 28px 28px;
}

.task-item.has-planned-minutes {
  grid-template-columns: 22px 26px minmax(0, 1fr) auto 28px 28px;
}

.task-planned-minutes {
  min-width: 54px;
  padding: 4px 7px;
  border: 1px solid #c8d9cc;
  border-radius: 5px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.header-action .header-sound-toggle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

@media (prefers-reduced-motion: reduce) {
  .focus-countdown span.animate {
    animation: none;
  }
}

.task-drag-handle,
.project-drag-handle {
  display: inline-grid;
  width: 22px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #959c94;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.project-drag-handle {
  width: 18px;
}

.task-drag-handle:hover,
.project-drag-handle:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.task-drag-handle svg,
.project-drag-handle svg {
  width: 15px;
  height: 15px;
}

.task-item.drag-source,
.project-node-row.drag-source,
.goal-map-node.drag-source,
.day-task-preview.drag-source {
  opacity: 0.3;
}

.task-item.drag-insert-before::before,
.task-item.drag-insert-after::after,
.project-node-row.drag-insert-before::before,
.project-node-row.drag-insert-after::after {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--coral);
  content: "";
}

.task-item.drag-insert-before::before,
.project-node-row.drag-insert-before::before {
  top: -2px;
}

.task-item.drag-insert-after::after,
.project-node-row.drag-insert-after::after {
  bottom: -2px;
}

.project-node-row {
  position: relative;
  gap: 2px;
}

.project-node-row.has-children {
  grid-template-columns: 18px 24px 27px minmax(0, 1fr) auto;
}

.project-node-row.leaf {
  grid-template-columns: 18px 27px minmax(0, 1fr) auto;
}

.project-expand-button {
  width: 24px;
}

.goal-map-node {
  cursor: grab;
  touch-action: none;
}

.goal-map-node-main {
  cursor: grab;
}

.goal-map-node.map-drop-before::before,
.goal-map-node.map-drop-after::after {
  position: absolute;
  z-index: 8;
  right: -8px;
  left: -86px;
  height: 4px;
  border-radius: 3px;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(227, 105, 81, 0.14);
  content: "";
  pointer-events: none;
}

.goal-map-node.map-drop-before::before {
  top: -13px;
}

.goal-map-node.map-drop-after::after {
  bottom: -13px;
}

.goal-map-node.map-drop-child {
  border-color: var(--blue);
  background: #edf5f9;
  box-shadow: 0 0 0 3px rgba(62, 114, 152, 0.18), 0 9px 22px rgba(32, 42, 34, 0.1);
}

.goal-map-node.map-drop-child::after {
  position: absolute;
  right: 8px;
  bottom: -22px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #315f80;
  background: var(--blue-soft);
  content: attr(data-drop-label);
  font-size: 9px;
  font-weight: 720;
  pointer-events: none;
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  width: min(230px, calc(100vw - 24px));
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid #a9bdae;
  border-left: 4px solid var(--green);
  border-radius: 5px;
  color: var(--green-dark);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(28, 47, 34, 0.22);
  font-size: 11px;
  font-weight: 720;
  pointer-events: none;
  transform: rotate(1deg);
}

.drag-ghost.project-ghost {
  width: 220px;
}

@media (max-width: 720px) {
  .calendar-day.task-drop-target::after {
    content: "";
  }

  .task-item {
    grid-template-columns: 22px 26px minmax(0, 1fr) 28px 28px;
  }

  .task-item.has-planned-minutes {
    grid-template-columns: 22px 26px minmax(0, 1fr) auto 28px 28px;
  }
}
