/* Buary (buary.com) - Analog Paper Diary Stylesheet */

:root {
  --desk-bg: #e4ddd2;
  --desk-bg-accent: #d6cdbf;
  --cover-bg: #4b362a;
  --cover-border: #694e3e;
  --cover-stitch: rgba(242, 224, 198, 0.35);
  --paper: #fdfbf6;
  --paper-alt: #f7f3ea;
  --line-color: #e7e0d2;
  --line-strong: #d4cab8;
  --ink: #2c2621;
  --ink-muted: #786f64;
  --ink-soft: #9d9387;
  --accent: #b85d3b;
  --accent-soft: #f5e4dc;
  --sun: #c94a4a;
  --sat: #426fa8;
  --font-ui: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-diary: 'Gowun Dodum', 'Pretendard', sans-serif;
  --font-serif: 'Gowun Batang', serif;
  --font-script: 'Caveat', cursive;
}

body[data-theme="leather"] {
  --cover-bg: #4b362a;
  --cover-border: #684d3d;
  --accent: #b85d3b;
}

body[data-theme="linen"] {
  --cover-bg: #8a7b68;
  --cover-border: #a39481;
  --accent: #8c5a3c;
}

body[data-theme="sage"] {
  --cover-bg: #465b4d;
  --cover-border: #5f7868;
  --accent: #4c7c62;
}

body[data-theme="midnight"] {
  --cover-bg: #293548;
  --cover-border: #3d4e69;
  --accent: #3d6599;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-ui);
  color: var(--ink);
  background: radial-gradient(circle at 50% 25%, var(--desk-bg) 0%, var(--desk-bg-accent) 100%);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ===========================
   AUTH SCREEN (Closed Cover Modal)
   =========================== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 14, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.auth-screen.hidden {
  display: none !important;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}
.auth-modal-close:hover {
  background: rgba(220, 50, 50, 0.85);
  transform: rotate(90deg);
}

.diary-cover-card {
  width: 100%;
  max-width: 430px;
  background: var(--cover-bg);
  border-radius: 14px 26px 26px 14px;
  padding: 14px;
  box-shadow:
    -8px 0 0 #33231a,
    0 24px 48px rgba(34, 23, 15, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.14);
  position: relative;
}

.cover-stitch {
  border: 1.5px dashed var(--cover-stitch);
  border-radius: 10px 20px 20px 10px;
  padding: 32px 28px 26px;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.12));
  color: #f8f2e9;
}

.cover-brand {
  text-align: center;
  margin-bottom: 24px;
}

.cover-year {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: #dfc8a9;
  margin-bottom: 6px;
}

.cover-brand h1 {
  font-family: var(--font-script);
  font-size: 54px;
  font-weight: 700;
  color: #f5dfb8;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  margin-bottom: 10px;
}

.cover-brand p {
  font-family: var(--font-diary);
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(248, 242, 233, 0.85);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.24);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: rgba(248, 242, 233, 0.72);
  padding: 9px 10px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 7px;
  transition: all 0.18s ease;
}

.auth-tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.auth-form {
  background: var(--paper);
  color: var(--ink);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefb;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  cursor: pointer;
}

.auth-error {
  background: #fdf0ee;
  border: 1px solid #ecc6c1;
  color: #b43c32;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: var(--cover-bg);
  color: #fdfbf6;
  font-size: 14.5px;
  font-weight: 700;
  transition: opacity 0.15s, transform 0.1s;
}

.auth-submit-btn:hover {
  opacity: 0.93;
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.cover-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(248, 242, 233, 0.65);
}

/* ===========================
   MAIN APP LAYOUT
   =========================== */
.app-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desk-topbar {
  height: 44px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-family: var(--font-script);
  font-size: 28px;
  font-weight: 700;
  color: var(--cover-bg);
  letter-spacing: 0.5px;
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
}

