/*
 * 메인 화면: 할 일, 집중/휴식, 시계·달력 배치, 기록, 설정 화면.
 * 기본 버튼·입력창·대화상자는 base.css, 테마·글꼴·효과는 theme.css에서 수정합니다.
 * 반응형 규칙은 관련 화면 규칙 뒤의 적용 순서를 유지합니다.
 */

/* 기본 화면과 할 일·집중·하루 마무리 */

.tagline,
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
}

.tagline {
  margin-right: auto;
  margin-left: 28px;
  color: var(--muted);
}

main {
  margin: 0 auto;
  padding: 38px 44px 0;
}

.dayline {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  gap: 20px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 450px;
  margin: 35px 0 50px;
  font-size: 11px;
  color: #939b93;
}

.steps i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.steps .active {
  color: var(--ink);
  font-weight: bold;
}

.intro h1,
#done h1 {
  font-size: clamp(44px, 6vw, 68px);
  letter-spacing: -3px;
  font-weight: 500;
  margin: 14px 0 20px;
}

.intro > p:last-child,
#done > p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
}

.eyebrow {
  color: #7a886c;
}

.workspace {
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  margin-top: 40px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title h2 {
  margin: 0;
}

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

.task {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.task.selected {
  border-color: #80935f;
}

.task input[type="checkbox"] {
  accent-color: var(--ink);
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.task-choice {
  flex: 1;
  text-align: left;
  min-width: 0;
  padding: 0;
}

.task-choice strong {
  display: block;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.task-choice small {
  display: block;
  color: var(--muted);
}

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

.remove {
  color: var(--muted);
  font-size: 21px;
  padding: 8px;
}

.task-number {
  font-size: 10px;
  color: var(--muted);
}

#taskForm {
  border: 1px dashed #c7cfc1;
  border-radius: 10px;
  padding: 16px;
}

#taskForm input {
  border: 0;
  background: transparent;
  padding: 3px 0 14px;
  outline-offset: 3px;
}

.form-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.form-bottom select {
  border: 0;
  background: transparent;
}

.start-panel {
  background: #e9eddf;
  border-radius: 16px;
  padding: 34px;
  align-self: start;
  position: relative;
}

.start-panel:before {
  content: "✳";
  position: absolute;
  right: 25px;
  top: 20px;
  font-size: 45px;
  color: #abb894;
  font-weight: normal;
}

.start-panel h2 {
  font-weight: 500;
  font-size: 27px;
  line-height: 1.5;
  margin: 32px 0 10px;
  overflow-wrap: anywhere;
}

.start-panel > p:not(.hint) {
  color: #69775f;
}

.start-panel .primary {
  margin-top: 15px;
}

.start-panel .hint {
  margin-bottom: 0;
  font-size: 10px;
}

#finishDay {
  margin-top: 16px;
}

.daily-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.daily-strip > span {
  color: var(--muted);
}

.daily-strip strong {
  font-weight: 500;
}

.daily-strip button {
  margin-left: auto;
}

#focus {
  text-align: center;
  padding: 30px 0 55px;
}

#focus h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 500;
  overflow-wrap: anywhere;
}

#timer {
  font-size: clamp(80px, 16vw, 164px);
  font-weight: 400;
  letter-spacing: -7px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

#focusHint {
  color: var(--muted);
  font-size: 13px;
}

.timer-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 30px 0 14px;
}

#focusMemo {
  margin-top: 15px;
}

body.is-focusing .dayline,
body.is-focusing footer,
body.is-focusing .daily-strip,
body.is-focusing .tagline {
  visibility: hidden;
}

body.is-focusing #settingsButton {
  visibility: hidden;
}

#done {
  text-align: center;
  padding: 35px 0;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 45px 0;
}

.stat strong {
  display: block;
  font-size: 42px;
  font-weight: 500;
}

.stat span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 12px;
}

.memo-item {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 18px;
  display: flex;
  gap: 12px;
}

.memo-item p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  flex: 1;
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.memo-item small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 7px;
}

#notice,
.banner {
  position: relative;
  margin: 16px auto 0;
  background: #e4eaca;
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 7px;
}

#notice.error {
  background: #f0dfd2;
}

#news {
  margin-top: 28px;
}

#newsLinks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

#newsLinks a:hover {
  text-decoration: underline;
}

.empty {
  color: var(--muted);
  padding: 20px 0;
  line-height: 1.9;
}

.carry {
  padding: 8px;
  font-size: 12px;
  text-align: left;
  color: var(--muted);
}

@media (max-width: 700px) {
  .tagline {
    display: none;
  }

  main {
    padding: 28px 22px 0;
  }

  .steps {
    margin: 28px 0 35px;
    gap: 10px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
  }

  .start-panel {
    padding: 25px;
  }

  .start-panel h2 {
    margin-top: 24px;
    font-size: 24px;
  }

  .daily-strip {
    gap: 12px;
    flex-wrap: wrap;
  }

  .stats {
    gap: 24px;
  }

  .stat strong {
    font-size: 34px;
  }

  #focus {
    padding-top: 45px;
  }

  #timer {
    letter-spacing: -4px;
  }

  .dayline {
    font-size: 11px;
  }

  #notice,
  .banner {
    margin: 12px 18px 0;
  }
}

.edit-task {
  font-size: 10px;
  color: var(--muted);
  padding: 10px 4px;
}

.task .remove {
  padding: 8px 4px;
}

.task {
  gap: 10px;
}

main {
  max-width: 800px;
  padding: 24px 32px 0;
}

.intro {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 24px;
}

.intro h1 {
  font-size: 30px;
  letter-spacing: -1.3px;
  margin: 0;
  font-weight: 500;
}

.intro #welcomeHint {
  font-size: 12px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

#ddayDetails {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

#ddayDetails summary {
  cursor: pointer;
  padding: 10px 0;
}

#ddayLabel {
  display: block;
  max-width: 220px;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.workspace {
  display: block;
  margin: 0;
}

