/* =========================================================
   하루기록 · 디자인 시스템
   프로토타입의 인라인 스타일을 의미 단위 클래스로 재구성
   ========================================================= */

:root {
  /* 종이 톤 배경 / 텍스트 */
  --bg:        #efe7da;
  --ink:       #3a342c;
  --ink-soft:  #6b6052;
  --paper:     #fffdf8;

  /* 따뜻한 패널/보더 */
  --panel:     #faf4ea;
  --panel-2:   #f4ecdd;
  --header-bg: #f6efe3;
  --line:      #e0d2b8;
  --line-2:    #e4d8c2;
  --line-warm: #f0e2cb;

  /* 포인트(주황) */
  --accent:    #e3895a;
  --accent-d:  #c46f43;
  --accent-bg: #fdeede;

  /* 흐린 글씨 */
  --muted:     #a8967c;
  --muted-2:   #8a7d68;
  --muted-3:   #b3a489;

  /* 저널(쿨톤) */
  --cool:      #5f7e9e;
  --cool-d:    #46617d;
  --cool-ink:  #2f343b;
  --cool-bg:   #f6f8fa;
  --cool-line: #cfd6dd;

  --radius:    12px;
  --shadow:    7px 7px 0 rgba(58, 52, 44, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Gaegu', system-ui, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

input {
  font-family: inherit;
  outline: none;
}
input:focus { border-color: var(--accent) !important; }

.mono { font-family: 'Space Mono', monospace; }

/* ---------------- 헤더 ---------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px;
  background: var(--header-bg);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); }
.brand__name { font-weight: 700; font-size: 21px; }
.brand__tag {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--muted);
  letter-spacing: 1px; margin-left: 4px;
}

.view-switch { display: flex; gap: 8px; }
.swbtn {
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 16px;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  user-select: none;
}
.swbtn.is-active { background: var(--ink); color: var(--paper); }

.header__actions { display: flex; align-items: center; gap: 14px; }
.reset-link { font-size: 14px; color: var(--muted); cursor: pointer; }
.btn-primary {
  padding: 8px 15px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--accent-d);
  user-select: none;
}

.stage { padding: 34px 22px 80px; }

/* ---------------- 데스크톱 윈도우 ---------------- */
.window {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-bottom: 2px solid var(--line-2);
  background: var(--panel-2);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: var(--accent); }
.dot--y { background: #e9d28a; }
.dot--g { background: #b9c79a; }
.window__title { font-size: 15px; color: var(--muted-2); margin-left: 8px; }

.window__body { display: flex; min-height: 560px; }

.sidebar {
  width: 186px;
  flex: none;
  border-right: 2px solid var(--line-2);
  padding: 18px 15px;
  background: var(--panel);
}
.sidebar__nav { display: flex; flex-direction: column; gap: 5px; font-size: 17px; }
.navitem { padding: 9px 11px; border-radius: 8px; color: var(--ink-soft); cursor: pointer; }
.navitem.is-active { background: #f1e3cb; font-weight: 700; color: var(--ink); }

.sidebar__add {
  margin-top: 18px;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--accent-d);
}
.sidebar__stat {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--line);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.sidebar__hint { margin-top: 14px; font-size: 14px; color: var(--muted-3); line-height: 1.5; }

.content { flex: 1; padding: 18px 22px; }

/* ---------------- 캘린더 ---------------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head__label { font-weight: 700; font-size: 20px; }
.cal-arrow { font-size: 21px; cursor: pointer; padding: 0 8px; user-select: none; }

.weekrow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cell {
  border: 1.5px solid #ece1cd;
  border-radius: 7px;
  padding: 5px 6px;
  cursor: pointer;
  min-height: 74px;
  background: var(--paper);
}
.cell--out { background: #faf6ee; opacity: .5; }
.cell--today { border: 2.5px solid var(--accent); background: var(--accent-bg); }
.cell__num { font-size: 14px; color: var(--ink); }
.cell--out .cell__num { color: #c4b69c; }
.cell--today .cell__num { color: var(--accent-d); font-weight: 700; }
.cell__bar { height: 11px; border-radius: 3px; margin-top: 3px; background: #e9dcc6; }
.cell__bar--done { background: var(--accent); }
.cell__more { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---------------- 지난 기록 (warm) ---------------- */
.section-title { font-weight: 700; font-size: 20px; margin-bottom: 14px; }
.record-list { display: flex; flex-direction: column; gap: 11px; }
.record {
  border: 2px solid var(--line-warm);
  border-radius: var(--radius);
  padding: 13px 15px;
  cursor: pointer;
}
.record__head { display: flex; justify-content: space-between; align-items: center; }
.record__date { font-weight: 700; font-size: 18px; }
.record__note { font-family: 'Space Mono', monospace; font-size: 13px; color: var(--muted-2); }
.record__bars { display: flex; gap: 5px; margin-top: 9px; }
.minibar { height: 11px; border-radius: 3px; flex: 1; background: #ecdcc4; }
.minibar--done { background: var(--accent); }

/* ---------------- 할 일 줄 (warm) ---------------- */
.tasklist { display: flex; flex-direction: column; gap: 9px; }
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 2px solid #f0e2cb;
  background: var(--paper);
}
.task.is-done { background: #fbf2e4; border-color: #f3e2cb; }
.task__box {
  width: 24px; height: 24px; flex: none;
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.task.is-done .task__box {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); border-color: var(--accent-d);
  color: #fff; font-weight: 700;
}
.task__text { flex: 1; font-size: 18px; color: var(--ink); }
.task.is-done .task__text { color: #b09a82; text-decoration: line-through; }
.task__del { font-size: 16px; color: #cbbda3; cursor: pointer; }

.empty { font-size: 15px; color: var(--muted-3); padding: 6px 2px; }
.empty--center { text-align: center; }

/* 입력줄 */
.addbar { display: flex; gap: 8px; margin-top: 14px; }
.addbar__input {
  flex: 1;
  border: 2px solid #d8cbb4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  background: var(--paper);
}
.addbar__btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

/* ---------------- 모바일 목업 ---------------- */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 330px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 38px;
  box-shadow: var(--shadow);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
}
.phone__notch { width: 96px; height: 6px; background: var(--line-2); border-radius: 3px; margin: 0 auto 12px; }
.screen { min-height: 520px; }

.mcal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 6px 8px;
}
.mcal-head__label { font-weight: 700; font-size: 19px; }
.mweekrow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  font-size: 11px; color: var(--muted); text-align: center;
}
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 4px; }
.mcell {
  padding: 8px 0; border-radius: 9px; font-size: 14px; text-align: center;
  cursor: pointer; position: relative;
}
.mcell--out { color: #c4b69c; }
.mcell--sel { background: #f1e3cb; font-weight: 700; }
.mcell--today { background: var(--accent); color: #fff; font-weight: 700; }
.mcell__dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.mday {
  margin-top: 12px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel);
}
.mday__title { font-weight: 700; font-size: 17px; margin-bottom: 10px; }

.today-screen {
  min-height: 520px;
  background: var(--accent-bg);
  margin: -2px -4px 0;
  border-radius: 24px;
  padding: 16px 14px;
}
.today-screen__head { text-align: center; }
.today-screen__sun { font-size: 38px; line-height: 1; }
.today-screen__date { font-family: 'Space Mono', monospace; font-size: 12px; color: #b3886a; margin-top: 6px; }
.today-screen__count { font-weight: 700; font-size: 24px; margin-top: 2px; }

.progress { display: flex; align-items: center; gap: 10px; }
.progress__track { flex: 1; height: 12px; background: #efe3cd; border-radius: 6px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--accent); }
.progress__num { font-size: 15px; color: var(--ink-soft); font-family: 'Space Mono', monospace; }

.tabbar {
  display: flex; gap: 4px; margin-top: 12px; padding-top: 10px;
  border-top: 2px solid var(--line-warm);
}
.tab {
  flex: 1; text-align: center; padding: 9px 0; font-size: 14px;
  cursor: pointer; border-radius: 10px; color: var(--muted-2);
}
.tab.is-active { background: var(--accent-bg); color: var(--accent-d); font-weight: 700; }

/* ---------------- 저널(쿨톤) ---------------- */
.journal {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
.jcard {
  background: var(--cool-bg);
  border: 1.5px solid var(--cool-ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 rgba(47, 52, 59, .10);
  padding: 24px 26px;
}
.jhead {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1.5px solid var(--cool-ink); padding-bottom: 14px;
}
.jhead__kicker {
  font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: 2px;
  color: #9aa3ad; text-transform: uppercase;
}
.jhead__date { font-weight: 700; font-size: 29px; line-height: 1.05; margin-top: 4px; letter-spacing: -.5px; }
.jhead__done { font-family: 'Space Mono', monospace; font-size: 13px; color: var(--cool); font-weight: 700; }

/* 저널 할 일 줄 */
.jlist { display: flex; flex-direction: column; margin-top: 6px; }
.jtask {
  display: flex; align-items: center; gap: 14px; height: 46px;
  border-bottom: 1px solid #e6eaef; font-size: 19px; color: var(--cool-ink);
}
.jtask.is-done { color: #9aa3ad; }
.jtask__box {
  width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--cool-ink); border-radius: 5px; cursor: pointer;
}
.jtask.is-done .jtask__box {
  display: inline-flex; align-items: center; justify-content: center;
  border-color: var(--cool-d); background: var(--cool); color: #fff;
  font-weight: 700; font-size: 12px;
}
.jtask__text { flex: 1; }
.jtask.is-done .jtask__text { text-decoration: line-through; }
.jtask__del { font-size: 15px; color: #c2cad2; cursor: pointer; }

.jaddbar { display: flex; gap: 8px; margin-top: 14px; }
.jaddbar__input {
  flex: 1; border: 1.5px solid var(--cool-line); border-radius: 5px;
  padding: 10px 12px; font-size: 16px; background: #fff;
}
.jaddbar__btn {
  padding: 10px 16px; background: var(--cool); color: #fff; border-radius: 5px;
  font-weight: 700; font-size: 15px; cursor: pointer;
}

.jreview-title {
  font-family: 'Space Mono', monospace; font-weight: 700; font-size: 14px;
  letter-spacing: 2px; color: #6b7480; text-transform: uppercase; margin-bottom: 18px;
}
.timeline { position: relative; padding-left: 28px; }
.timeline__line { position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1.5px; background: #d3dae1; }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item__dot {
  position: absolute; left: -28px; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; border: 1.5px solid var(--cool-d);
}
.tl-item__date { font-weight: 700; font-size: 18px; }
.tl-item__note { font-size: 15px; color: #6b7480; margin: 3px 0 8px; }
.tl-item__bars { display: flex; gap: 5px; }
.coolbar { height: 9px; border-radius: 2px; flex: 1; background: #dde3e9; }
.coolbar--done { background: var(--cool); }

/* ---------------- 모달 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; background: rgba(58, 52, 44, .40); overflow: auto;
}
.modal {
  width: 440px; max-width: 100%;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(58, 52, 44, .22);
  padding: 22px 24px;
}
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; }
.modal__kicker { font-size: 14px; color: var(--muted); font-family: 'Space Mono', monospace; }
.modal__title { font-weight: 700; font-size: 26px; margin-top: 2px; }
.modal__close { font-size: 22px; color: var(--muted-3); cursor: pointer; padding: 2px 6px; }
.modal__progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.modal__cta {
  margin-top: 16px; padding: 11px; background: var(--ink); color: var(--paper);
  border-radius: 10px; text-align: center; font-weight: 700; font-size: 17px; cursor: pointer;
}

/* ---------------- 반응형 ---------------- */
@media (max-width: 720px) {
  .header { flex-wrap: wrap; gap: 10px; }
  .window__body { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 2px solid var(--line-2); }
  .cell { min-height: 56px; }
}


/* ---------------- 인증 화면 ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.auth-head {
  margin-bottom: 18px;
}
.auth-kicker {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
}
.auth-title {
  font-size: 34px;
  font-weight: 700;
  margin-top: 8px;
}
.auth-desc {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
  color: var(--ink-soft);
}
.auth-input {
  width: 100%;
  border: 2px solid #d8cbb4;
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}
.auth-input[disabled] {
  opacity: .7;
  cursor: wait;
}
.auth-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.auth-btn {
  flex: 1;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
}
.auth-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-d);
  box-shadow: 2px 2px 0 var(--accent-d);
}
.auth-msg {
  min-height: 24px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
}
.auth-msg.is-error { color: #b3472f; }
.auth-msg.is-ok { color: #486334; }
.auth-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-2);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 14px;
  color: var(--ink-soft);
}
.user-chip strong {
  color: var(--ink);
}
.user-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.header__actions--auth {
  gap: 10px;
}
.header__email {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}
.btn-outline {
  padding: 8px 15px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.status-banner {
  max-width: 1000px;
  margin: 0 auto 14px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}
.status-banner.is-error {
  border-color: #d9aa96;
  background: #fff1ec;
  color: #8c4a36;
}
.status-banner.is-ok {
  border-color: #b8c7a0;
  background: #f6faef;
  color: #486334;
}
@media (max-width: 760px) {
  .auth-card { padding: 24px 18px; }
  .auth-row { flex-direction: column; }
  .header {
    padding: 12px 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .header__actions { width: 100%; flex-wrap: wrap; }
  .view-switch { width: 100%; flex-wrap: wrap; }
  .stage { padding: 22px 12px 60px; }
}
