/*
  방향 B: 연구 노트 (2차, 짜임 미리보기)
  한 번에 하나씩 끝낸다. 가운데 한 단에 지금 할 일 하나를 크게 둔다.
  값은 아래 :root에만 적고, 그 밑의 규칙은 변수만 쓴다.
*/

/* 글꼴: 미리보기에서는 배포처에서 바로 불러온다. */
@import url("https://cdn.jsdelivr.net/npm/wanted-sans@1.0.3/fonts/webfonts/variable/split/WantedSansVariable.min.css");

:root {
  /* 색: 바탕과 면 */
  --color-bg: #ffffff;              /* 노트의 흰 종이 */
  --color-surface: #ffffff;
  --color-surface-2: #f4f4f1;       /* 연필로 옅게 칠한 면 */
  --color-line: #dcdcd6;            /* 노트의 가로줄 */
  --color-line-strong: #1b1c1e;     /* 펜으로 그은 줄 */
  --color-line-accent: #f0a3ae;     /* 노트의 세로 여백선 */

  /* 색: 글자 */
  --color-text: #1b1c1e;            /* 펜 색 */
  --color-text-muted: #5b5e63;      /* 연필 색 */

  /* 색: 실행 버튼 */
  --color-action: #ffe94d;          /* 노랑 형광펜 */
  --color-action-hover: #ffdd1a;
  --color-on-action: #1b1c1e;

  /* 색: 강조 */
  --color-accent: #ffe94d;
  --color-accent-strong: #1b1c1e;   /* 글자로 쓸 때는 펜 색 */
  --color-accent-soft: #fff8c4;
  --color-on-accent: #1b1c1e;
  --color-mark: #ffe94d;            /* 형광펜으로 그은 자리 */

  /* 색: 상태. 옅은 쪽이 형광펜 색이고, 짙은 쪽은 글자로 쓸 때의 색이다. */
  --color-ok: #17663a;
  --color-ok-soft: #c9f3c5;         /* 초록 형광펜 */
  --color-warn: #8a4b00;
  --color-warn-soft: #ffdcae;       /* 주황 형광펜 */
  --color-danger: #b0123c;
  --color-danger-soft: #ffc6d9;     /* 분홍 형광펜 */
  --color-info: #1d5a8c;
  --color-info-soft: #c4e8ff;       /* 하늘 형광펜 */

  /* 색: 모듈 */
  --color-module-admin: #1b1c1e;
  --color-module-journal: #17663a;
  --color-module-conference: #8a4b00;
  --color-module-link: #5b5e63;
  --color-on-module: #ffffff;

  /* 색: 기타 */
  --color-focus: #1b1c1e;
  --color-overlay: rgba(27, 28, 30, 0.4);

  /* 글꼴 */
  --font-display: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-num: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-display: 800;

  /* 글자 크기 단계 */
  --text-2xs: 0.6875rem;            /* 11px */
  --text-xs: 0.75rem;               /* 12px */
  --text-sm: 0.875rem;              /* 14px */
  --text-base: 1rem;                /* 16px */
  --text-md: 1.125rem;              /* 18px */
  --text-lg: 1.375rem;              /* 22px */
  --text-xl: 1.75rem;               /* 28px */
  --text-2xl: 2.5rem;               /* 40px */
  --text-3xl: 3.5rem;               /* 56px */
  --text-hero: clamp(2.125rem, 1rem + 4.7vw, 5.25rem);
  --leading-tight: 1.14;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-loose: 1.75;
  --tracking-tight: -0.035em;
  --tracking-normal: -0.005em;
  --tracking-wide: 0.02em;

  /* 간격 단계 */
  --space-1: 0.25rem;               /* 4px */
  --space-2: 0.5rem;                /* 8px */
  --space-3: 0.75rem;               /* 12px */
  --space-4: 1rem;                  /* 16px */
  --space-5: 1.5rem;                /* 24px */
  --space-6: 2rem;                  /* 32px */
  --space-7: 3rem;                  /* 48px */
  --space-8: 4rem;                  /* 64px */
  --space-9: 6rem;                  /* 96px */
  --space-gutter: clamp(1rem, 4.5vw, 4.5rem);

  /* 모서리 */
  --radius-sm: 0.125rem;            /* 2px */
  --radius-md: 0.25rem;             /* 4px */
  --radius-lg: 0.375rem;            /* 6px */
  --radius-full: 999px;

  /* 그림자 */
  --shadow-sm: 0 1px 0 rgba(27, 28, 30, 0.1);
  --shadow-md: 0 6px 20px rgba(27, 28, 30, 0.12);
  --shadow-lg: 0 16px 40px rgba(27, 28, 30, 0.16);

  /* 선 */
  --border-thin: 1px;
  --border-mid: 1.5px;
  --border-thick: 2px;
  --icon-stroke: 2;

  /* 크기 */
  --size-content: 64rem;            /* 본문 최대 폭 */
  --size-header: 4.5rem;            /* 포털 머리말 높이 */
  --size-sidebar: 15rem;            /* 사무국 왼쪽 메뉴 폭이자 노트의 여백 폭 */
  --size-topbar: 3.75rem;           /* 사무국 위쪽 막대 높이 */
  --size-aside: 17rem;              /* 보조 단 폭 */
  --size-label: 7.5rem;             /* 항목 칸 폭 */
  --size-control: 2.75rem;          /* 버튼과 입력 칸 높이 */
  --size-control-lg: 3.25rem;
  --size-control-sm: 2rem;
  --size-nav-item: 1.875rem;        /* 메뉴 한 줄 높이 */
  --size-icon: 1.25rem;
  --size-measure: 33em;             /* 읽기 좋은 한 줄 길이 */

  /* 움직임 */
  --duration-fast: 120ms;

  /* 방향 B 2차에서 더한 변수 */
  --size-column: 46rem;             /* 사무국 가운데 한 단의 폭 */
  --size-wide: 68rem;               /* 포털 본문의 폭 */
  --size-result: 26rem;             /* 포털 결과 쪽의 폭 */
  --size-bar: 36px;                 /* 미리보기 틀의 높이 */
  --size-dock: 4.25rem;             /* 좁은 화면에서 아래에 고정한 주 버튼의 높이 */
}