.tasks-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 3px 14px #283e3505;
}

.section-title {
  margin-bottom: 18px;
}

.section-title h2 {
  font-size: 14px;
  font-weight: 600;
}

.task {
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 8px;
  padding: 12px 10px;
  min-height: 78px;
  margin: 4px 0;
}

.task.selected {
  background: #edf1e3;
  border-color: #a4b38c;
  box-shadow: inset 3px 0 #718458;
}

.task-choice {
  min-height: 44px;
}

.task-choice strong {
  font-size: 15px;
  line-height: 1.5;
}

.task-choice small {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 3px;
}

.task.completed .task-choice {
  opacity: 1;
}

.task .remove,
.edit-task {
  min-height: 44px;
  min-width: 32px;
  font-size: 12px;
}

.task .remove {
  font-size: 20px;
}

#taskForm {
  margin-top: 16px;
  border-style: solid;
  background: #f8f9f4;
  padding: 14px 16px;
}

#taskForm input {
  font-size: 14px;
  padding-bottom: 10px;
}

.form-bottom select {
  min-height: 36px;
}

.start-panel {
  border-top: 1px solid var(--line);
  background: none;
  border-radius: 0;
  padding: 18px 0 0;
  min-height: 0;
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.start-panel::before {
  content: none;
}

.start-panel > p:not(.hint) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.start-panel .primary {
  width: auto;
  margin: 0 0 0 auto;
  min-width: 160px;
  flex-shrink: 0;
}

#finishDay {
  display: block;
  margin: 8px 0 0 auto;
}

.daily-strip {
  margin-top: 22px;
  padding: 12px 0;
  font-size: 12px;
}

.empty {
  margin: 0;
  padding: 14px 0 4px;
  font-size: 13px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 500;
}

#focus {
  padding: 55px 0 28px;
  min-height: 440px;
}

#focus h1 {
  font-size: clamp(24px, 4vw, 32px);
  margin: 20px 0 10px;
}

#timer {
  font-size: clamp(84px, 15vw, 144px);
}

#done {
  padding: 32px 0;
}

#done h1 {
  font-size: 38px;
  letter-spacing: -1.5px;
}

body.is-focusing .header-date {
  visibility: hidden;
}

#notice,
.banner {
  max-width: 736px;
}

@media (max-width: 700px) {
  #settingsButton {
    padding: 9px 11px;
  }

  main {
    padding: 18px 16px 0;
  }

  .intro {
    margin: 0 4px 18px;
    gap: 8px 14px;
  }

  .intro h1 {
    font-size: 27px;
  }

  .intro #welcomeHint {
    flex-basis: 100%;
    order: 2;
  }

  .tasks-panel {
    padding: 18px 14px;
  }

  .task {
    gap: 8px;
    padding: 9px 7px;
    min-height: 74px;
  }

  .task-choice strong {
    font-size: 14px;
  }

  .task-choice small {
    font-size: 10px;
  }

  .task .remove,
  .edit-task {
    min-width: 28px;
  }

  #taskForm {
    margin-top: 12px;
    padding: 12px;
  }

  .start-panel {
    padding-top: 15px;
    margin-top: 16px;
    flex-direction: column;
    gap: 12px;
  }

  .start-panel .primary {
    width: 100%;
    margin: 0;
  }

  .daily-strip {
    margin-top: 14px;
    gap: 10px;
  }

  .daily-strip > span {
    font-size: 11px;
  }

  #focus {
    padding: 48px 0 16px;
    min-height: 390px;
  }

  #done h1 {
    font-size: 34px;
  }
}

@media (max-width: 360px) {
  .task {
    gap: 5px;
  }
}

.date-calc-fields, .date-calc-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.date-calc-fields > label {
  min-width: 0;
}

.date-calc-base {
  text-align: center;
  padding: 20px 0 24px;
}

.date-calc-base strong {
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.date-calc-base p {
  color: var(--muted);
  font-size: 13px;
}

.date-calc-results section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 0;
}

.date-calc-results h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.date-calc-results time {
  display: block;
  font-size: 16px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.date-calc-results button {
  width: 100%;
  font-size: 12px;
}

#calcError {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 520px) {
  .date-calc-fields, .date-calc-results {
    grid-template-columns: 1fr;
  }
}

#dateCalculatorDialog .dday-mode-picker {
  border: 0;
  padding: 0;
  margin: 24px 0 16px;
  min-width: 0;
}

#dateCalculatorDialog .dday-mode-picker legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.dday-mode-track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 5%, var(--bg));
}

#dateCalculatorDialog .dday-mode-track label {
  position: relative;
  margin: 0;
  cursor: pointer;
  min-width: 0;
}

#dateCalculatorDialog .dday-mode-track input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.dday-mode-track input + span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 150ms, color 150ms, box-shadow 150ms;
}

.dday-mode-track b {
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 500;
}

.dday-mode-track input:checked + span {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 5px #0000000d;
  border-color: color-mix(in srgb, var(--ink) 8%, transparent);
}

.dday-mode-track input:checked + span b {
  color: var(--desk-accent, #b97708);
}

.dday-mode-track input:focus-visible + span {
  outline: 2px solid var(--desk-accent, #b97708);
  outline-offset: 2px;
}

.dday-mode-track label:hover input + span {
  color: var(--ink);
}

#dateCalculatorDialog .dday-mode-description {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .dday-mode-track input + span {
    transition: none;
  }
}

/* 메인 책상 화면과 기능별 구성 */

.desk {
  min-height: 100dvh;
}

