:root {
  --paper: #f3ecd4;
  --paper-deep: #ecdfab;
  --paper-shadow: rgba(88, 70, 32, 0.08);
  --ink: #171512;
  --ink-soft: #c3bdb3;
  --ink-faint: #8a8176;
  --line: #161512;
  --green: #4c9c37;
  --green-bright: #19bf4f;
  --check-gray: #b0b1ac;
  --check-col: 48px;
  --page-width: 890px;
  --page-height: 1142px;
  --footer-height: 86px;
  --footer-main-row-height: 65px;
  --spread-bottom-height: 48px;
  --header-height: 72px;
  --viewport-block-size: 100vh;
  --body-font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.52), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.38), transparent 28%),
    linear-gradient(180deg, #fbf8ed 0%, #f9f4e5 34%, #f7f1e0 100%);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 18%, transparent 82%, rgba(160, 135, 74, 0.06)),
    repeating-linear-gradient(180deg, rgba(122, 103, 63, 0.015), rgba(122, 103, 63, 0.015) 1px, transparent 1px, transparent 6px);
  opacity: 0.45;
}

.app-shell {
  position: relative;
  min-height: var(--viewport-block-size);
  padding: 34px 0 42px;
}

.desk {
  width: 100%;
  max-width: 1934px;
  margin: 0 auto;
  padding: 0 3vw;
}

.spread {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: min(54px, 3vw);
  row-gap: 1px;
  position: relative;
}

.page {
  flex: 1;
  min-width: 0;
  max-width: var(--page-width);
  min-height: var(--page-height);
  height: auto;
  display: flex;
  flex-direction: column;
}

.page-note {
  display: flex;
  flex-direction: column;
  min-height: calc(var(--page-height) - var(--footer-height));
  height: auto;
  flex: 1 1 auto;
}

.page-header {
  /* height: var(--header-height); */
  display: flex;
  align-items: flex-start;
}

.page-header-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  width: 100%;
  padding-top: 2px;
}

.page-header-row-actions {
  justify-content: space-between;
  padding-right: var(--check-col);
}

.page-header-spacer .page-header-row {
  justify-content: flex-start;
}

.date-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.date-trigger:hover {
  opacity: 0.92;
}

.calendar-popover {
  position: absolute;
  top: 50px;
  left: 0;
  z-index: 30;
}

.calendar-panel {
  width: 268px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(102, 80, 35, 0.32);
  background: rgba(252, 249, 239, 0.98);
  box-shadow: 0 18px 32px rgba(72, 54, 18, 0.18);
  backdrop-filter: blur(5px);
}

.calendar-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-nav-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(80, 107, 62, 0.28);
  background: rgba(240, 234, 212, 0.92);
  color: #27401f;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.calendar-nav-button:hover:not(:disabled) {
  background: rgba(232, 226, 201, 0.98);
}

.calendar-nav-button:focus-visible,
.calendar-day:focus-visible {
  outline: 2px solid rgba(31, 111, 221, 0.4);
  outline-offset: 1px;
}

.calendar-nav-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.calendar-month-label {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.calendar-weekdays {
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  color: #7a6b56;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 0;
}

.calendar-day {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #15130f;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
}

.calendar-day:hover:not(:disabled) {
  background: rgba(76, 156, 55, 0.08);
}

.calendar-day::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.calendar-day.is-outside-month {
  color: #9e978b;
}

.calendar-day.is-empty::after {
  border: 1px solid rgba(132, 118, 97, 0.72);
  background: transparent;
}

.calendar-day.has-entry {
  color: #23401b;
  font-weight: 700;
}

.calendar-day.has-entry::after {
  background: #4c9c37;
}

.calendar-day.is-future,
.calendar-day:disabled {
  color: #bfb8ab;
  cursor: default;
}

.calendar-day.is-future::after,
.calendar-day:disabled::after {
  display: none;
}

.calendar-day.is-selected {
  border-color: #1f6fdd;
  background: #1f6fdd;
  color: #fff;
  font-weight: 700;
}

.calendar-day.is-selected::after {
  background: rgba(255, 255, 255, 0.92);
  border-color: transparent;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(110, 96, 73, 0.18);
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #655a4d;
  font-size: 12px;
  line-height: 1;
}

.calendar-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.calendar-legend-dot-filled {
  background: #4c9c37;
}

.calendar-legend-dot-empty {
  border: 1px solid rgba(132, 118, 97, 0.72);
}

.calendar-legend-dot-future {
  background: rgba(191, 184, 171, 0.7);
}

.date-trigger:focus-visible,
.today-clone-button:focus-visible,
.note-action-button:focus-visible,
.history-close-button:focus-visible,
.task-spotlight-toggle:focus-visible,
.task-check:focus-visible,
.task-text:focus-visible {
  outline: 2px solid rgba(76, 156, 55, 0.45);
  outline-offset: 2px;
}

.date-spacer {
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  visibility: hidden;
}

.hidden-date-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.today-clone-button {
  min-width: 128px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(89, 75, 22, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  color: #2b2308;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.today-clone-button:hover {
  background: linear-gradient(180deg, #fdf8e6, #f2e7c3);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.is-hidden {
  display: none !important;
}

.page-field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.section-rule {
  height: 3px;
  margin-right: var(--check-col);
  margin-bottom: 3px;
  background: var(--green);
}

.section-rule-bottom {
  margin-top: 3px;
  margin-bottom: 0;
}

.task-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--check-col);
  align-items: start;
  width: 100%;
  cursor: default;
}

.task-line {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-height: 39px;
  padding: 2px 0 5px;
  border-bottom: 2px solid var(--line);
}

.task-index {
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
  text-align: center;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.02em;
}

.task-spotlight-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid rgba(179, 155, 86, 0.72);
  border-radius: 50%;
  background: #f7f2dd;
  color: #a29166;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
}