/* 미리보기 틀: 방향의 디자인이 아니다. 값을 직접 적는다. */
.pv-bar { box-sizing: border-box; display: flex; align-items: center; gap: 14px; height: 36px; margin: 0; padding: 0 16px; border-bottom: 1px dashed #8d8d8d; background: #efefef; color: #2b2b2b; font: 12px/1.4 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; letter-spacing: 0; white-space: nowrap; overflow: hidden; }
.pv-bar__title { font-weight: 700; }
.pv-bar a { padding: 3px 8px; border: 1px solid transparent; border-radius: 3px; color: #2b2b2b; text-decoration: underline; text-underline-offset: 2px; }
.pv-bar a:focus-visible { outline: 2px solid #2b2b2b; outline-offset: 1px; }
.pv-bar a[aria-current="page"] { border-color: #2b2b2b; background: #ffffff; font-weight: 700; text-decoration: none; }
.pv-bar__note { color: #555555; }
.pv-bar__back { margin-left: auto; }
@media (max-width: 720px) { .pv-bar__note { display: none; } }

/* ---------- 바탕 ---------- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

:where(.portal, .office) :where(h1, h2, h3, p, ul, ol, dl, dd, fieldset, legend) { margin: 0; padding: 0; }
:where(.portal, .office) :where(ul, ol) { list-style: none; }
:where(.portal, .office) :where(h1, h2, h3) { font-size: inherit; font-weight: inherit; }
:where(.portal, .office) fieldset { border: 0; min-width: 0; }
:where(.portal, .office) a { color: inherit; }
:where(.portal, .office, .menu) :focus-visible {
  outline: var(--border-thick) solid var(--color-focus);
  outline-offset: var(--space-1);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 형광펜으로 그은 자리. 줄이 바뀌어도 줄마다 따로 그어진다. */
.mark,
.late {
  margin: 0 calc(var(--space-1) * -1);
  padding: 0 var(--space-1);
  border-radius: var(--radius-md) var(--radius-sm) var(--radius-lg) var(--radius-sm);
  background: var(--color-mark);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.late { background: var(--color-danger-soft); font-weight: var(--weight-bold); }

/* ---------- 버튼과 링크 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-control);
  padding: 0 var(--space-4);
  border: var(--border-mid) solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast);
}
.btn:hover { background: var(--color-accent-soft); }
.btn--primary { background: var(--color-action); color: var(--color-on-action); }
.btn--primary:hover { background: var(--color-action-hover); }
.btn--large {
  min-height: var(--size-control-lg);
  padding: 0 var(--space-6);
  border-width: var(--border-thick);
  font-size: var(--text-md);
}

/* 글자 버튼: 밑줄로 누를 수 있음을 알린다. */
.textbtn {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-control);
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: var(--border-thin);
  text-underline-offset: var(--space-1);
  cursor: pointer;
}
.textbtn:hover { background: var(--color-accent-soft); }

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  text-decoration: none;
  white-space: nowrap;
}
.brand__name {
  padding: 0 var(--space-1);
  background: linear-gradient(to top, var(--color-mark) 46%, transparent 46%);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
}
.brand__sub { font-size: var(--text-sm); font-weight: var(--weight-bold); }

/* 펜으로 그린 확인란 */
.box {
  flex: none;
  position: relative;
  display: inline-block;
  width: var(--size-icon);
  height: var(--size-icon);
  border: var(--border-thick) solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}
.box--on { background: var(--color-line-strong); }
.box--on::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 32%;
  width: 30%;
  height: 56%;
  border: solid var(--color-bg);
  border-width: 0 var(--border-thick) var(--border-thick) 0;
  transform: rotate(40deg);
}

/* 찾기 입력: 줄 위에 적는 칸 */
.find { position: relative; }
.find__input {
  width: 100%;
  min-height: var(--size-control-sm);
  padding: 0 var(--space-2) 0 var(--space-6);
  border: 0;
  border-bottom: var(--border-mid) solid var(--color-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
}
.find__input::placeholder { color: var(--color-text-muted); opacity: 1; }
.find__icon {
  position: absolute;
  top: 50%;
  left: var(--space-1);
  width: var(--space-4);
  height: var(--space-4);
  margin-top: calc(var(--space-4) * -0.5);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  pointer-events: none;
}

/* ---------- 사무국: 위쪽 줄 ---------- */

.office {
  min-height: calc(100vh - var(--size-bar));
  background: var(--color-bg);
}

.top {
  display: flex;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  min-height: var(--size-topbar);
  padding: var(--space-2) var(--space-6);
  border-bottom: var(--border-thin) solid var(--color-line);
}
.top .brand__name { font-size: var(--text-md); }
.top__society { font-size: var(--text-sm); font-weight: var(--weight-bold); white-space: nowrap; }
.role { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.role__label { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); white-space: nowrap; }
.role__select {
  min-height: var(--size-control-sm);
  padding: 0 var(--space-1);
  border: 0;
  border-bottom: var(--border-mid) solid var(--color-line-strong);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.top .find { flex: 1 1 20rem; max-width: 24rem; margin-left: auto; }
.top__links { display: flex; align-items: center; gap: var(--space-4); }
.top__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-underline-offset: var(--space-1);
  white-space: nowrap;
}
.top__link:hover { background: var(--color-accent-soft); }

/* 찾기 결과: 입력 아래에 펼쳐지는 메뉴 목록 */
.find__results {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  left: 0;
  z-index: 5;
  padding: var(--space-2) 0;
  border: var(--border-mid) solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.find__results[hidden] { display: none; }
.find__item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: none;
}
.find__item:hover { background: var(--color-accent-soft); }
.find__group { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.find__empty { padding: var(--space-2) var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------- 사무국: 가운데 한 단 ---------- */

.day {
  position: relative;
  max-width: var(--size-column);
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-8);
}
/* 노트의 세로 여백선. 한 단의 왼쪽에 선다. */
.day::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--space-6) * -1);
  border-left: var(--border-thin) solid var(--color-line-accent);
}

.day__date { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.day__title {
  margin-top: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}

/* 진행 표시: 일곱 칸 */
.progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  margin-top: var(--space-3);
}
.progress__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-control-sm);
  padding: var(--space-1) var(--space-2);
  border: var(--border-mid) solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-align: center;
}
.progress__cell[data-state="late"] { border-color: var(--color-danger-soft); background: var(--color-danger-soft); color: var(--color-text); }
.progress__cell[data-state="now"] {
  border: var(--border-thick) solid var(--color-line-strong);
  background: var(--color-mark);
  color: var(--color-text);
}
.progress__cell[data-state="done"] {
  border-color: var(--color-line-strong);
  background: var(--color-line-strong);
  color: var(--color-bg);
}
.progress__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.progress__legend span { display: inline-flex; align-items: center; gap: var(--space-1); }
.progress__legend i {
  display: inline-block;
  width: var(--space-3);
  height: var(--space-3);
  border-radius: var(--radius-sm);
}
.legend--done { background: var(--color-line-strong); }
.legend--now { border: var(--border-thick) solid var(--color-line-strong); background: var(--color-mark); }
.legend--late { background: var(--color-danger-soft); }