.nodi-about {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(96px, 12vw, 180px) 24px;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.nodi-about-brand.logo {
  position: relative;
  display: inline-flex;
  margin: 0 0 28px;
}

.nodi-about-brand.logo img {
  width: clamp(100px, 14vw, 132px);
  height: auto;
}

.nodi-about h2 {
  margin: 0 0 32px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.4;
  letter-spacing: -0.04em;
}

.nodi-about-copy {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 2;
}

.nodi-about-origin {
  display: inline-block;
  margin: 44px 0 0;
  padding: 18px 26px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.8;
}

.nodi-about-origin strong {
  color: var(--desk-aboutAccent, var(--desk-accent, #ffb020));
  font-weight: 700;
}

body.is-focusing .nodi-about {
  display: none;
}

.desk-only {
  display: none;
}

.view-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.desk header {
  padding: 24px 36px;
}

.desk main {
  padding: clamp(25px, 7vh, 80px) 36px 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
  gap: 24px 48px;
  align-items: center;
}

.desk .desk-only {
  display: block;
}

.desk #deskIdle {
  align-self: center;
}

.desk-caption {
  font-size: 12px;
  letter-spacing: 0.05em;
  opacity: 0.65;
  margin: 0 0 22px;
}

.flip-clock {
  display: flex !important;
  gap: clamp(12px, 2vw, 26px);
}

.flip-card {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--desk-border);
  border-radius: 24px;
  background:
    linear-gradient(
    180deg,
    #00000017 0%,
    #00000025 49.8%,
    #ffffff04 50%,
    #ffffff09 100%
    ),
    var(--desk-card);
  box-shadow: 0 18px 30px #00000020;
  overflow: hidden;
}

.flip-card:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--desk-border);
  box-shadow: 0 2px 8px #00000035;
}

.flip-number {
  font-size: clamp(70px, 12vw, 190px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  color: var(--desk-clock);
  text-shadow: none;
}

.flip-card small {
  position: absolute;
  bottom: 18px;
  left: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--desk-accent);
}

.flip-card:last-child small {
  left: auto;
  right: 20px;
}

.desk .intro #welcomeHint {
  flex-basis: 100%;
}

.desk .tasks-panel {
  box-shadow: none;
  background: var(--desk-card);
  border-radius: 22px;
}

.desk .task.selected {
  background: var(--desk-background);
  border-color: var(--desk-accent);
  box-shadow: inset 3px 0 var(--desk-accent);
}

.desk .task input {
  accent-color: var(--desk-button);
}

.desk #taskForm {
  background: var(--desk-background);
}

.desk .primary {
  background: var(--desk-button);
  color: var(--desk-buttonText);
}

.desk .primary:hover:not(:disabled) {
  filter: brightness(0.9);
}

.desk .primary:disabled {
  background: var(--desk-border);
  color: var(--desk-text);
  opacity: 0.55;
}

.desk .quiet:hover:not(:disabled),
.desk .text-button:hover {
  background: var(--desk-border);
}

.desk .daily-strip,
.desk #news,
.desk #done {
  grid-column: 1/-1;
}

.desk #focus {
  grid-column: 1/-1;
  padding: 0 0 20px;
}

.desk #focus h1 {
  margin-bottom: 30px;
}

.desk #deskCountdown {
  max-width: 680px;
  margin: 0 auto;
}

.desk #deskCountdown .flip-card {
  aspect-ratio: 1.35;
}

.desk #timer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.desk #focusHint {
  margin-top: 28px;
}

.desk[data-routine="focus"] #deskIdle,
.desk[data-routine="break"] #deskIdle,
.desk[data-routine="done"] #deskIdle,
.desk[data-routine="focus"] .calendar-section,
.desk[data-routine="done"] .calendar-section {
  display: none;
}

.desk[data-routine="break"] .calendar-section {
  grid-column: 1/-1;
  max-width: 600px;
  width: 100%;
  justify-self: center;
}

.desk #deskCalendar {
  grid-column: 1/-1;
  width: 100%;
  justify-self: center;
}

.desk #deskCalendar summary {
  cursor: pointer;
  font-size: 12px;
  padding: 12px;
  opacity: 0.8;
  text-align: center;
}

.desk-calendar-card {
  background: var(--desk-card);
  border: 1px solid var(--desk-border);
  border-radius: 22px;
  overflow: hidden;
  padding-bottom: 16px;
}

.calendar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--desk-border);
  padding: 18px;
}

.calendar-heading h2 {
  font-size: 22px;
  color: var(--desk-accent);
  margin: 0;
}

.calendar-heading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  width: 44px;
  height: 44px;
  color: var(--desk-text);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 12px 18px 0;
  text-align: center;
  gap: 3px;
}

.calendar-weekdays {
  font-size: 12px;
  opacity: 0.6;
}

.calendar-grid span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
}

.calendar-grid .outside {
  opacity: 0.4;
}

.calendar-grid .today {
  background: var(--desk-button);
  color: var(--desk-buttonText);
  font-weight: 800;
}

#calendarDday {
  text-align: center;
  font-size: 12px;
  color: var(--desk-accent);
}

.desk dialog {
  background: var(--desk-background);
}

#colorFields fieldset {
  border: 0;
  margin: 20px 0;
  padding: 0;
}

.color-preview {
  padding: 16px;
  border: 1px solid var(--preview-border);
  border-radius: 12px;
  background: var(--preview-background);
  color: var(--preview-text);
  text-align: center;
}

.color-preview-label {
  color: var(--preview-accent);
  font-size: 12px;
}

.color-preview-clock {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}

.color-preview-clock > span {
  width: 94px;
  padding: 10px;
  border-radius: 8px;
  background: var(--preview-card);
  color: var(--preview-clock);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.color-preview-clock small {
  display: block;
  margin-top: 6px;
  color: var(--preview-accent);
  font-size: 11px;
}

.color-preview-button {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--preview-button);
  color: var(--preview-buttonText);
  font-size: 12px;
}

#colorFields legend {
  font-size: 13px;
  margin-bottom: 12px;
}

.color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #888;
}

.color-swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

#colorFields .custom-color-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

#colorFields .custom-color-picker:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

#colorFields input[type="color"] {
  width: 32px;
  height: 32px;
  margin: 0;
  cursor: pointer;
  padding: 2px;
  border: 1px solid var(--line);
}

.theme-presets {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.theme-presets button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  font-size: 11px;
}