.theme-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.theme-dot[data-set-theme="leather"] { background: #4b362a; }
.theme-dot[data-set-theme="linen"] { background: #8a7b68; }
.theme-dot[data-set-theme="sage"] { background: #465b4d; }
.theme-dot[data-set-theme="midnight"] { background: #293548; }

.save-indicator {
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: 6px;
}

.user-badge {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  padding: 4px 10px;
  border-radius: 999px;
}

.topbar-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.65);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-muted);
}
.topbar-btn:hover {
  background: #fff;
  color: var(--ink);
}

.mobile-date-bar,
.mobile-bottom-nav {
  display: none;
}

/* ===========================
   OPEN TWO-PAGE DIARY SPREAD
   =========================== */
.diary-wrapper {
  flex: 1;
  min-height: 0;
  padding: 2px 88px 16px 20px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.diary-cover-frame {
  width: 100%;
  max-width: 1440px;
  background: var(--cover-bg);
  border: 2px solid var(--cover-border);
  border-radius: 18px;
  padding: 13px 14px;
  box-shadow:
    0 20px 45px rgba(32, 24, 17, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: visible;
  display: flex;
  min-height: 0;
}

.diary-spread {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 26px 1fr;
  background: var(--paper);
  border-radius: 10px;
  box-shadow:
    -3px 0 0 #ece6d9,
    3px 0 0 #ece6d9,
    0 4px 16px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
}

.diary-page {
  background: var(--paper);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.left-page {
  background: linear-gradient(to right, #fdfbf6 93%, #f3ede1 100%);
}

.right-page {
  background: linear-gradient(to left, #fdfbf6 93%, #f3ede1 100%);
}

/* Center Binder Spine */
.diary-spine {
  background: linear-gradient(
    90deg,
    #e5decfe0 0%,
    #cfc5b3 35%,
    #bfb39e 50%,
    #cfc5b3 65%,
    #e5decfe0 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  z-index: 3;
  border-left: 1px solid rgba(0,0,0,0.06);
  border-right: 1px solid rgba(0,0,0,0.06);
}

.spine-ring {
  width: 24px;
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(180deg, #f5f5f5 0%, #b2b2b2 48%, #7d7d7d 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* ===========================
   RIGHT PROTRUDING INDEX TABS
   =========================== */
.index-tabs {
  position: absolute;
  top: 135px;
  bottom: 24px;
  left: calc(100% - 15px);
  width: 104px;
  padding: 2px 6px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  overflow-y: auto;
  scrollbar-width: none;
}
.index-tabs::-webkit-scrollbar {
  display: none;
}

.index-tab {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-left: none;
  border-radius: 0 9px 11px 0;
  padding: 6px 10px 6px 14px;
  min-height: 30px;
  width: 88px;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: var(--font-diary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #383028;
  white-space: nowrap;
  box-shadow: 3px 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.14s ease, width 0.14s ease, box-shadow 0.14s ease;
  user-select: none;
}

.index-tab:hover {
  width: 92px;
}

.index-tab.active {
  background: var(--paper) !important;
  color: var(--accent);
  width: 96px;
  padding-left: 16px;
  z-index: 6;
  font-weight: 800;
  font-size: 12.5px;
  box-shadow: 4px 3px 9px rgba(0, 0, 0, 0.26);
}

.index-tab[data-tab-color="schedule"]    { background: #f5dfb8; }
.index-tab[data-tab-color="biz-ledger"]  { background: #fed8b1; }
.index-tab[data-tab-color="clients"]     { background: #d7e6f8; }
.index-tab[data-tab-color="tax"]         { background: #fcd5dc; }
.index-tab[data-tab-color="loans"]       { background: #ffe4c4; }
.index-tab[data-tab-color="inventory"]   { background: #cce9d6; }
.index-tab[data-tab-color="staff"]       { background: #e5daf7; }
.index-tab[data-tab-color="projects"]    { background: #d6e5d8; }
.index-tab[data-tab-color="ledger"]      { background: #f2cfcf; }
.index-tab[data-tab-color="diary"]       { background: #d5e2f2; }
.index-tab[data-tab-color="sage"]        { background: #cde0d1; }
.index-tab[data-tab-color="rose"]        { background: #f0ccd0; }
.index-tab[data-tab-color="amber"]       { background: #f5dbb0; }
.index-tab[data-tab-color="sky"]         { background: #c7dff2; }
.index-tab[data-tab-color="lavender"]    { background: #dcd0ee; }

.index-tab.add-tab-btn {
  min-height: 30px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* ===========================
   LEFT PAGE: CALENDAR + 4 MEMOS
   =========================== */
.calendar-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 6px;
}

.cal-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cal-month-num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.cal-year-sub {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.2;
  color: var(--ink-muted);
}

.cal-month-eng {
  font-weight: 700;
  letter-spacing: 1.2px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav-btn,
.cal-today-btn {
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12.5px;
  color: var(--ink);
}
.cal-nav-btn:hover,
.cal-today-btn:hover {
  background: var(--paper-alt);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  padding: 3px 0 5px;
  border-bottom: 1px solid var(--line-strong);
}
.calendar-weekdays .sun { color: var(--sun); }
.calendar-weekdays .sat { color: var(--sat); }

.calendar-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  border-left: 1px solid var(--line-color);
  border-bottom: 1px solid var(--line-color);
}

.cal-cell {
  border-right: 1px solid var(--line-color);
  border-top: 1px solid var(--line-color);
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s;
  position: relative;
}

.cal-cell:hover {
  background: rgba(184, 93, 59, 0.05);
}

.cal-cell.other-month {
  opacity: 0.33;
  background: rgba(0, 0, 0, 0.012);
}

.cal-cell.selected {
  background: #fbf1e4;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.cal-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.cal-cell.sun .cal-day-num { color: var(--sun); }
.cal-cell.sat .cal-day-num { color: var(--sat); }

.cal-cell.is-today .cal-day-num {
  background: var(--accent);
  color: #fff !important;
  border-radius: 99px;
  padding: 0 5px;
}

.cal-badges {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
}

.cal-lines {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  overflow: hidden;
  flex: 1;
}

.cal-mini-line {
  font-family: var(--font-diary);
  font-size: 10px;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #4b433b;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.07);
}

.cal-mini-line.done {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.cal-mini-line.sched {
  color: #7c4d2b;
}

.cal-mini-ledger {
  font-size: 9.5px;
  color: #b44b3e;
  text-align: right;
  margin-top: auto;
  font-weight: 600;
}

/* 4 Fixed Memo Boxes at Bottom of Left Page */
.memo-grid {
  margin-top: 10px;
  height: 152px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.memo-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.memo-card[data-color="cream"]    { background: #fcf8eb; }
.memo-card[data-color="rose"]     { background: #fdf1f2; }
.memo-card[data-color="mint"]     { background: #eff8f2; }
.memo-card[data-color="sky"]      { background: #eff5fb; }
.memo-card[data-color="lavender"] { background: #f5f1fb; }

.memo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.13);
  padding-bottom: 3px;
  margin-bottom: 4px;
  gap: 4px;
}

.memo-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-diary);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

.memo-color-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.memo-textarea {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-family: var(--font-diary);
  font-size: 11.5px;
  line-height: 18px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 17px,
    rgba(0, 0, 0, 0.06) 18px
  );
}

/* ===========================
   RIGHT PAGE INNER VIEWS
   =========================== */
.right-page-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- TAB 1: 일정 (Today + Time Table 2-Column Split) --- */
.schedule-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 0;
}

.today-col {
  padding-right: 14px;
  border-right: 1.5px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.today-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.today-script {
  font-family: var(--font-script);
  font-size: 38px;
  font-weight: 700;
  line-height: 0.95;
  color: var(--ink);
}

.today-date-sub {
  font-family: var(--font-diary);
  font-size: 12.5px;
  color: var(--ink-muted);
}

.today-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 6px;
  font-size: 12px;
}

.today-check-label {
  font-weight: 700;
  color: var(--ink);
}

.routine-toggle-btn {
  border: 1px solid var(--line-strong);
  background: #fffaf0;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-diary);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
}
.routine-toggle-btn:hover,
.routine-toggle-btn.open {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Routine Manager Drawer (반복메뉴) */
.routine-drawer {
  background: #faf5ea;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.routine-add-row {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.routine-add-row input {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.day-chips {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
}

.day-chip {
  flex: 1;
  padding: 3px 0;
  font-size: 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 5px;
  color: var(--ink-muted);
}
.day-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}

.routine-manage-list {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.routine-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 3px 4px;
  background: rgba(255,255,255,0.65);
  border-radius: 4px;
}

/* Quick Todo Add + Ruled Lines */
.todo-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line-strong);
  padding: 4px 2px;
}

.todo-add-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-diary);
  font-size: 13.5px;
  outline: none;
}

.todo-ruled-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.ruled-row {
  min-height: 31px;
  border-bottom: 1px solid var(--line-color);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  font-family: var(--font-diary);
  font-size: 13.5px;
}

.ruled-row.routine-row {
  background: rgba(245, 223, 184, 0.18);
}

.diary-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.routine-tag {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.todo-text-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-diary);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.todo-text-input.done,
.routine-label.done {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.routine-label {
  flex: 1;
  cursor: pointer;
}

.row-del-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 15px;
  padding: 0 4px;
  opacity: 0.45;
}
.ruled-row:hover .row-del-btn {
  opacity: 1;
  color: #c44c3e;
}

/* Right Column: Hourly Time Table */
.timetable-col {
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.timetable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 2px;
}

.timetable-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
}

.hour-range-btn {
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--ink-muted);
}

.timetable-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.hour-row {
  display: flex;
  align-items: center;
  min-height: 29px;
  border-bottom: 1px solid var(--line-color);
  padding: 1px 2px;
  gap: 6px;
}

.hour-row[data-hl="yellow"] { background: rgba(252, 233, 136, 0.36); }
.hour-row[data-hl="pink"]   { background: rgba(246, 187, 198, 0.34); }
.hour-row[data-hl="mint"]   { background: rgba(182, 232, 203, 0.36); }
.hour-row[data-hl="blue"]   { background: rgba(185, 216, 246, 0.36); }

.hour-num {
  width: 28px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: right;
  padding-right: 6px;
  border-right: 1px solid var(--line-strong);
  flex-shrink: 0;
  user-select: none;
}

.hour-num.noon {
  color: var(--accent);
}

.hour-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-diary);
  font-size: 12.5px;
  outline: none;
  min-width: 0;
}

.hl-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: transparent;
  opacity: 0.35;
  flex-shrink: 0;
}
.hour-row:hover .hl-btn,
.hour-row:not([data-hl=""]) .hl-btn {
  opacity: 0.95;
}
.hour-row[data-hl="yellow"] .hl-btn { background: #f4d44d; }
.hour-row[data-hl="pink"] .hl-btn   { background: #ec94a7; }
.hour-row[data-hl="mint"] .hl-btn   { background: #7dd1a0; }
.hour-row[data-hl="blue"] .hl-btn   { background: #80b7eb; }

/* ===========================
   COMMON SECTION HEADER
   =========================== */
.page-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 10px;
  gap: 8px;
}

.page-sec-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.page-sec-title h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
}

.page-sec-title span {
  font-size: 12px;
  color: var(--ink-muted);
}

.pill-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-pill-btn {
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-muted);
}
.mini-pill-btn.active,
.mini-pill-btn.primary {
  background: var(--cover-bg);
  color: #fff;
  border-color: var(--cover-bg);
}

/* ===========================
   TAB 2: PROJECTS
   =========================== */
.projects-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.project-create-box {
  background: var(--paper-alt);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.proj-form-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.proj-form-row input,
.proj-form-row select {
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
}

.project-card {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefb;
  padding: 11px 13px;
  border-left: 5px solid #d9a760;
}
.project-card[data-color="sage"]     { border-left-color: #77a885; }
.project-card[data-color="rose"]     { border-left-color: #d4828b; }
.project-card[data-color="sky"]      { border-left-color: #6f9ec9; }
.project-card[data-color="lavender"] { border-left-color: #9b84c4; }

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.project-card-title {
  font-family: var(--font-diary);
  font-size: 15px;
  font-weight: 700;
}

.project-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: #ebe5d8;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

.proj-task-list {
  margin: 6px 0;
  border-top: 1px dashed var(--line-color);
}

.proj-memo-input {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fcfaf4;
  font-family: var(--font-diary);
  font-size: 12px;
  resize: vertical;
  min-height: 44px;
}

/* ===========================
   TAB 3: LEDGER (가계부)
   =========================== */
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.sum-card {
  background: var(--paper-alt);
  border: 1px solid var(--line-color);
  border-radius: 8px;
  padding: 8px 10px;
}

.sum-card .lbl {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 2px;
}

.sum-card .val {
  font-size: 15px;
  font-weight: 700;
}
.sum-card.inc .val { color: #2d7d59; }
.sum-card.exp .val { color: #c0483b; }

.ledger-form {
  display: grid;
  grid-template-columns: 68px 92px 68px 1fr 102px 54px;
  gap: 5px;
  margin-bottom: 8px;
}

.ledger-form select,
.ledger-form input {
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  min-width: 0;
}

.ledger-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ledger-row {
  display: grid;
  grid-template-columns: 52px 74px 1fr auto 24px;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-color);
  font-family: var(--font-diary);
  font-size: 12.5px;
}

.cat-badge {
  font-size: 11px;
  background: var(--paper-alt);
  border: 1px solid var(--line-color);
  border-radius: 5px;
  padding: 1px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amt-inc { color: #2d7d59; font-weight: 700; }
.amt-exp { color: #c0483b; font-weight: 700; }

/* ===========================
   TAB 4: DIARY (일기장)
   =========================== */
.diary-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px;
  background: var(--paper-alt);
  border-radius: 8px;
  margin-bottom: 8px;
}

.stamp-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stamp-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 13px;
  opacity: 0.55;
}
.stamp-btn.active {
  opacity: 1;
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.diary-title-line {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--line-strong);
  background: transparent;
  padding: 6px 2px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  margin-bottom: 4px;
}

.ruled-paper-textarea {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-family: var(--font-diary);
  font-size: 14.5px;
  line-height: 30px;
  padding: 2px 2px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 29px,
    var(--line-color) 30px
  );
  background-attachment: local;
}

.diary-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-soft);
  padding-top: 4px;
}

.diary-archive-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-card {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefb;
  cursor: pointer;
}
.archive-card:hover {
  border-color: var(--accent);
}

/* ===========================
   MODALS
   =========================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 19, 14, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--paper);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.modal-card h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 14px;
}

.radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: #fff;
}

.color-swatches {
  display: flex;
  gap: 8px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
}
.swatch.active {
  border-color: var(--ink);
  transform: scale(1.08);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.btn-primary,
.btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.btn-primary {
  border: none;
  background: var(--cover-bg);
  color: #fff;
}

.btn-secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-muted);
}

.empty-hint {
  text-align: center;
  padding: 28px 12px;
  font-family: var(--font-diary);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ===========================
   MOBILE RESPONSIVE (< 820px)
   =========================== */
@media (max-width: 820px) {
  .desk-topbar {
    padding: 0 12px;
    height: 42px;
  }
  .save-indicator {
    display: none;
  }

  .mobile-date-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-date-btn {
    border: none;
    background: transparent;
    font-family: var(--font-diary);
    font-size: 14px;
    font-weight: 700;
  }

  .icon-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 16px;
  }

  .diary-wrapper {
    padding: 6px 8px 62px;
  }

  .diary-cover-frame {
    padding: 8px;
    border-radius: 12px;
  }

  .diary-spread {
    grid-template-columns: 1fr;
  }

  .diary-spine,
  .index-tabs {
    display: none;
  }

  body[data-mobile-pane="right"] .left-page {
    display: none;
  }
  body[data-mobile-pane="left"] .right-page {
    display: none;
  }

  .left-page,
  .right-page {
    padding: 12px;
    overflow-y: auto;
  }

  .memo-grid {
    grid-template-columns: repeat(2, 1fr);
    height: 210px;
  }

  .schedule-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .today-col {
    padding-right: 0;
    border-right: none;
    border-bottom: 1.5px solid var(--line-strong);
    padding-bottom: 12px;
  }

  .timetable-col {
    padding-left: 0;
  }

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

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: var(--cover-bg);
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    z-index: 30;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
  }

  .mob-nav-btn {
    flex: 1 0 auto;
    min-width: 62px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 8px;
  }

  .mob-nav-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 700;
  }
}

/* ===================================================
   BUSINESS & SELF-EMPLOYED TABS (자영업 5종 UI 스타일)
   =================================================== */

/* 1. 금전출납부 (Business Ledger) */
.biz-ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.biz-sum-card {
  background: var(--paper-alt);
  border: 1px solid var(--line-color);
  border-radius: 8px;
  padding: 8px 10px;
}
.biz-sum-card .lbl {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 2px;
}
.biz-sum-card .val {
  font-size: 15px;
  font-weight: 700;
}
.biz-sum-card.sales .val { color: #2d7d59; }
.biz-sum-card.purchase .val { color: #c0483b; }
.biz-sum-card.profit .val { color: var(--accent); }

.biz-form {
  display: grid;
  grid-template-columns: 80px 100px 1.2fr 100px 80px 54px;
  gap: 5px;
  margin-bottom: 8px;
}
.biz-form select,
.biz-form input {
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  min-width: 0;
}

.biz-ledger-row {
  display: grid;
  grid-template-columns: 50px 65px 90px 1fr auto 24px;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-color);
  font-family: var(--font-diary);
  font-size: 12.5px;
}
.biz-type-badge {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
}
.biz-type-badge.sales { background: #e3f5eb; color: #1e7048; }
.biz-type-badge.purchase { background: #fde8e8; color: #b73229; }
.biz-type-badge.expense { background: #fef0db; color: #9c600c; }

/* 2. 거래처 관리 (Clients) */
.client-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
  padding-right: 2px;
}
.client-card {
  background: #fffefb;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.client-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line-color);
  padding-bottom: 4px;
}
.client-name {
  font-family: var(--font-diary);
  font-size: 14.5px;
  font-weight: 700;
}
.client-cat-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--paper-alt);
  border: 1px solid var(--line-color);
}
.client-info-row {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.client-unpaid-badge {
  margin-top: 4px;
  font-size: 11px;
  color: #c44c3e;
  font-weight: 600;
}

/* 3. 세무/정산 일정 (Tax) */
.tax-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}
.tax-card {
  background: #fffefb;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tax-card.done {
  opacity: 0.55;
  background: var(--paper-alt);
}
.tax-dday {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: #ffe3e3;
  color: #bd3124;
}

/* 4. 발주/재고 (Inventory) */
.inv-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.inv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 33px;
  border-bottom: 1px solid var(--line-color);
  padding: 3px 2px;
  font-family: var(--font-diary);
  font-size: 13px;
}

/* 5. 직원/알바 (Staff) */
.staff-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding-right: 2px;
}
.staff-card {
  background: #fffefb;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.staff-pay-highlight {
  background: #fdf5ea;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
}

/* 달력 공휴일 & 음력 태그 */
.cal-holiday-tag {
  font-size: 9.5px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.cal-holiday-tag.red {
  color: var(--sun);
  font-weight: 700;
}
.cal-holiday-tag.muted {
  color: var(--ink-muted);
}
.cal-lunar-tag {
  font-size: 9px;
  color: #8f8578;
  font-family: var(--font-diary);
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.cal-cell.is-holiday .cal-day-num {
  color: var(--sun) !important;
}

/* 세무·공과금 연간 가이드 배너 */
.tax-guide-box {
  background: #fbf6ec;
  border: 1px solid #ebd7bf;
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.tax-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tax-guide-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #7d431a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tax-badge-now {
  background: #c2382c;
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
}
.tax-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.tax-guide-card {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tax-guide-card.active-month {
  border: 1.5px solid #c2382c;
  background: #fff5f5;
  box-shadow: 0 1px 4px rgba(194, 56, 44, 0.15);
}
.tax-month-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
}
.tax-guide-card.active-month .tax-month-label {
  color: #c2382c;
}
.tax-guide-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.tax-guide-due {
  font-size: 10.5px;
  color: #a44838;
}
.tax-quick-add-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  text-align: right;
  cursor: pointer;
  padding: 0;
  margin-top: 3px;
  text-decoration: underline;
}

/* ============================================================
   LANDING / INTRODUCTION INDEX PAGE
   ============================================================ */
.landing-screen {
  background: #f7f4ed;
  color: #2b231d;
  min-height: 100vh;
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
}
.landing-screen.hidden {
  display: none !important;
}

.landing-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 1. Landing Top Navigation */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 237, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.landing-nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.landing-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.landing-logo-mark {
  font-size: 24px;
}
.landing-logo-text {
  font-family: var(--font-brand);
  font-size: 30px;
  font-weight: 700;
  color: #4a2f1b;
  letter-spacing: -0.5px;
  line-height: 1;
}
.landing-logo-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #9c6c49;
  background: rgba(156, 108, 73, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.landing-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}
.landing-menu a {
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  color: #5c4e43;
  transition: color 0.15s ease;
}
.landing-menu a:hover {
  color: #a44838;
}
.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-pill-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.landing-pill-btn.ghost {
  background: transparent;
  color: #5c4e43;
}
.landing-pill-btn.ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #2b231d;
}
.landing-pill-btn.primary {
  background: #a44838;
  color: #fff;
  box-shadow: 0 2px 8px rgba(164, 72, 56, 0.28);
}
.landing-pill-btn.primary:hover {
  background: #8e3b2d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(164, 72, 56, 0.36);
}
.landing-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-user-pill {
  font-size: 13px;
  font-weight: 700;
  color: #4a2f1b;
  background: #faeade;
  padding: 6px 12px;
  border-radius: 999px;
}

/* 2. Hero Section */
.landing-hero {
  padding: 68px 0 80px;
  text-align: center;
  background: radial-gradient(circle at 50% 15%, rgba(245, 223, 184, 0.45), transparent 70%);
}
.hero-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(164, 72, 56, 0.25);
  color: #a44838;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 46px;
  font-weight: 700;
  color: #382516;
  line-height: 1.32;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero-title .highlight {
  color: #a44838;
  position: relative;
  display: inline-block;
}
.hero-desc {
  font-size: 17px;
  color: #635345;
  line-height: 1.65;
  max-width: 680px;
  margin: 0 auto 36px;
  word-break: keep-all;
}
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.hero-btn {
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-btn.primary {
  background: #a44838;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(164, 72, 56, 0.35);
}
.hero-btn.primary:hover {
  background: #893325;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(164, 72, 56, 0.45);
}
.hero-btn.secondary {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #3f2f22;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.hero-btn.secondary:hover {
  background: #fdfaf5;
  border-color: #a44838;
  color: #a44838;
  transform: translateY(-2px);
}
.hero-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6d5d4f;
}
.trust-icon {
  font-size: 16px;
}

/* 3. Hero Preview Frame Mockup */
.hero-preview-frame {
  max-width: 1040px;
  margin: 0 auto;
  background: #3e281b;
  border-radius: 16px;
  padding: 14px 16px 24px;
  box-shadow:
    0 24px 60px rgba(32, 20, 12, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.2);
  text-align: left;
}
.hero-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}
.preview-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.preview-url-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-family: monospace;
}
.hero-preview-content {
  background: #f3efe6;
  border-radius: 10px;
  padding: 20px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}
.hero-mockup-spread {
  display: flex;
  position: relative;
  background: #fdfaf4;
  border: 1px solid #d4cbb8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-height: 380px;
}
.mockup-page {
  flex: 1;
  padding: 16px 20px;
  min-width: 0;
}
.mockup-spine {
  width: 24px;
  background: linear-gradient(to right, rgba(0,0,0,0.14), transparent, rgba(0,0,0,0.14));
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}
.m-ring {
  width: 10px;
  height: 22px;
  border: 2px solid #8e8071;
  border-radius: 6px;
  background: #cfc7bd;
}
.mockup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #5a3d28;
  margin-bottom: 12px;
}
.mockup-month {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: #3e281b;
  line-height: 1;
}
.mockup-head strong {
  font-size: 13px;
  color: #3e281b;
}
.mockup-head small {
  font-size: 10.5px;
  color: #7b6957;
}
.mockup-head .mockup-date {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #3e281b;
}
.mockup-head .mockup-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #a44838;
  background: #fce8e6;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Mockup Calendar */
.mockup-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  color: #7d6b59;
  margin-bottom: 4px;
}
.mockup-cal-weekdays .sun { color: #c2382c; }
.mockup-cal-weekdays .sat { color: #2d68c4; }
.mockup-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 12px;
}
.m-cell {
  background: #fff;
  border: 1px solid #e5ded2;
  border-radius: 4px;
  min-height: 38px;
  padding: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #33271d;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.m-cell.sun { color: #c2382c; }
.m-cell.sat { color: #2d68c4; }
.m-cell.today {
  border: 1.5px solid #a44838;
  background: #fcf6ee;
}
.m-hol-tag {
  background: #fbe6e6;
  color: #c2382c;
  font-size: 8.5px;
  padding: 1px 2px;
  border-radius: 2px;
}
.m-lunar {
  color: #4b6e56;
  font-size: 8.5px;
}
.m-sales-tag {
  background: #e3f5eb;
  color: #1f6b3e;
  font-size: 8.5px;
  border-radius: 2px;
  padding: 1px 2px;
}

/* Mockup Memos */
.mockup-memos-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.m-box {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.m-box.b-cream { background: #fffbe6; }
.m-box.b-rose  { background: #fdeeee; }
.m-box.b-mint  { background: #eaf6ee; }
.m-box.b-sky   { background: #edf4fb; }

/* Mockup Right Page */
.mockup-todos-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.m-todo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 8px;
  background: #fff;
  border-radius: 4px;
  border-bottom: 1px dashed #dcd4c5;
}
.m-todo.checked {
  color: #8c7e70;
  text-decoration: line-through;
}
.m-time-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  padding: 4px 8px;
  background: #faf7f0;
  border-radius: 4px;
}
.m-time-row.highlight {
  background: #fed8b1;
  font-weight: 700;
}
.m-time-row span {
  font-size: 10px;
  font-weight: 700;
  color: #7b6957;
  font-family: monospace;
}

/* Mockup Tabs */
.mockup-tabs {
  position: absolute;
  right: -52px;
  top: 30px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.m-tab {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 0 6px 6px 0;
  background: #e8ded1;
  color: #3a2b1f;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-left: none;
  box-shadow: 2px 1px 3px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}
.m-tab.active {
  background: #fff;
  color: #a44838;
  font-weight: 800;
  padding-left: 8px;
}
.m-tab.t-biz    { background: #fed8b1; }
.m-tab.t-client { background: #d7e6f8; }
.m-tab.t-tax    { background: #fcd5dc; }
.m-tab.t-inv    { background: #cce9d6; }
.m-tab.t-staff  { background: #e5daf7; }
.m-tab.t-proj   { background: #d6e5d8; }
.m-tab.t-ledg   { background: #f2cfcf; }
.m-tab.t-diary  { background: #d5e2f2; }

/* 4. Common Landing Sections */
.landing-section {
  padding: 90px 0;
}
.landing-section.bg-alt {
  background: #f0ebe0;
}
.sec-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 54px;
}
.sec-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: #8c5b3b;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(140, 91, 59, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.sec-badge.biz {
  color: #1e6d47;
  background: rgba(30, 109, 71, 0.12);
}
.sec-badge.life {
  color: #285ea6;
  background: rgba(40, 94, 166, 0.12);
}
.sec-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  color: #362518;
  margin-bottom: 14px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}
.sec-desc {
  font-size: 16px;
  color: #635345;
  word-break: keep-all;
}

/* 5. Core Feature Cards (4 Cards) */
.feat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}
.feat-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 30px 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.feat-icon {
  font-size: 34px;
  margin-bottom: 16px;
}
.feat-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: #362518;
  margin-bottom: 10px;
}
.feat-text {
  font-size: 14px;
  color: #69594b;
  line-height: 1.6;
}

/* 6. Business Showcase Grid (6 Items) */
.biz-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.biz-show-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-left: 4px solid #1e6d47;
  border-radius: 12px;
  padding: 24px 22px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.18s ease;
}
.biz-show-item:hover {
  transform: translateY(-3px);
}
.biz-show-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.biz-show-item h4 {
  font-size: 16.5px;
  font-weight: 700;
  color: #274534;
  margin-bottom: 8px;
}
.biz-show-item p {
  font-size: 13.5px;
  color: #5c5249;
  line-height: 1.6;
}

/* 7. Life Planner Grid (4 Boxes) */
.life-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.life-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.life-box-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #285ea6;
  background: #ebf3fd;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.life-box h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #302319;
  margin-bottom: 10px;
  line-height: 1.4;
}
.life-box p {
  font-size: 13.5px;
  color: #635548;
  line-height: 1.62;
}

/* 8. FAQ Accordion */
.faq-accordion {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq-item {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.faq-q {
  font-size: 15.5px;
  font-weight: 700;
  color: #332418;
  cursor: pointer;
  outline: none;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-q::-webkit-details-marker {
  display: none;
}
.faq-q::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  color: #a44838;
  font-weight: 700;
  transition: transform 0.16s ease;
}
.faq-item[open] .faq-q::after {
  content: '−';
}
.faq-a {
  margin-top: 10px;
  font-size: 14px;
  color: #635345;
  line-height: 1.65;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 10px;
}

/* 9. Bottom CTA Banner */
.landing-cta-banner {
  padding: 40px 0 80px;
}
.cta-banner-card {
  background: linear-gradient(135deg, #442d1e 0%, #2f1e14 100%);
  border-radius: 20px;
  padding: 60px 32px;
  text-align: center;
  color: #f7ede1;
  box-shadow: 0 16px 40px rgba(32, 20, 12, 0.25);
  position: relative;
  overflow: hidden;
}
.cta-banner-card h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
  letter-spacing: -0.5px;
}
.cta-banner-card p {
  font-size: 16px;
  color: #dfcdb8;
  margin-bottom: 30px;
}
.cta-banner-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* 10. Landing Footer */
.landing-footer {
  background: #2b1d14;
  color: #b39f8f;
  padding: 48px 0;
  font-size: 13.5px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 700;
  color: #f5dfb8;
  margin-bottom: 6px;
}
.footer-left p {
  color: #9f8c7d;
  margin-bottom: 4px;
}
.footer-left small {
  color: #7d6b5e;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  text-decoration: none;
  color: #c9b8a8;
  transition: color 0.15s ease;
}
.footer-links a:hover {
  color: #f5dfb8;
}
.footer-link-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f5dfb8;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.footer-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Responsive Styles for Landing */
@media (max-width: 900px) {
  .hero-title {
    font-size: 34px;
  }
  .hero-desc {
    font-size: 15.5px;
  }
  .landing-menu {
    display: none;
  }
  .hero-mockup-spread {
    flex-direction: column;
  }
  .mockup-spine {
    display: none;
  }
  .mockup-tabs {
    display: none;
  }
  .sec-title {
    font-size: 27px;
  }
  .cta-banner-card {
    padding: 42px 20px;
  }
  .cta-banner-card h2 {
    font-size: 25px;
  }
}
@media (max-width: 640px) {
  .pc-only {
    display: none;
  }
  .hero-trust-bar {
    gap: 14px;
  }
  .trust-item {
    font-size: 12px;
  }
  .hero-btn {
    width: 100%;
  }
  .hero-cta-group {
    flex-direction: column;
  }
}

/* ============================================================
   GLOBAL SEARCH MODAL (Spotlight Search)
   ============================================================ */
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.search-pill:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.55);
}
.search-pill kbd {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 24px;
}
.search-modal.hidden {
  display: none !important;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 660px;
  background: #fdfbf7;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  box-shadow:
    0 24px 64px rgba(25, 17, 10, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: sModalIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sModalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}
.search-icon-mark {
  font-size: 20px;
  color: var(--ink-soft);
}
.global-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16.5px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: #2b231d;
  outline: none;
}
.global-search-input::placeholder {
  color: #a49688;
  font-weight: 500;
}
.search-close-btn {
  background: #f0ebe0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #635345;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.search-close-btn:hover {
  background: #e5ded2;
  color: #2b231d;
}

.search-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #f7f3ea;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.search-filter-pills::-webkit-scrollbar {
  display: none;
}
.s-filter-pill {
  border: 1px solid rgba(0, 0, 0, 0.09);
  background: #fff;
  color: #665547;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.s-filter-pill:hover {
  border-color: #a44838;
  color: #a44838;
}
.s-filter-pill.active {
  background: #a44838;
  color: #fff;
  border-color: #a44838;
  font-weight: 700;
}

.search-results-area {
  max-height: 420px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-hint-box {
  padding: 40px 20px;
  text-align: center;
  color: #6e5f52;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.search-hint-box p {
  font-size: 14px;
  line-height: 1.6;
}

.search-result-group-title {
  font-size: 11px;
  font-weight: 800;
  color: #8c7a6b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
  color: inherit;
}
.search-result-item:hover,
.search-result-item.selected {
  background: #fdf6ec;
  border-color: rgba(164, 72, 56, 0.35);
  box-shadow: 0 2px 8px rgba(164, 72, 56, 0.1);
  transform: translateX(2px);
}
.search-item-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.badge-todo    { background: #fed8b1; color: #7a4616; }
.badge-diary   { background: #d7e6f8; color: #1e4b85; }
.badge-biz     { background: #cce9d6; color: #1e6d47; }
.badge-client  { background: #e5daf7; color: #58339c; }
.badge-tax     { background: #fcd5dc; color: #9c253b; }
.badge-memo    { background: #f5dfb8; color: #6a491d; }

.search-item-body {
  flex: 1;
  min-width: 0;
}
.search-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.search-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #30241a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-date {
  font-size: 11.5px;
  color: #8c7e70;
  white-space: nowrap;
  font-family: monospace;
}
.search-item-snippet {
  font-size: 12.5px;
  color: #635548;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-item-snippet mark {
  background: #fde8be;
  color: #923a10;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
}
.search-item-arrow {
  font-size: 12px;
  color: #a44838;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 4px;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #f5f0e6;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 11.5px;
  color: #7b6c5f;
}
.search-footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-footer-shortcuts kbd {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}
.search-count-label {
  font-weight: 700;
  color: #a44838;
}

/* ==========================================
   대출·이자 관리 (Loans & Repayment)
   ========================================== */
.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .loan-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.loan-sum-card {
  background: var(--paper-alt, #faf6ee);
  border: 1px solid var(--line, #e2d9ca);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.loan-sum-card .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft, #706253);
  letter-spacing: -0.2px;
}
.loan-sum-card .val {
  font-family: var(--font-serif, 'Noto Serif KR', serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink, #2d241e);
  letter-spacing: -0.3px;
}
.loan-sum-card.balance .val {
  color: #c0392b;
}
.loan-sum-card.payment .val {
  color: #d35400;
}
.loan-sum-card.rate .val {
  color: #2980b9;
}
.loan-sum-card.progress .val {
  color: #27ae60;
}
.loan-sum-card .sub {
  font-size: 10.5px;
  color: var(--ink-muted, #9b8c7e);
  margin-top: 1px;
}

.loan-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100% - 150px);
  padding-right: 4px;
}
.loan-card {
  background: #fffdfa;
  border: 1px solid var(--line, #e2d9ca);
  border-left: 4px solid var(--accent, #a44838);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.loan-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.loan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.loan-card-title-grp {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.loan-bank-badge {
  font-size: 11.5px;
  font-weight: 800;
  background: #f7ede2;
  color: #843b17;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #ebd2bd;
}
.loan-title {
  font-family: var(--font-serif, 'Noto Serif KR', serif);
  font-size: 15px;
  color: var(--ink, #2d241e);
}
.loan-type-tag {
  font-size: 10.5px;
  color: var(--ink-soft, #706253);
  background: var(--paper-alt, #faf6ee);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line, #e2d9ca);
}
.loan-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.loan-pay-btn {
  background: #2e7d32 !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(46, 125, 50, 0.3) !important;
}
.loan-pay-btn:hover {
  background: #1b5e20 !important;
}
.loan-edit-btn {
  background: #fff !important;
  border: 1px solid var(--line-strong, #cfc3b0) !important;
  color: var(--ink-soft, #706253) !important;
}
.loan-edit-btn:hover {
  background: #f5eedf !important;
  color: var(--ink, #2d241e) !important;
}

.loan-details-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  background: var(--paper-alt, #faf6ee);
  border: 1px solid var(--line, #e2d9ca);
  border-radius: 6px;
  padding: 8px 10px;
}
@media (max-width: 900px) {
  .loan-details-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 500px) {
  .loan-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.loan-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.loan-detail-item .dt-lbl {
  font-size: 10px;
  color: var(--ink-muted, #9b8c7e);
  font-weight: 600;
}
.loan-detail-item .dt-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #2d241e);
  font-family: var(--font-diary, sans-serif);
}
.loan-detail-item .dt-val.rate {
  color: #2980b9;
}
.loan-detail-item .dt-val.highlight {
  color: #d35400;
}
.loan-detail-item .dt-val.balance-text {
  color: #c0392b;
  font-weight: 800;
}

.loan-progress-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.loan-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-soft, #706253);
}
.loan-progress-track {
  width: 100%;
  height: 8px;
  background: #ede6d9;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.loan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.loan-extra-row {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--ink-soft, #706253);
  padding-top: 4px;
  border-top: 1px dashed var(--line, #e2d9ca);
}

/* ==========================================
   거래처 상세 원장 (단가표, 사급 포장지, 납품 전표)
   ========================================== */
.client-card-action-bar {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #e2d9ca);
}
.client-open-ledger-btn {
  width: 100%;
  justify-content: center;
  font-weight: 700 !important;
}

.client-pkg-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fbf7ee;
  border: 1px solid #ebdcc5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
@media (max-width: 800px) {
  .client-pkg-banner {
    grid-template-columns: repeat(2, 1fr);
  }
}
.pkg-banner-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pkg-banner-col.highlight {
  background: #eef7ee;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbe9cb;
}
.pkg-banner-col .p-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted, #9b8c7e);
}
.pkg-banner-col .p-val {
  font-family: var(--font-serif, 'Noto Serif KR', serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #2d241e);
}
.pkg-banner-col .p-val.green {
  color: #1e824c;
}

.pkg-target-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  background: #fbeee6;
  color: #b3391b;
  border: 1px solid #f5cfbe;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.slip-entry-box {
  background: #fffdfa;
  border: 1.5px solid #d4c5af;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.slip-input-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.slip-input-table th {
  background: var(--paper-alt, #faf6ee);
  border-bottom: 1.5px solid var(--line-strong, #cfc3b0);
  padding: 6px 8px;
  font-size: 11.5px;
  color: var(--ink-soft, #706253);
}
.slip-input-table td {
  border-bottom: 1px solid var(--line, #e2d9ca);
  padding: 6px 8px;
}
.slip-input-table tr:hover {
  background: #fbf7ee;
}

.slip-calc-bar {
  background: #f5eedf;
  border: 1px solid #e0d4c1;
  border-radius: 6px;
  padding: 8px 12px;
}
.calc-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink, #2d241e);
  flex-wrap: wrap;
  gap: 10px;
}
.calc-metrics .calc-final {
  font-size: 14px;
  font-weight: 800;
  color: #27ae60;
  background: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #c2e5cf;
}

.slip-history-scroll {
  overflow-y: auto;
  max-height: 280px;
  border: 1px solid var(--line, #e2d9ca);
  border-radius: 6px;
  background: #fff;
}
.slip-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.slip-history-table th {
  position: sticky;
  top: 0;
  background: var(--paper-alt, #faf6ee);
  border-bottom: 1.5px solid var(--line-strong, #cfc3b0);
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ink-soft, #706253);
  z-index: 1;
}
.slip-history-table td {
  border-bottom: 1px solid #f0e9df;
  padding: 6px 8px;
}
.slip-history-table tr:hover {
  background: #faf6f0;
}