.task-spotlight-toggle:not(.is-active)::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.task-spotlight-toggle:hover {
  background: #f4ebc8;
}

.task-spotlight-toggle.is-active {
  border-color: rgba(183, 131, 23, 0.78);
  background: linear-gradient(180deg, #f5d786, #ebbd4a);
  color: #74570d;
  box-shadow: 0 2px 8px rgba(182, 132, 11, 0.2);
}

.task-text {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.03em;
  white-space: pre-wrap;
  word-break: break-all;
  outline: none;
  cursor: text;
}

.task-category-chip {
  display: inline-flex;
  align-items: center;
  max-width: min(210px, 100%);
  margin: 0 4px 0 0;
  padding: 2px 5px 2px;
  border: 1px solid rgba(41, 103, 56, 0.28);
  border-radius: 3px;
  background: rgba(210, 234, 200, 0.72);
  color: #2c6a35;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  vertical-align: baseline;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-row.is-editing .task-category-chip {
  display: none;
}

.task-text[contenteditable="true"]:empty::before {
  content: "";
}

.task-check {
  width: 30px;
  min-height: 39px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--check-gray);
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.task-row.is-spotlight .task-check {
  font-size: 19px;
}

.task-check:hover {
  background: rgba(0, 0, 0, 0.035);
}

.status-done .task-index,
.status-done .task-text,
.status-core_done .task-index,
.status-core_done .task-text {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1.3px;
  text-decoration-color: rgba(146, 141, 134, 0.92);
  text-decoration-skip-ink: none;
}

.status-done .task-check {
  color: var(--green-bright);
}

.status-core_done .task-check {
  color: #b8860b;
  font-size: 26px;
  font-weight: 900;
}

.task-row.is-spotlight .task-line {
  background: rgba(255, 225, 132, 0.76);
  box-shadow: inset 4px 0 0 rgba(214, 148, 8, 0.82);
}

.task-row.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.task-row.is-reorder-ready {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.task-row.is-reorder-ready .task-line,
.task-row.is-reorder-ready .task-index,
.task-row.is-reorder-ready .task-text,
.task-row.is-reorder-ready .task-category-chip,
.task-row.is-reorder-ready .task-check,
.task-row.is-reorder-ready .task-spotlight-toggle {
  cursor: grab;
  pointer-events: none;
}

.task-row.is-reorder-ready .task-text {
  user-select: none;
  -webkit-user-select: none;
}

.task-row.is-reorder-ready .task-check:disabled,
.task-row.is-reorder-ready .task-spotlight-toggle:disabled {
  opacity: 1;
}

.task-row.is-reorder-ready:hover {
  background: rgba(0, 0, 0, 0.02);
}

.task-row.drop-indicator-top .task-line {
  box-shadow: 0 -2px 0 0 var(--line);
}

.task-row.drop-indicator-bottom .task-line {
  box-shadow: 0 2px 0 0 var(--line);
}

.blank-row {
  height: 39px;
  margin-right: var(--check-col);
  border-bottom: 2px solid var(--line);
}

.blank-row.blank-row-interactive {
  cursor: default;
}

.blank-row.blank-row-interactive:hover {
  background: rgba(0, 0, 0, 0.02);
}

.page-footer {
  min-height: var(--footer-height);
  height: auto;
}

.page-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.page-footer-status {
  display: flex;
  align-items: center;
}

.page-footer-status-mobile-anchor {
  display: none;
}

.footer-button-row {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
  width: 100%;
  min-height: var(--footer-main-row-height);
  padding: 0 var(--check-col) 0 0;
}

.save-status {
  position: static;
  padding: 0;
  min-height: var(--footer-main-row-height);
  border: 0;
  background: transparent;
  color: #5a4e2f;
  font-size: 19px;
  font-weight: 600;
  display: flex;
  align-items: center;
  line-height: 1.35;
  letter-spacing: -0.02em;
  pointer-events: none;
  text-align: left;
}

.save-status[data-save-status="connecting"],
.save-status[data-save-status="saving"] {
  /* border-color: rgba(139, 103, 20, 0.34); */
  /* background: rgba(245, 232, 180, 0.6); */
  color: #725718;
}

.save-status[data-save-status="saved"],
.save-status[data-save-status="ready"] {
  /* border-color: rgba(36, 113, 54, 0.24); */
  /* background: rgba(223, 240, 214, 0.7); */
  color: #265f33;
}

.save-status[data-save-status="error"],
.save-status[data-save-status="conflict"] {
  /* border-color: rgba(151, 54, 49, 0.28); */
  /* background: rgba(250, 228, 224, 0.7); */
  color: #8e2f2c;
}

.note-action-button {
  min-width: 120px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(89, 75, 22, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  color: #2b2308;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.note-action-button-wide {
  min-width: 150px;
}

.note-action-button:hover,
.history-close-button:hover {
  background: linear-gradient(180deg, #fdf8e6, #f2e7c3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.note-action-button.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.note-action-button.is-disabled:hover {
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  transform: none;
  box-shadow: none;
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    16px
    calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 29, 12, 0.24);
}

.history-panel {
  position: relative;
  width: 1040px;
  height: min(
    784px,
    calc(
      var(--viewport-block-size)
      - env(safe-area-inset-top, 0px)
      - env(safe-area-inset-bottom, 0px)
      - 24px
    )
  );
  max-height: 100%;
  padding: 28px 40px 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 14%),
    linear-gradient(180deg, #f4ecd4 0%, #f0e6c8 100%);
  box-shadow: 0 24px 54px rgba(72, 54, 18, 0.18);
  border: 1px solid rgba(102, 80, 35, 0.14);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.history-header-actions {
  display: flex;
  gap: 12px;
}

.history-title {
  margin: 0;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.history-title-small {
  font-size: 0.75em;
  font-weight: 500;
  margin-left: 5px;
}

.history-close-button {
  min-width: 85px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(89, 75, 22, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  color: #2b2308;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.history-body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 78px);
}

.history-rule {
  height: 3px;
  background: var(--green);
}

.history-rule-bottom {
  margin-top: auto;
}

.history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.long-term-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.history-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 47px;
  border-bottom: 2px solid var(--line);
}

/* Long term list specific adjustments */
.long-term-list .task-row {
  grid-template-columns: 1fr;
}

.long-term-list .task-line {
  padding-right: 4px; /* subtle padding at the end */
}

.long-term-list .blank-row {
  margin-right: 0;
}

.task-row.no-controls .task-line {
  padding-left: 12px;
}

.task-row.no-controls .task-index {
  flex: 0 0 38px;
  width: 38px;
}


.history-date,
.history-text {
  padding: 9px 0 7px;
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.03em;
}

.history-date {
  padding-left: 14px;
  font-weight: 600;
}

.history-text {
  padding-right: 12px;
  word-break: break-all;
}

.history-empty {
  padding: 18px 14px 0;
  color: var(--ink-faint);
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.03em;
}

.startup-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(30, 24, 16, 0.42);
}

.startup-error-card {
  width: min(560px, calc(100vw - 48px));
  padding: 30px 32px 34px;
  border: 1px solid rgba(92, 69, 34, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 14%),
    linear-gradient(180deg, #f6eed8 0%, #f0e5c7 100%);
  box-shadow: 0 28px 60px rgba(50, 36, 15, 0.24);
}

.startup-error-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.startup-error-text {
  margin: 0 0 12px;
  color: #5a4d37;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.02em;
}

.startup-error-button {
  min-width: 132px;
  height: 50px;
  margin-top: 12px;
  padding: 0 18px;
  border: 3px solid #12110d;
  background: #ecdca0;
  color: #16120d;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.startup-error-button:hover {
  background: #efe2b0;
}

.measure-layer {
  position: fixed;
  top: 0;
  left: -20000px;
  visibility: hidden;
  pointer-events: none;
}

/* Conflict Resolution UI Styling */
.conflict-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conflict-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 29, 12, 0.45);
  backdrop-filter: blur(3px);
}

.conflict-panel {
  position: relative;
  width: 1120px;
  max-width: 95vw;
  height: 820px;
  max-height: 95vh;
  padding: 32px 42px;
  background: linear-gradient(180deg, #f9f5e8 0%, #f4e8c9 100%);
  border: 1px solid rgba(132, 112, 63, 0.4);
  box-shadow: 0 32px 74px rgba(62, 44, 8, 0.25);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

.conflict-header {
  margin-bottom: 22px;
}

.conflict-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: #8b3a3a;
  letter-spacing: -0.03em;
}

.conflict-subtitle {
  margin: 0;
  color: #6a5e4b;
  font-size: 16px;
}

.conflict-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid rgba(154, 137, 94, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.conflict-row-headers {
  display: flex;
  background: rgba(226, 214, 180, 0.45);
  border-bottom: 1px solid rgba(154, 137, 94, 0.25);
  font-size: 15px;
  font-weight: 700;
  color: #4a3f2b;
}

.col-asis, .col-tobe {
  flex: 1;
  padding: 14px 18px;
}

.col-asis {
  border-right: 1px solid rgba(154, 137, 94, 0.25);
}

.conflict-rows-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.conflict-row {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px dashed rgba(154, 137, 94, 0.3);
}
.conflict-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.row-asis {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row-tobe {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fcfbf8;
  border: 1px solid rgba(220, 206, 169, 0.4);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.conflict-reason {
  background: #f2ebd9;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #6a5e4b;
  border-bottom: 1px solid rgba(220, 206, 169, 0.4);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.tobe-editor {
  flex: 1;
  width: 100%;
  min-height: 80px;
  padding: 14px;
  outline: none;
  font-size: 16px;
  line-height: 1.6;
  color: #27241e;
  word-break: break-all;
  white-space: pre-wrap;
}

.tobe-editor:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(76, 156, 55, 0.45);
}

.deleted-text {
  text-decoration: line-through;
  color: #9c9586;
}


.conflict-asis-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fdfaf3;
  border: 1px solid rgba(220, 206, 169, 0.6);
  border-left: 4px solid #da9d41;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.conflict-asis-item.conflict-delete { border-left-color: #d85c5c; }
.conflict-asis-item.conflict-create { border-left-color: #51a43a; }

.asis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(100, 85, 50, 0.1);
  color: #554832;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.device-chip-server { background: rgba(56, 114, 201, 0.12); color: #204b8e; }
.device-chip-local { background: rgba(199, 126, 42, 0.15); color: #8e5513; }

.action-badge {
  font-size: 12px;
  font-weight: 700;
  color: #927f5c;
}

.asis-content {
  font-size: 16px;
  color: #161512;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.conflict-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(132, 112, 63, 0.2);
}

.conflict-confirm-btn {
  background: linear-gradient(180deg, #d4edc5, #aed293);
  color: #1e4b0e;
  border-color: rgba(54, 114, 26, 0.4);
}
.conflict-confirm-btn:hover {
  background: linear-gradient(180deg, #e4f4da, #c2e2ab);
}

/* Responsive adjustments for Tablets/Laptops */
@media (max-width: 1440px) {
  :root {
    --check-col: 38px;
  }

  .task-text {
    font-size: 17px;
  }

  .task-index {
    flex: 0 0 30px;
    width: 30px;
    font-size: 16px;
    padding: 0;
  }

  .history-panel {
    width: 90vw;
    height: min(
      calc(var(--viewport-block-size) * 0.85),
      calc(
        var(--viewport-block-size)
        - env(safe-area-inset-top, 0px)
        - env(safe-area-inset-bottom, 0px)
        - 24px
      )
    );
    padding: 24px;
  }

  .history-text {
    font-size: 17px;
  }
}

/* Responsive adjustments for Mobile (Merge 2 pages into 1 scrolling column) */
@media (max-width: 1100px) {
  :root {
    --page-height: 1713px;
    --check-col: 30px;
  }

  .app-shell {
    padding: 10px 0 20px;
  }

  .desk {
    padding: 0 16px;
  }

  .spread {
    flex-direction: column;
    align-items: center;
    gap: 0;
    /* No gap so it looks like 1 continuous piece of paper */
  }

  /* Make pages full width */
  .page {
    width: 100%;
    max-width: 100%;
    /* 기존 PC용 min-height(--page-height)가 모바일 빈 공간을 만들지 않도록 해제 */
    min-height: 0;
    /* 모바일에서는 콘텐츠에 맞게 자연스럽게 높이 조정 */
    height: auto;
  }

  /* 모바일 전용: page-note도 PC용 min-height(calc(--page-height - --footer-height))를 해제 */
  .page-note {
    min-height: 0;
    height: auto;
  }

  /* 모바일 전용: page-field가 flex로 남은 높이를 강제 확장하지 않도록 콘텐츠 높이만 사용 */
  .page-field {
    flex: 0 0 auto;
  }

  /* 모바일에서 본문 좌/우 페이지 task-list는 JS가 설정한 높이만 가지도록 유지 */
  /* (모달 내부 long-term-list까지 영향을 주지 않도록 대상 범위를 한정한다) */
  #leftPageList,
  #rightPageList {
    flex: none;
  }

  /* Hide the right page's top spacer/header so it connects seamlessly to the bottom of the left page */
  .page-right .page-header-spacer {
    display: none;
  }

  /* Remove the dividing line between the two pages to make it seamless */
  .page-left .page-field .section-rule-bottom,
  .page-right .page-field .section-rule:first-child {
    display: none;
  }

  /* Fix footer bottom buttons alignment for mobile */
  .page-footer-actions {
    height: auto;
    justify-content: center;
  }

  .page-left .page-footer-status {
    display: none;
  }

  .page-footer-status-mobile-anchor {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer-button-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 24px 0 0;
    width: 100%;
  }

  .save-status {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    min-height: var(--footer-main-row-height);
    margin-right: 0;
    transform: none;
    text-align: center;
  }

  .note-action-button {
    width: 100%;
    flex: none;
    font-size: 16px;
    padding: 0 12px;
    min-width: 0;
    height: 52px;
  }

  .footer-actions-wrapper {
    width: 100%;
    margin: 0 auto;
  }

  #reorderToggleBtn {
    display: none;
  }

  #longTermReorderBtn {
    display: none;
  }

  .task-row {
    cursor: default;
  }

  /* Make history panel responsive */
  .history-panel {
    width: calc(100vw - 32px);
    height: min(
      calc(var(--viewport-block-size) - 40px),
      calc(
        var(--viewport-block-size)
        - env(safe-area-inset-top, 0px)
        - env(safe-area-inset-bottom, 0px)
        - 24px
      )
    );
    padding: 20px 16px 20px;
  }

  .history-title {
    font-size: 16px;
  }

  .history-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .history-date {
    font-size: 16px;
    padding-left: 6px;
  }

  .history-text {
    font-size: 16px;
  }
}

@supports (height: 100dvh) {
  :root {
    --viewport-block-size: 100dvh;
  }
}

/* Login & Search UI */
.login-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; }
.login-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.login-panel { position: relative; background: var(--paper); border: 2px solid var(--ink-soft); border-radius: 12px; width: 340px; padding: 32px; box-shadow: 0 12px 48px rgba(0,0,0,0.15); z-index: 10000; }
.login-title { font-size: 17px; font-weight: 600; margin: 0 0 24px 0; text-align: center; color: var(--ink); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-input { padding: 14px; border: 1px solid var(--ink-soft); border-radius: 6px; font-size: 15px; background: var(--paper-deep); color: var(--ink); outline: none; transition: border-color 0.2s; }
.login-input:focus { border-color: var(--green); }
.login-submit-btn { background: var(--green) !important; color: white !important; font-weight: 600; padding: 14px !important; }

.search-container { margin-left: auto; margin-right: 12px; }
.global-search-input { width: 270px; padding: 6px 14px; border: 1.5px solid var(--ink-soft); border-radius: 20px; font-size: 13px; background: rgba(255,255,255,0.3); color: var(--ink); outline: none; transition: border-color 0.2s ease, background 0.2s ease; }
.global-search-input:focus { border-color: var(--green); background: rgba(255,255,255,0.7); }



.search-results-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }

/* Footer Account Actions Stack */
.footer-actions-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.spread-bottom-actions {
  width: 100%;
  flex: 0 0 100%;
}

.footer-account-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 var(--check-col) 0 0;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--spread-bottom-height);
  justify-content: flex-end;
}

.footer-account-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-menu-anchor {
  position: relative;
  display: inline-flex;
}

.account-profile-btn {
  background: none;
  border: none;
  padding: 0;
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.account-popover {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 238px;
  padding: 10px;
  border: 1px solid rgba(89, 75, 22, 0.34);
  border-radius: 10px;
  background: #f7f0d7;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  z-index: 40;
  transform-origin: bottom left;
  animation: accountBubble 0.16s ease-out;
}

.ui-green-divider {
  height: 3px;
  background: var(--green);
}

.account-popover::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 100%;
  width: 10px;
  height: 10px;
  background: #f7f0d7;
  border-right: 1px solid rgba(89, 75, 22, 0.34);
  border-bottom: 1px solid rgba(89, 75, 22, 0.34);
  transform: rotate(45deg) translate(-2px, -2px);
}

.account-popover.is-hidden {
  display: none;
}

.account-popover-title,
.account-popover-provider {
  margin: 0;
  color: #2b2308;
  line-height: 1.35;
}

.account-popover-title {
  font-size: 18px;
  font-weight: 700;
}

.account-popover-provider {
  margin-top: 4px;
  font-size: 17px;
  color: rgba(43, 35, 8, 0.82);
}

.account-provider-logo {
  display: inline-flex;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.13em;
  margin: 0 4px 0 2px;
}

.account-provider-logo svg,
.account-provider-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.account-provider-logo img {
  border-radius: 3px;
}

.account-linked-accounts {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(89, 75, 22, 0.12);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-linked-accounts-label {
  font-size: 11px;
  font-weight: 700;
  color: #8a6b56;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-linked-accounts-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-linked-account-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.45);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.account-popover-recent {
  margin: 0;
  font-size: 17px;
  color: rgba(43, 35, 8, 0.76);
}

.account-popover-secondary-btn {
  width: 100%;
  border: 1px solid rgba(54, 114, 26, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #f6ffe5 0%, #eaf8ca 100%);
  color: #294013;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
}

.account-popover-secondary-btn:hover {
  background: linear-gradient(180deg, #f8ffe9 0%, #def0b8 100%);
}

.account-popover-divider {
  margin-top: -2px;
}

.account-popover-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 2px;
}

.account-popover-logout-btn {
  padding: 0;
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
}

.account-popover-logout-btn:hover {
  text-decoration: underline;
}

.account-popover-delete-btn {
  border: none;
  background: none;
  color: #6b4f4a;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.account-popover-delete-btn:hover {
  text-decoration: underline;
}

.account-profile-btn:focus-visible,
.account-popover-secondary-btn:focus-visible,
.account-popover-logout-btn:focus-visible,
.account-popover-delete-btn:focus-visible {
  outline: 2px solid rgba(54, 114, 26, 0.6);
  outline-offset: 2px;
}


.account-popover {
  min-width: 320px;
  padding: 14px;
  gap: 10px;
}

.account-popover-title { font-size: 17px; }
.account-popover-provider { font-size: 16px; margin: 6px 0 2px; }

.account-popover-row-btn {
  width: 100%; display:flex; align-items:center; justify-content:space-between;
  border: 1px solid rgba(89,75,22,.2); border-radius: 14px; background:#f9f6ee;
  padding: 12px 14px; font: inherit; font-size: 17px; font-weight: 600; color:#1f1f1f; cursor:pointer;
}
.account-popover-row-left { display:flex; align-items:center; gap:12px; }
.account-popover-row-emoji { font-size: 16px; line-height: 1; }
.account-popover-row-arrow { font-size: 18px; color:#333; transition: transform .18s ease; }

.account-popover-account-box,
.account-popover-settings-box {
  border: 1px solid rgba(89,75,22,.2); border-radius: 16px; padding: 10px; background: #f9f6ee;
}
.account-popover-account-head,
.account-popover-settings-head { border: none; background: transparent; padding: 6px 6px 10px; border-radius: 10px; }
.account-popover-account-head:hover,
.account-popover-settings-head:hover { background: rgba(255,255,255,.65); }

.account-popover-secondary-btn { border-radius: 12px; padding: 10px 12px; font-size: 16px; margin-top: 6px; }
.account-popover-delete-btn { margin-top: 8px; font-size: 16px; color: #d24f43; }
.account-popover-footer { justify-content: flex-end; }
.account-popover-logout-btn { font-size: 16px; color:#1f6ebb; font-weight:600; }

.account-popover-settings-content { margin-top: 6px; display:flex; flex-direction:column; gap: 8px; }
.account-popover-settings-content.is-hidden { display:none; }
.account-popover-settings-box.is-open .account-popover-row-arrow { transform: rotate(90deg); }
.account-popover-settings-box.is-open #accountSettingsArrow { transform: rotate(90deg); }
.account-popover-settings-box.is-open .account-popover-settings-head .account-popover-row-arrow { transform: rotate(90deg); }

.account-popover-settings-content .account-settings-item {
  background: #fff; border:1px solid rgba(89,75,22,.2); border-radius: 10px; padding: 8px 10px; font-size: 17px;
}
.account-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.account-tutorial-overlay.is-hidden {
  display: none;
}
.account-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.account-settings-overlay.is-hidden {
  display: none;
}

.account-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.45);
  backdrop-filter: blur(1px);
}

.account-settings-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #fbf8ed 0%, #f6f1e1 100%);
  border: 1px solid rgba(132, 118, 97, 0.28);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(72, 54, 18, 0.22);
  display: flex;
  flex-direction: column;
  padding: 24px 26px 18px;
}

.account-settings-list {
  display: grid;
  gap: 12px;
}

.account-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  color: #30270d;
}

.account-tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.45);
  backdrop-filter: blur(1px);
}

.account-tutorial-modal {
  position: relative;
  width: 100%;
  max-width: 735px; /* Reduced from 980px (-25%) */
  max-height: min(880px, calc(var(--viewport-block-size) - 48px));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 16%),
    linear-gradient(180deg, #fbf8ed 0%, #f6f1e1 100%);
  border: 1px solid rgba(132, 118, 97, 0.28);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(72, 54, 18, 0.22);
  display: flex;
  flex-direction: column;
  padding: 24px 34px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.account-tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.account-tutorial-title {
  margin: 0 0 0 4px;
  font-size: 22px;
  color: #2f250a;
}

.account-tutorial-close {
  min-width: 72px;
  font-size: 18px;
  padding: 8px 14px;
}

.account-tutorial-divider {
  margin-bottom: 20px;
}

.account-tutorial-list {
  margin: 0;
  padding: 0 0 20px 30px;
  color: #30270d;
  display: grid;
  gap: 12px;
  line-height: 1.5;
  font-size: 17px;
}

.account-tutorial-list li {
  padding-right: 0;
}

.account-tutorial-item-text {
  margin: 0;
  padding-left: 4px;
  overflow-wrap: anywhere;
}

.tutorial-demo-sample {
  margin-top: 8px;
  border: 1px solid rgba(89, 75, 22, 0.24);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 254, 246, 0.75);
  font-size: 15px;
  width: 100%;
  overflow: hidden;
}

@media (min-width: 1101px) {
  .tutorial-demo-sample,
  .tutorial-demo-social-link-wrap {
    width: 320px !important;
  }
}

.tutorial-demo-sample.tutorial-demo-sample-unstyled {
  border: 0;
  background: transparent;
  padding: 6px 0 0;
}

.tutorial-demo-caption {
  margin-bottom: 6px;
  color: #5f5540;
}

.tutorial-demo-subtext {
  padding: 6px 8px 2px;
  color: #5f5540;
  font-size: 14px;
}

.tutorial-demo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(22, 21, 18, 0.2);
}

.tutorial-demo-row:last-child {
  border-bottom: 0;
}

.tutorial-demo-row.is-highlight {
  background: rgba(255, 225, 132, 0.76);
  box-shadow: inset 3px 0 0 rgba(214, 148, 8, 0.82);
}

.tutorial-demo-row.is-done .demo-text {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.tutorial-demo-double-check.is-core-done .demo-double-check-btn {
  color: #c99708;
}

.tutorial-demo-double-check {
  justify-content: flex-start;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.demo-check {
  color: #7f7f7a;
  font-weight: 700;
}

.demo-spotlight-toggle,
.demo-sort-btn,
.demo-double-check-btn {
  border: 1px solid rgba(89, 75, 22, 0.4);
  border-radius: 6px;
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  cursor: pointer;
  font: inherit;
}

.demo-spotlight-toggle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f7f2dd;
  color: #a29166;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 1px 0;
  overflow: hidden;
  flex: 0 0 28px;
  cursor: pointer;
}

.demo-spotlight-toggle:not(.is-active)::before {
  content: "";
  display: block;
  width: 54%;
  height: 54%;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.demo-spotlight-toggle.is-active {
  border-color: rgba(185, 131, 23, 0.72);
  background: linear-gradient(180deg, #f5d786, #ebbd4a);
  color: #74570d;
  box-shadow: 0 2px 8px rgba(182, 132, 11, 0.18);
}

.tutorial-demo-sort-head,
.tutorial-demo-chip-head {
  margin-bottom: 6px;
}

.tutorial-demo-chip-head.is-hidden,
.demo-chip-preview.is-hidden {
  display: none;
}

.demo-chip-preview {
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.demo-recreate-sort-btn {
  min-width: 96px; /* 120 * 0.8 */
  height: 37px;    /* 46 * 0.8 */
  padding: 0 14px; /* 18 * 0.8 */
  border: 1px solid rgba(89, 75, 22, 0.4);
  border-radius: 6px; /* 8 * 0.8 */
  background: linear-gradient(180deg, #f7eec5, #ecdca0);
  color: #2b2308;
  font: inherit;
  font-size: 14.4px; /* 18 * 0.8 */
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.demo-recreate-sort-btn:hover {
  background: linear-gradient(180deg, #fdf8e6, #f2e7c3);
  transform: translateY(-1.6px); /* 2 * 0.8 */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.tutorial-demo-sort-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.tutorial-demo-sort-container .tutorial-demo-sample {
  margin-top: 0;
}

.tutorial-demo-sort-list {
  border-top: 1px solid rgba(22, 21, 18, 0.2);
}

.tutorial-demo-sort-sample-box {
  background: rgba(250, 248, 236, 0.96);
}

.tutorial-demo-sort-sample-box .tutorial-demo-row {
  background: transparent;
}

.demo-chip-input {
  width: 70%;
  max-width: 320px;
  margin-right: 8px;
  border: 1px solid rgba(89, 75, 22, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
}

.demo-chip {
  display: inline-flex;
  border: 1px solid rgba(41, 103, 56, 0.28);
  background: rgba(210, 234, 200, 0.72);
  color: #2c6a35;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
}



.demo-double-check-btn {
  border: 0;
  background: transparent;
  border-radius: 0;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  font-size: 21px;
  font-weight: 700;
  padding: 0;
}

.demo-double-check-btn.is-gray {
  color: #8e8c84;
}

.demo-double-check-btn.is-green {
  color: var(--green-bright);
}

.demo-double-check-btn.is-gold {
  color: #c99708;
  font-weight: 900;
}

.tutorial-demo-double-check-container {
  margin-top: 8px;
}

.tutorial-demo-double-check-box {
  margin-top: 0 !important;
}

.tutorial-demo-double-check-box .tutorial-demo-row .demo-text,
.tutorial-demo-carry-box .tutorial-demo-row .demo-text {
  flex: 1 1 auto;
}

.tutorial-demo-double-check-box .demo-double-check-btn,
.demo-check-align-right {
  margin-left: auto;
  margin-right: 6px;
}

.tutorial-demo-calendar {
  border: 1px solid rgba(89, 75, 22, 0.22);
  border-radius: 8px;
  padding: 8px 8px 10px;
  background: #f6f1e1;
}

.tutorial-demo-calendar-date {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.tutorial-demo-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #2f250a;
  font-weight: 700;
}

.tutorial-demo-calendar-nav {
  border: 1px solid rgba(89, 75, 22, 0.3);
  background: #eee6c4;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  line-height: 1;
  padding: 0;
  color: #3d6636;
}

.tutorial-demo-calendar-weekdays,
.tutorial-demo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.tutorial-demo-calendar-weekdays {
  font-size: 11px;
  color: #6a6048;
  margin-bottom: 4px;
  text-align: center;
}

.tutorial-demo-calendar-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 5px;
  background: #f6f1e1;
  position: relative;
  font-size: 12px;
  color: #234a2a;
  border: 0;
}

.tutorial-demo-calendar-day.has-entry::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 0;
  background: #4c9c37;
  transform: translateX(-50%);
}

.tutorial-demo-calendar-day.is-empty::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(132, 118, 97, 0.72);
  background: transparent;
  transform: translateX(-50%);
}

.tutorial-demo-calendar-day.is-outside {
}

.tutorial-demo-calendar-day.is-selected {
  background: #2e73d9;
  color: #fff;
  font-weight: 700;
}

.tutorial-demo-calendar-divider {
  height: 1px;
  background: rgba(110, 96, 73, 0.18);
  margin: 12px 0 10px;
}

.tutorial-demo-calendar-legend {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #655a4d;
}

.tutorial-demo-calendar-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-demo-calendar-legend .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tutorial-demo-calendar-legend .legend-dot.has-entry {
  background: #4c9c37;
}

.tutorial-demo-calendar-legend .legend-dot.is-empty {
  border: 1px solid rgba(132, 118, 97, 0.72);
}

.tutorial-demo-carry-box-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.tutorial-demo-carry-box {
  width: fit-content !important;
  margin-top: 0 !important;
  padding: 6px 12px !important;
}

.tutorial-demo-carry-box .tutorial-demo-row {
  padding: 0;
  border-bottom: 0;
}

.tutorial-demo-carry-extra {
  font-size: 15px; /* Match sample text size as requested */
  color: #5f5540;
}

.tutorial-demo-calendar-day.is-selected.has-entry::after {
  background: rgba(255, 255, 255, 0.9);
}

.tutorial-demo-social-link-wrap {
  border: 1px solid rgba(128, 189, 111, 0.8);
  border-radius: 8px;
  background: rgba(235, 247, 214, 0.72);
  padding: 10px 12px;
}

.tutorial-demo-social-link {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: #1f4f8f;
  text-decoration: none;
}

.tutorial-demo-social-link:hover {
  text-decoration: underline;
}

.demo-sort-btn {
  color: #171512;
}

.footer-account-divider {
  width: 100%;
  height: 1.5px;
  background-color: var(--ink-soft);
  opacity: 0.3;
  margin-bottom: 6px;
}

.account-logout-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.01em;
  text-align: right;
}

.account-logout-btn:hover {
  text-decoration: underline;
}

@keyframes accountBubble {
  from {
    transform: translateY(6px) scale(0.96);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .spread-bottom-actions {
    margin-top: 10px;
  }

  .footer-account-actions {
    padding: 0;
  }

  .account-tutorial-modal {
    width: min(540px, calc(100% - 20px));
    padding: 14px 14px 12px;
  }

  .account-tutorial-close {
    min-width: 62px;
    font-size: 16px;
    padding: 6px 10px;
  }

  .tutorial-demo-calendar-date {
    font-size: 17px;
  }

  /* Mobile-specific tutorial refinements */
  .tutorial-demo-sample,
  .tutorial-demo-social-link-wrap {
    width: 92% !important; /* Slightly narrower than 100% for better air/balance */
  }

  .tutorial-demo-sort-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .tutorial-demo-sort-container .tutorial-demo-sample {
    width: 92% !important;
    margin-left: 0;
  }

  .demo-recreate-sort-btn {
    align-self: flex-end;
    margin-right: 8%; /* Align with the 92% width box above */
  }

  .tutorial-demo-carry-box-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

.perf-report-overlay.is-hidden {
  display: none;
}

.perf-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.perf-report-panel {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  margin: min(80px, 8vh) auto 0;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(89, 75, 22, 0.26);
  background: #fffbe9;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.perf-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.perf-report-title {
  margin: 0;
  font-size: 18px;
}

.perf-report-tags {
  margin: 8px 0 14px;
  color: rgba(43, 35, 8, 0.7);
  font-size: 13px;
}

.perf-report-table {
  width: 100%;
  border-collapse: collapse;
}

.perf-report-table th,
.perf-report-table td {
  border: 1px solid rgba(89, 75, 22, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
}

.perf-report-table th {
  background: #f7efd0;
}

.perf-total-row td,
.perf-net-row td {
  font-weight: 700;
}