.desk #notice,
.desk .banner {
  background: var(--desk-card);
  color: var(--desk-text);
}

.desk #notice.error {
  border: 1px solid #cb7850;
}

.desk .eyebrow {
  color: var(--desk-accent);
}

@media (max-width: 900px) {
  .desk main {
    grid-template-columns: 1fr;
    padding: 26px 24px 0;
    gap: 30px;
  }

  .desk header {
    padding: 20px 24px;
  }

  .desk #deskIdle {
    max-width: 520px;
    width: 100%;
    justify-self: center;
  }

  .flip-card {
    aspect-ratio: 1.3;
  }

  .flip-number {
    font-size: clamp(72px, 20vw, 135px);
  }

  .desk-caption {
    margin-bottom: 14px;
  }

  .desk .daily-strip {
    grid-column: 1;
  }

  .desk #deskCountdown {
    max-width: 540px;
  }

}

@media (max-width: 500px) {
  header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-date {
    flex: 1;
  }

  .view-controls {
    margin-left: auto;
  }

  .desk header {
    padding: 16px;
  }

  .desk main {
    padding: 16px;
    gap: 22px;
  }

  .desk .tasks-panel {
    padding: 18px 14px;
  }

  .flip-card {
    border-radius: 16px;
  }

  .flip-card small {
    font-size: 9px;
    bottom: 11px;
    left: 12px;
  }

  .flip-card:last-child small {
    right: 12px;
  }

  .flip-number {
    font-size: clamp(68px, 22vw, 106px);
  }

  .desk #focus h1 {
    font-size: 24px;
    margin-bottom: 22px;
  }

  .desk .header-date {
    font-size: 10px;
  }

  .desk #deskCountdown .flip-card {
    aspect-ratio: 1;
  }

  .calendar-grid span {
    font-size: 15px;
  }

  .calendar-heading h2 {
    font-size: 18px;
  }
}

.desk-only.flip-clock {
  display: none !important;
}

.desk .desk-only.flip-clock {
  display: flex !important;
}

/* 할 일 목록과 다음 집중 패널 */

.desk main {
  display: block;
  max-width: 1320px;
  padding: 24px 36px 0;
}

.desk header {
  max-width: 1440px;
}

.desk .routine-progress {
  max-width: 580px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px auto 46px;
  color: var(--muted);
  font-size: 12px;
}

.routine-progress span {
  white-space: nowrap;
  opacity: 0.55;
}

.routine-progress span:before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 auto 12px;
}

.routine-progress i {
  height: 1px;
  flex: 1;
  background: var(--line);
  margin-bottom: 23px;
}

.routine-progress .active {
  color: var(--desk-accent);
  opacity: 1;
}

.desk .intro {
  margin-bottom: 28px;
  display: flex;
  gap: 12px 20px;
}

.desk .intro h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1.5px;
}

.desk .intro #welcomeHint {
  font-size: 14px;
}

.desk .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 24px;
}

.desk .tasks-panel,
.desk .start-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--desk-card);
  padding: 28px;
}

.desk .section-title {
  margin-bottom: 24px;
}

.desk .section-title h2 {
  font-size: 19px;
}

.desk .task {
  gap: 9px;
  margin: 0 0 10px;
  padding: 10px 7px;
  border-bottom-color: var(--line);
}

.slot-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--desk-border);
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.selected .slot-number {
  background: var(--desk-button);
  color: var(--desk-buttonText);
}

.desk #taskForm {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 0;
  padding: 0;
  background: none;
  margin: 0 0 12px;
}

.desk #taskForm > .slot-number {
  margin-top: 14px;
}

.task-input-body {
  flex: 1;
  min-width: 0;
  background: var(--desk-background);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}

.task-input-body:focus-within {
  border-color: var(--desk-accent);
}

.desk #taskForm input {
  font-size: 14px;
}

.desk #taskForm .quiet {
  padding: 8px 12px;
  min-height: 36px;
}

.desk .empty-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  margin: 0 0 12px;
  padding: 0;
  text-align: left;
  color: var(--muted);
  opacity: 0.65;
}

.empty-slot-label {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px 12px;
}

.empty-slot > span:last-child {
  margin-left: -40px;
  margin-right: 17px;
  font-size: 19px;
}

.plan-note {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  opacity: 0.65;
}

.desk .start-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  text-align: center;
  align-self: stretch;
}

.desk .start-panel .next-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  opacity: 0.65;
}

.desk .start-panel h2 {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 500;
  overflow-wrap: anywhere;
  margin: 0 0 18px;
  color: var(--ink);
}

#plannedTimer {
  font-size: clamp(58px, 6vw, 92px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
  line-height: 1.2;
  color: var(--desk-accent);
}

.desk .start-panel #selectedMeta {
  font-size: 12px;
  margin: 16px 0 26px;
  color: var(--muted);
}

.desk .start-panel .primary {
  margin: 0;
  width: 100%;
  font-size: 16px;
  min-height: 54px;
}

.desk .start-panel .start-help {
  margin: 22px 0 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  opacity: 0.6;
}

.desk #finishDay {
  margin: 16px auto 0;
  padding: 12px 22px;
}

.desk #deskCalendar {
  margin: 20px auto 0;
}

.desk .daily-strip {
  margin-top: 22px;
}

.desk.is-focusing .routine-progress {
  display: none;
}

.desk #focus {
  padding-top: 45px;
}

#headerTime {
  font-size: 12px;
  opacity: 0.65;
  margin-left: auto;
}

.desk .header-date {
  margin-right: 0;
}

.desk .view-controls {
  margin-left: 0;
}