/* 지금 할 일 한 건 */
.now {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: var(--border-thick) solid var(--color-line-strong);
}
.now__type { display: flex; align-items: baseline; gap: var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.now__step { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.now__title {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.now__why { margin-top: var(--space-3); font-size: var(--text-md); line-height: var(--leading-snug); }
.now__facts { margin-top: var(--space-3); }
.now__facts li {
  padding: var(--space-1) 0;
  border-bottom: var(--border-thin) solid var(--color-line);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}
.now__facts li:first-child { border-top: var(--border-thin) solid var(--color-line); }

/* 결재선: 한 줄 */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); }
.chain__step { display: inline-flex; align-items: center; gap: var(--space-2); }
.chain__step .box { width: var(--space-4); height: var(--space-4); }
.chain__step[data-status="pending"] { font-weight: var(--weight-bold); }

/* 누르면 일어나는 일: 펜으로 옆줄을 그은 인용 */
.now__preview {
  margin-top: var(--space-4);
  padding-left: var(--space-4);
  border-left: var(--border-thick) solid var(--color-line-strong);
}
.now__preview-label { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.now__preview-text { font-size: var(--text-base); line-height: var(--leading-snug); }
.now__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-5);
}
.now__actions .btn--primary { margin-right: var(--space-3); }

/* 모두 끝낸 상태 */
.alldone__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.alldone__note { margin-top: var(--space-3); font-size: var(--text-md); }