@media (max-width: 850px) {
  .desk main {
    padding: 20px 20px 0;
    max-width: 720px;
  }

  .desk .workspace {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .desk .routine-progress {
    margin-bottom: 30px;
    gap: 10px;
    font-size: 11px;
  }

  .desk .intro h1 {
    font-size: 32px;
  }

  .desk .tasks-panel {
    padding: 22px;
  }

  .desk .start-panel {
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    text-align: left;
  }

  .desk .start-panel .next-label {
    grid-column: 1;
    margin-bottom: 6px;
  }

  .desk .start-panel h2 {
    grid-column: 1/-1;
    font-size: 17px;
    margin-bottom: 12px;
  }

  .desk #plannedTimer {
    grid-column: 1;
    font-size: 52px;
    letter-spacing: -2px;
  }

  .desk .start-panel #selectedMeta {
    grid-column: 1/-1;
    margin: 10px 0 16px;
    font-size: 11px;
  }

  .desk .start-panel .primary {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    font-size: 14px;
    padding: 12px;
    gap: 12px;
  }

  .desk .start-panel .start-help {
    display: none;
  }

  .desk .section-title {
    margin-bottom: 20px;
  }

  .desk .task {
    gap: 7px;
  }

  .desk .task .slot-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}

@media (max-width: 500px) {
  .desk header {
    padding: 16px;
    gap: 10px;
    flex-wrap: wrap;
  }

  #headerTime {
    display: none;
  }

  .desk .view-controls {
    margin-left: auto;
  }

  .desk main {
    padding: 10px 16px 0;
  }

  .desk .routine-progress {
    margin: 10px auto 28px;
  }

  .desk .intro h1 {
    font-size: 30px;
  }

  .desk .intro #welcomeHint {
    font-size: 12px;
  }

  .desk .tasks-panel {
    padding: 20px 14px;
  }

  .slot-number {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .desk #taskForm {
    gap: 9px;
  }

  .desk .empty-slot {
    gap: 9px;
  }

  .desk .task-choice strong {
    font-size: 13px;
  }

  .desk .task .remove,
  .desk .edit-task {
    min-width: 24px;
    font-size: 11px;
  }

  .desk .task-choice small {
    font-size: 10px;
  }

  .desk .start-panel {
    padding: 20px;
  }

  .desk #focus {
    padding-top: 28px;
  }
}

/* 공통 아이콘과 버튼 */

.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.desk .primary,
.desk .quiet,
.desk .file-button,
.desk .theme-presets button {
  border-radius: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.desk .primary {
  gap: 12px;
}

.desk .quiet,
.desk .file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-color: color-mix(in srgb, var(--desk-text) 16%, transparent);
}

.desk header .quiet {
  border-color: transparent;
}

.desk .text-button {
  border-radius: 10px;
  min-height: 44px;
}

.desk .text-button .ui-icon {
  margin-left: 6px;
}

.desk .dialog-head button,
.desk .remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 0;
  color: var(--desk-text);
}

.desk .dialog-head button::before,
.desk .dialog-head button::after,
.desk .remove::before,
.desk .remove::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.desk .dialog-head button::after,
.desk .remove::after {
  transform: rotate(-45deg);
}

.desk .calendar-heading button:hover:not(:disabled),
.desk .dialog-head button:hover:not(:disabled),
.desk .remove:hover:not(:disabled),
.desk .theme-presets button:hover:not(:disabled),
.desk .quiet:hover:not(:disabled),
.desk .text-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--desk-text) 8%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .desk button,
  .desk .file-button {
    transition: background-color 150ms ease, border-color 150ms ease;
  }
}

/* 헤더 날짜와 현재 시각 */

.desk .header-datetime {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin-left: auto;
  padding-right: 24px;
  border-right: 1px solid color-mix(in srgb, var(--desk-text) 12%, transparent);
  white-space: nowrap;
}

.desk .header-datetime .header-date {
  flex: none;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.02em;
  opacity: 0.65;
}

.desk .header-datetime #headerTime {
  display: block;
  margin: 0;
  color: var(--desk-text);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.desk.is-focusing .header-datetime .header-date {
  visibility: visible;
}

@media (max-width: 600px) {
  .desk header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .desk header .logo {
    margin-right: auto;
  }

  .desk .header-datetime {
    order: 1;
    flex: 0 0 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 0;
    padding: 12px 0 0;
    border-right: 0;
    border-top: 1px solid color-mix(in srgb, var(--desk-text) 10%, transparent);
  }

  .desk .header-datetime #headerTime {
    font-size: 16px;
  }

  .desk .view-controls {
    margin-left: 0;
  }
}

.floating-controls {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: 44px;
  justify-items: end;
  gap: 5px;
  width: 56px;
  padding: 7px 5px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 10px 32px #0002;
}

/* 하단 메뉴의 아이콘과 펼침 이름 */

.floating-controls .text-button,
.floating-controls .quick-links > summary {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  overflow: visible;
  list-style: none;
}

.floating-controls .text-button:hover,
.floating-controls .quick-links > summary:hover,
.floating-controls .quick-links[open] > summary {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.floating-controls .text-button span,
.quick-links > summary span {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  width: max-content;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 20px #0002;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity 160ms ease, transform 200ms ease, visibility 160ms;
}

.floating-controls .text-button:focus-visible span,
.quick-links > summary:focus-visible span {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .floating-controls .text-button:hover span,
  .quick-links > summary:hover span {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
  }
}

.quick-links[open] > summary span {
  opacity: 0;
  visibility: hidden;
}

.dock-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-controls #settingsButton {
  padding: 0;
}

.quick-links {
  position: relative;
  width: 44px;
}

.quick-links > summary::-webkit-details-marker {
  display: none;
}

.quick-links > summary:focus-visible {
  outline: 2px solid var(--desk-accent, #ffb020);
  outline-offset: 3px;
}

.quick-links nav {
  position: absolute;
  right: calc(100% + 14px);
  bottom: 0;
  display: grid;
  gap: 4px;
  width: 208px;
  max-width: calc(100vw - 100px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 36px #0003;
}

.quick-links nav strong {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.quick-links nav a {
  padding: 10px;
  border-radius: 9px;
  font-size: 13px;
  text-decoration: none;
}

.quick-links nav a:hover,
.quick-links nav a:focus-visible {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .floating-controls .text-button span,
  .quick-links > summary span {
    transition: none;
  }
}

body.is-focusing .floating-controls {
  visibility: hidden;
}

@media (max-width: 500px) {
  .floating-controls {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

.desk .task .remove {
  font-size: 0;
}

.desk .start-panel .primary {
  white-space: nowrap;
}

@media (max-width: 500px) {
  .desk .task {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 44px 44px;
    gap: 8px;
    padding: 12px;
  }

  .desk .task > .slot-number {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .desk .task-choice {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .desk .task input[type="checkbox"] {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    margin: 0;
  }

  .desk .edit-task {
    grid-column: 3;
    grid-row: 2;
    min-height: 44px;
  }

  .desk .task .remove {
    grid-column: 4;
    grid-row: 2;
  }
}

@media (max-width: 380px) {
  .desk .start-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk .start-panel .primary {
    grid-column: 1;
    grid-row: auto;
  }
}

/* 작업 카드 높이와 PC의 집중 시작 패널 */

.desk .tasks-panel {
  display: flex;
  flex-direction: column;
}

.desk .task {
  padding: 16px 12px;
  gap: 12px;
  min-height: 84px;
  box-sizing: border-box;
}

.desk .task:last-child:not(.selected) {
  border-bottom-color: transparent;
}

.desk #taskForm {
  margin: 16px 0 0;
}

.desk .plan-note {
  margin-bottom: 0;
  margin-top: 24px;
  padding-top: 20px;
}

.desk .start-panel {
  justify-content: flex-start;
}

.desk .start-panel .start-help {
  margin-top: 24px;
  padding-top: 20px;
}

@media (min-width: 901px) {
  .desk .tasks-panel {
    height: auto;
    box-sizing: border-box;
  }

  .desk #tasks {
    min-height: 0;
    flex: none;
  }

  .desk .start-panel {
    position: sticky;
    top: 24px;
    align-self: start;
    height: auto;
    box-sizing: border-box;
  }

  .desk .start-panel .next-label {
    min-height: 28px;
    margin-bottom: 24px;
    text-align: left;
  }

  .desk .start-panel h2 {
    margin-bottom: 12px;
  }

  .desk .start-panel #selectedMeta {
    margin: 12px 0 24px;
  }

  .desk .start-panel .start-help {
    margin-top: 24px;
  }
}

@media (max-width: 500px) {
  .desk .task input[type="checkbox"] {
    grid-row: 1;
    align-self: center;
  }
}

/* 작업 입력창과 처음 사용 안내 */

.desk .workspace {
  align-items: start;
}

.desk .tasks-panel {
  align-self: start;
}

.desk .start-panel {
  min-height: 0;
}

#taskEmptyHint {
  margin: 0 0 4px;
}

.desk .task-input-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.desk #taskForm #taskTitle {
  padding: 4px 0;
  margin: 0;
  min-height: 32px;
  border-radius: 0;
}

.desk #taskTitle:focus-visible {
  outline: none;
}

.desk .task-input-body:focus-within {
  border-color: var(--desk-accent);
}

.desk #taskForm .form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.desk #taskForm .form-bottom label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.desk #taskForm .form-bottom button {
  margin-left: auto;
}

#carryDetails {
  margin-top: 20px;
  font-size: 12px;
}

#carryDetails summary {
  cursor: pointer;
}

#carryDetails summary:focus-visible {
  outline: 2px solid var(--desk-accent);
  outline-offset: 4px;
}

#carryTasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

#carryTasks .carry {
  margin: 0;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

/* 오늘 기록과 하루 마무리 */

.desk .daily-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: none;
  margin: 36px auto 0;
  padding: 24px 0;
  border-bottom: 0;
}

.desk .daily-strip h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.daily-header,
.daily-summary,
.daily-tools {
  display: flex;
  align-items: center;
}

.daily-header,
.daily-summary {
  justify-content: space-between;
  gap: 20px;
}

.daily-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
}

.desk .daily-tools .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}

.daily-summary {
  align-items: flex-end;
}

.daily-focus {
  min-width: 0;
}

.daily-label {
  font-size: 12px;
  color: var(--muted);
}

.daily-values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.desk .daily-values strong {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.04em;
}

#dailyCount {
  font-size: 13px;
  color: var(--muted);
}

.desk .daily-strip #finishDay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font-size: 14px;
}

.desk .daily-strip #finishDay .ui-icon {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  stroke-width: 1.35;
  opacity: 0.72;
  transition: transform 160ms ease, opacity 160ms ease;
}

.desk .daily-strip #finishDay:hover {
  background: color-mix(in srgb, var(--ink) 11%, transparent);
}

.desk .daily-strip #finishDay:hover .ui-icon {
  transform: translateX(2px);
  opacity: 1;
}

.desk #deskCalendar {
  margin: 0 auto;
  max-width: none;
}

.calendar-section {
  --calendar-tool-width: 184px;
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 auto 28px;
  border-top: 1px solid var(--line);
}

#dateCalculatorButton {
  position: absolute;
  top: 10px;
  right: 0;
  width: var(--calendar-tool-width);
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  white-space: nowrap;
}

.desk #deskCalendar > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - var(--calendar-tool-width) - 20px);
  min-height: 64px;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 16px 0;
  border-radius: 0;
  text-align: left;
  list-style: none;
}

#calendarSummary {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.desk #deskCalendar > summary::-webkit-details-marker {
  display: none;
}

.desk #deskCalendar > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin: -4px 5px 0 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.58;
  transform: rotate(45deg);
  transition: transform 180ms ease, opacity 180ms ease;
}

.desk #deskCalendar[open] > summary::after {
  margin-top: 4px;
  transform: rotate(225deg);
}

.desk #deskCalendar > summary:hover::after {
  opacity: 0.9;
}

.desk #deskCalendar[open] > summary {
  margin-bottom: 12px;
}