/* 다음 차례 */
.section-title {
  padding-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
.queue { margin-top: var(--space-7); }
.queue__list { border-top: var(--border-thin) solid var(--color-line-strong); counter-reset: q; }
.queue__item { border-bottom: var(--border-thin) solid var(--color-line); }
.queue__btn {
  display: grid;
  grid-template-columns: var(--space-6) var(--size-label) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--size-control);
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.queue__btn:hover .queue__title { text-decoration: underline; text-underline-offset: var(--space-1); }
.queue__btn:hover { background: var(--color-surface-2); }
.queue__no { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; text-align: right; }
.queue__type { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.queue__title { font-weight: var(--weight-bold); line-height: var(--leading-snug); }
.queue__when { font-size: var(--text-sm); white-space: nowrap; }
.queue__empty { padding: var(--space-3) 0; color: var(--color-text-muted); }

/* 끝낸 일: 접힌 목록 */
.done { margin-top: var(--space-6); }
.done__summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-control);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-underline-offset: var(--space-1);
  cursor: pointer;
}
.done__list { border-top: var(--border-thin) solid var(--color-line-strong); }
.done__item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--border-thin) solid var(--color-line);
}
.done__item .box { width: var(--space-4); height: var(--space-4); align-self: center; }
.done__title { color: var(--color-text-muted); text-decoration: line-through; text-decoration-thickness: var(--border-thin); }
.done__what { margin-left: auto; font-size: var(--text-sm); font-weight: var(--weight-bold); white-space: nowrap; }