@media (max-width: 500px) {
  .desk .daily-strip {
    margin-top: 28px;
    gap: 20px;
    padding: 20px 0;
  }

  .daily-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .daily-tools {
    justify-content: flex-start;
  }

  .daily-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .desk .daily-values strong {
    font-size: 28px;
  }

  .desk .daily-strip #finishDay {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .calendar-section {
    --calendar-tool-width: 166px;
  }

  .desk #deskCalendar > summary {
    flex-wrap: wrap;
    align-content: center;
    gap: 0 6px;
    width: calc(100% - var(--calendar-tool-width) - 12px);
    line-height: 1.5;
  }

  #calendarSummary {
    flex-basis: 100%;
    font-size: 11px;
  }

  .desk #deskCalendar > summary::after {
    position: absolute;
    top: 28px;
    left: 35px;
  }

  #dateCalculatorButton {
    padding: 10px;
    font-size: 12px;
  }
}

@media (max-width: 500px) {
  .desk .routine-progress {
    gap: 8px;
  }
}

.notification-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 0 0 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.notification-welcome strong {
  font-size: 15px;
  font-weight: 500;
}

.notification-welcome p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.notification-welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.notification-welcome-actions .primary {
  margin: 0;
  font-size: 14px;
  padding: 12px 18px;
}

@media (max-width: 600px) {
  .notification-welcome {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }
}

.design-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 16px;
  padding: 0;
  border: 0;
}

.design-options legend {
  font-size: 14px;
  margin-bottom: 10px;
}

.design-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.design-options label:has(input:checked) {
  border-color: var(--desk-accent);
  background: color-mix(in srgb, var(--desk-accent) 9%, transparent);
}

.design-options input {
  margin: 0;
  accent-color: var(--desk-accent);
}

.color-preview[data-clock-style="minimal"] .color-preview-clock {
  gap: 22px;
  position: relative;
}

.color-preview[data-clock-style="minimal"] .color-preview-clock > span {
  background: transparent;
  font-weight: 400;
}

.color-preview[data-clock-style="minimal"] .color-preview-clock::after {
  content: ":";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  font-size: 38px;
  color: var(--preview-clock);
}

.calendar-style-preview {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 280px;
  margin: 16px auto 0;
  font-size: 11px;
}

.calendar-style-preview span {
  padding: 4px 0;
  border-radius: 6px;
}

.calendar-style-preview .preview-today {
  background: var(--preview-button);
  color: var(--preview-buttonText);
}

.desk[data-calendar-style="week"] .calendar-heading h2 {
  font-size: clamp(13px, 3vw, 18px);
}

.desk[data-calendar-style="week"] .calendar-grid {
  padding-bottom: 12px;
}

/* 색상과 화면 커스텀 설정 */

.desk #colorDialog {
  width: min(600px, calc(100% - 28px));
  padding: 24px;
  overscroll-behavior: contain;
}

#colorDialog .dialog-head {
  margin-bottom: 8px;
}

#colorDialog > .hint {
  margin: 0 0 20px;
}

#colorDialog .hint {
  font-size: 13px;
  line-height: 1.65;
  word-break: keep-all;
}

#colorDialog .design-options {
  gap: 8px;
  margin: 24px 0 16px;
}

#colorDialog .design-options label {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  justify-content: center;
  white-space: nowrap;
  font-size: 14px;
}

#colorDialog .design-options input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
}

#colorPreview {
  padding: 20px;
  border-radius: 14px;
}

#analogPreview {
  width: 150px;
  height: 150px;
  margin: 12px auto;
}

#colorPreview[data-clock-style="analog"] #analogPreview {
  display: block;
}

#colorPreview[data-clock-style="analog"] .color-preview-clock {
  display: none;
}

#analogPreview .analog-rim {
  fill: none;
  stroke: var(--preview-text);
}

#analogPreview .analog-mark {
  stroke: var(--preview-text);
}

#analogPreview .analog-hand {
  stroke: var(--preview-clock);
}

#analogPreview .analog-label {
  fill: var(--preview-clock);
}

#analogPreview .analog-pin {
  fill: var(--preview-clock);
}

.custom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.custom-actions .primary {
  margin: 0;
}

@media (max-width: 420px) {
  .desk #colorDialog {
    padding: 18px;
  }

  #colorDialog .design-options label {
    font-size: 12px;
    padding: 10px 6px;
    gap: 5px;
  }

  #colorPreview {
    padding: 14px;
  }
}

/* 요일·월·날짜 플립 달력 */

.desk[data-calendar-style="flip"] .calendar-weekdays,
.desk[data-calendar-style="flip"] #calendarGrid {
  display: none;
}

.desk[data-calendar-style="flip"] .calendar-heading h2 {
  font-size: 16px;
}

.flip-calendar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 20px 12px;
  color: var(--desk-text);
}

.flip-date-column {
  min-width: 0;
  text-align: center;
}

.flip-date-caption {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.flip-date-year {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  opacity: 0.5;
  margin-top: 6px;
}

.flip-date-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 0.95;
  container-type: inline-size;
  border: 1px solid var(--desk-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #00000006 50%, #ffffff08 50%), var(--desk-background);
  box-shadow: 0 4px 0 -1px var(--desk-card), 0 5px 0 -1px var(--desk-border), 0 12px 24px #0000000d;
}

.flip-date-face::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--desk-border);
  opacity: 0.7;
}

.flip-date-face strong {
  font-size: clamp(20px, 30cqw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--desk-clock);
}

.calendar-today {
  display: block;
  margin: 0 auto;
  font-size: 12px;
}

#calendarPreview.flip-calendar {
  --desk-text: var(--preview-text);
  --desk-border: var(--preview-border);
  --desk-background: var(--preview-background);
  --desk-card: var(--preview-card);
  --desk-clock: var(--preview-clock);
  gap: 8px;
  padding: 12px 0 0;
}

#calendarPreview.flip-calendar span {
  padding: 0;
}

#calendarPreview .flip-date-face {
  width: 100%;
  border-radius: 8px;
}

#calendarPreview .flip-date-face strong {
  font-size: clamp(16px, 30cqw, 26px);
}