/* 수치: 문장으로 */
.facts { margin-top: var(--space-6); font-size: var(--text-base); line-height: var(--leading-normal); }
.facts p + p { margin-top: var(--space-2); }

/* ---------- 전체 메뉴 판 ---------- */

.menu {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-text);
}
.menu::backdrop { background: var(--color-overlay); }
.menu__inner { max-width: var(--size-content); margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-7); }
.menu__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: var(--border-thick) solid var(--color-line-strong); }
.menu__title { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-display); }
.menu__groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-6);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.menu__group-name { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.menu__sub { margin: var(--space-3) 0 var(--space-1); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.menu__list { margin: 0; padding: 0; list-style: none; border-top: var(--border-thin) solid var(--color-line-strong); }
.menu__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--size-control);
  padding: var(--space-2) 0;
  border-bottom: var(--border-thin) solid var(--color-line);
  color: var(--color-text);
  font-weight: var(--weight-bold);
  text-decoration: none;
}
.menu__link:hover .menu__name { text-decoration: underline; text-underline-offset: var(--space-1); }
.menu__link[aria-current="page"] .menu__name { margin: 0 calc(var(--space-1) * -1); padding: 0 var(--space-1); background: var(--color-mark); }
.menu__link--soon { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.menu__soon { font-size: var(--text-2xs); font-weight: var(--weight-bold); white-space: nowrap; }
.menu__here { font-size: var(--text-2xs); font-weight: var(--weight-bold); }
.menu__foot { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: var(--space-7); }

/* ---------- 포털 ---------- */

.portal { background: var(--color-bg); }
.p-head { border-bottom: var(--border-thin) solid var(--color-line); }
.p-head__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--size-wide);
  min-height: var(--size-header);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.p-nav { display: flex; gap: var(--space-5); margin-left: auto; }
.p-nav__link { padding: var(--space-2) 0; font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }
.p-nav__link:hover { background: linear-gradient(to top, var(--color-mark) 40%, transparent 40%); }

.p-main { max-width: var(--size-wide); margin: 0 auto; padding: 0 var(--space-5) var(--space-8); }
.intro { padding: var(--space-7) 0 var(--space-6); }
.intro__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.intro__lead { margin-top: var(--space-3); font-size: var(--text-md); }

/* 문답 */
.ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--size-result);
  gap: var(--space-8);
  align-items: start;
  padding-top: var(--space-5);
  border-top: var(--border-thick) solid var(--color-line-strong);
}
.q + .q { margin-top: var(--space-6); }
.q__no { display: block; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.q__text { display: block; margin-top: var(--space-1); font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-display); line-height: var(--leading-snug); }
.q__answers { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.answer { position: relative; display: inline-flex; }
.answer input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.answer span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-control);
  padding: 0 var(--space-4);
  border: var(--border-mid) solid var(--color-line-strong);
  border-radius: var(--radius-md);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.answer span::before {
  content: "";
  width: var(--space-3);
  height: var(--space-3);
  border: var(--border-thick) solid var(--color-line-strong);
  border-radius: var(--radius-full);
}
.answer input:checked + span { background: var(--color-mark); }
.answer input:checked + span::before { background: var(--color-line-strong); }
.answer input:hover + span { background: var(--color-accent-soft); }
.answer input:checked:hover + span { background: var(--color-action-hover); }
.answer input:focus-visible + span { outline: var(--border-thick) solid var(--color-focus); outline-offset: var(--space-1); }
.base { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--border-thin) solid var(--color-line); }