#calendarPreview .flip-date-caption {
  font-size: 9px;
  margin-bottom: 8px;
}

#calendarPreview .flip-date-year {
  font-size: 10px;
}

@media (max-width: 500px) {
  #flipCalendar {
    gap: 10px;
    padding: 20px 14px 12px;
  }

  #flipCalendar .flip-date-face {
    border-radius: 10px;
  }

  #flipCalendar .flip-date-caption {
    font-size: 10px;
  }
}

/* 플립 달력의 화면 배치 */

.desk[data-calendar-style="flip"] #deskCalendar {
  max-width: none;
  width: 100%;
  margin-top: 0;
}

.desk[data-calendar-style="flip"] #deskCalendar > .desk-calendar-card {
  min-height: min(900px, calc(100svh - 100px));
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vw, 48px);
  border-radius: 24px;
}

.desk[data-calendar-style="flip"] .calendar-heading {
  padding: 0 0 24px;
  border-bottom: 0;
}

.desk[data-calendar-style="flip"] .calendar-heading h2 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.desk[data-calendar-style="flip"] #flipCalendar {
  flex: 1;
  align-content: center;
  gap: clamp(12px, 3vw, 36px);
  padding: 12px 0 36px;
}

#flipCalendar .flip-date-caption {
  font-size: clamp(11px, 1.3vw, 16px);
  margin-bottom: clamp(12px, 2vw, 24px);
  letter-spacing: 0.14em;
}

#flipCalendar .flip-date-face {
  aspect-ratio: 0.85;
  border-radius: clamp(10px, 1.6vw, 20px);
}

#flipCalendar .flip-date-face strong {
  font-size: clamp(22px, 32cqw, 128px);
}

#flipCalendar .flip-date-column:nth-child(3) .flip-date-face strong {
  font-size: clamp(32px, 46cqw, 180px);
}

@media (max-width: 600px) {
  .desk[data-calendar-style="flip"] #deskCalendar > .desk-calendar-card {
    padding: 20px 14px 88px;
    min-height: calc(100svh - 100px);
    border-radius: 18px;
  }

  .desk[data-calendar-style="flip"] #flipCalendar {
    gap: 10px;
    padding-bottom: 12px;
  }

  #flipCalendar .flip-date-face {
    aspect-ratio: 0.7;
  }
}

.task-history {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.delete-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 4px 24px #0002;
  font-size: 13px;
}

.delete-notice button {
  flex-shrink: 0;
}

.completion-notice {
  --completion-accent: var(--desk-accent, #718467);
  position: fixed;
  inset: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) auto auto;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  width: 384px;
  max-width: calc(100vw - 40px);
  margin: 0;
  padding: 20px 16px 20px 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, var(--paper));
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 40px #00000012, 0 2px 8px #00000008;
}

.completion-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--completion-accent) 13%, var(--paper));
  color: var(--ink);
}

.completion-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.completion-copy {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.completion-notice strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.025em;
}

.completion-notice p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.completion-notice button {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  min-width: 32px;
  min-height: 32px;
  margin: -4px -4px 0 0;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.completion-notice button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.completion-notice button:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.completion-notice button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.lock-notice {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 300;
  box-sizing: border-box;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 0;
  padding: 24px 28px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 56px #0003;
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}

.lock-notice::backdrop {
  background: #11140f55;
}

.notification-check, .notification-help {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}

.notification-check p {
  margin: 0 0 8px;
}

.notification-help summary {
  cursor: pointer;
  padding: 6px 0;
}

.notification-help summary:focus-visible {
  outline: 2px solid var(--desk-accent);
  outline-offset: 3px;
}

.notification-help details {
  border-top: 1px solid var(--line);
  padding: 6px 0;
}

.notification-help ol {
  padding-left: 20px;
  margin: 8px 0;
}

.notification-help li + li {
  margin-top: 6px;
}

.task-history > summary {
  cursor: pointer;
  font-size: 14px;
  padding: 6px 0;
}

.task-history summary:focus-visible {
  outline: 2px solid var(--desk-accent);
  outline-offset: 4px;
}

#completedTasks {
  margin-top: 16px;
}

#carryTasks .history-day {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.history-day > summary {
  cursor: pointer;
  font-size: 13px;
  line-height: 1.7;
}

.history-day h3 {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.65;
}

.history-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.history-task-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-task strong {
  display: block;
  font-size: 14px;
  font-weight: 400;
}

.history-task small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.6;
}

.history-task .quiet {
  flex-shrink: 0;
  font-size: 12px;
  padding: 10px;
}

/* 첫 작업 안내와 테마 프리셋·의견 창 */

.first-use-guide {
  padding: 14px 16px;
  margin: 12px 0;
  border: 1px solid var(--desk-border);
  border-radius: 14px;
}

.first-use-guide[hidden] {
  display: none;
}

.first-use-guide strong {
  font-size: 14px;
}

.first-use-guide p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.7;
}

.storage-note {
  font-size: 12px;
  line-height: 1.8;
}

.preset-options {
  min-width: 0;
  margin: 18px 0;
  padding: 0;
  border: 0;
}

.theme-presets {
  flex-wrap: wrap;
}

.desk .theme-presets button {
  display: flex;
  flex: 1 1 100px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 2px solid transparent;
}

.desk .theme-presets button[aria-pressed="true"] {
  border-color: var(--desk-accent);
}

.preset-sample {
  display: block;
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--sample-bg);
  color: var(--sample-ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

#feedbackText {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  margin: 8px 0 12px;
}

.quick-links nav #feedbackButton {
  width: 100%;
  text-align: left;
  padding: 10px;
  font-size: 13px;
  border-radius: 9px;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feedback-kakao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--desk-accent, #ffb020);
  color: var(--desk-buttonText, #17191c);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.feedback-kakao:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.desk .preset-options .theme-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.desk .preset-options .theme-presets button {
  min-width: 0;
  width: 100%;
  margin: 0;
}

@media (max-width: 480px) {
  .desk .preset-options .theme-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