/* 결과: 왼쪽에 펜 줄을 그은 메모 */
.result { padding-left: var(--space-5); border-left: var(--border-thick) solid var(--color-line-strong); }
.result__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-display); line-height: var(--leading-snug); }
.result__label { margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.result__menus li { padding: var(--space-1) 0; border-bottom: var(--border-thin) solid var(--color-line); font-size: var(--text-sm); line-height: var(--leading-snug); }
.result__group { display: inline-block; min-width: 4.5em; font-weight: var(--weight-bold); }
.result__menus .is-new { background: var(--color-accent-soft); }
.result__tasks li { padding: var(--space-1) 0; font-size: var(--text-sm); line-height: var(--leading-snug); }
.result__tasks b { margin-right: var(--space-2); }
.result .btn--primary { width: 100%; margin-top: var(--space-5); }

/* 그 아래: 세 단계, 학회 찾기 */
.more {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--size-result);
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: var(--border-thin) solid var(--color-line-strong);
}
.steps__list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--border-thin) solid var(--color-line); font-weight: var(--weight-bold); }
.steps__no { color: var(--color-text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.note-line { margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }
.search .find__input { min-height: var(--size-control); font-size: var(--text-base); padding-left: var(--space-6); }
.search__results { margin-top: var(--space-2); }
.search__item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--border-thin) solid var(--color-line);
  text-decoration: none;
}
.search__item:hover .search__name { text-decoration: underline; text-underline-offset: var(--space-1); }
.search__name { font-weight: var(--weight-bold); }
.search__meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.search__empty { padding: var(--space-2) 0; color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------- 좁은 화면 ---------- */

@media (max-width: 1100px) {
  .ask, .more { gap: var(--space-6); }
}

@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: var(--space-2) var(--space-4); }
  .top .find { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
  .day { padding-right: var(--space-4); padding-left: calc(var(--space-4) + var(--space-3)); }
  .day::before { left: var(--space-3); }
  .menu__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ask, .more { grid-template-columns: minmax(0, 1fr); }
  .p-nav { display: none; }
  .p-head__inner { justify-content: space-between; }
}

@media (max-width: 720px) {
  /* 사무국: 같은 한 단. 주 버튼은 아래에 고정한다. */
  .office { padding-bottom: var(--size-dock); }
  .top { gap: var(--space-1) var(--space-3); }
  .top__society, .role__label { display: none; }
  .top__links { order: 4; width: 100%; justify-content: flex-start; }
  .top__link, .role__select { display: inline-flex; align-items: center; min-height: var(--size-control); }
  .top .menu-open { margin-left: auto; }
  .brand { min-height: var(--size-control); align-items: center; }
  .find__input { min-height: var(--size-control); }
  .find__item { min-height: var(--size-control); align-items: center; }
  .day { padding-top: var(--space-5); }
  .progress__cell { font-size: 0; }
  .progress__cell::before { content: attr(data-no); font-size: var(--text-xs); }
  .now__title { font-size: var(--text-xl); }
  .now__why { font-size: var(--text-base); }
  .now__actions .btn--primary,
  .result .btn--primary {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    width: auto;
    min-height: var(--size-dock);
    margin: 0;
    border-width: var(--border-thick) 0 0;
    border-radius: 0;
  }
  .queue__btn {
    grid-template-columns: var(--space-5) minmax(0, 1fr);
    grid-template-areas: "no type" "no title" "no when";
    row-gap: 0;
  }
  .queue__no { grid-area: no; }
  .queue__type { grid-area: type; }
  .queue__title { grid-area: title; }
  .queue__when { grid-area: when; }
  .done__item { flex-wrap: wrap; }
  .done__what { margin-left: calc(var(--space-4) + var(--space-3)); }
  .menu__inner { padding: var(--space-4); }
  .menu__groups { gap: var(--space-5) var(--space-4); }

  /* 포털 */
  .portal { padding-bottom: var(--size-dock); }
  .p-head__inner { min-height: var(--size-topbar); padding: 0 var(--space-4); }
  .p-main { padding: 0 var(--space-4) var(--space-7); }
  .intro { padding: var(--space-5) 0 var(--space-5); }
  .intro__title { font-size: var(--text-xl); }
  .intro__lead { font-size: var(--text-base); }
  .q__text { font-size: var(--text-lg); }
  .answer span { white-space: normal; }
  .result { padding-left: var(--space-4); }
  .search__item { min-height: var(--size-control); align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .textbtn { transition: none; }
}
