:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #172033;
  background: #f3f6fb;
  --navy: #13233f;
  --blue: #246bfd;
  --line: #dfe5ef;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
.locked > header, .locked > main { display: none; }
.auth-screen { min-height: 100vh; padding: 20px; display: grid; place-items: center; background: #f3f6fb; }
.auth-card { width: min(420px, 100%); margin: 0; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 14px 40px rgba(25, 44, 78, .12); }
.auth-card > p:not(.eyebrow) { margin: 10px 0 24px; color: #6c778c; font-size: 14px; line-height: 1.5; }
.auth-button { width: 100%; min-height: 52px; margin-top: 16px; border: 0; border-radius: 10px; color: white; background: var(--blue); font-weight: 800; }
.auth-error { min-height: 20px; margin-top: 12px; color: #d22b2b; font-size: 13px; text-align: center; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }

header {
  height: 68px;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--navy);
}
.brand { font-size: 18px; font-weight: 700; }
.brand span { color: #63a1ff; letter-spacing: .08em; }
.status { font-size: 13px; color: #cbd5e7; }

main { width: min(1200px, calc(100% - 48px)); margin: 42px auto; }
.search-panel, .results { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(25, 44, 78, .06); }
.search-panel { padding: 30px; margin-bottom: 22px; }
.heading, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
h2 { margin: 0; font-size: 18px; }

form { margin-top: 26px; }
label { display: grid; gap: 10px; font-size: 14px; font-weight: 700; }
input { width: 100%; height: 60px; padding: 0 18px; border: 1px solid #cbd3df; border-radius: 12px; outline: none; font-size: 17px; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 107, 253, .12); }
.secondary { min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 9px; color: #435069; background: white; font-weight: 700; }

.results { overflow: hidden; }
.result-heading { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.todo-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.tab-button { padding: 14px 16px 12px; border: 0; border-bottom: 3px solid transparent; color: #6c778c; background: none; font-weight: 700; }
.tab-button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--blue); }
#todo-count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 2px 6px; border-radius: 10px; color: #735f00; background: #fff1a8; font-size: 11px; }
.result-summary { display: flex; align-items: center; gap: 16px; color: #7a8497; font-size: 12px; }
#count { color: var(--blue); font-size: 14px; }
.message { padding: 70px 24px; text-align: center; color: #6c778c; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf0f5; text-align: left; word-break: break-word; }
th { color: #647087; background: #f8f9fc; font-size: 13px; }
td { font-size: 14px; }
tbody tr:hover { background: #f7faff; }
.result-row { cursor: pointer; }
.select-cell { padding-left: 14px; padding-right: 6px; text-align: center; }
.row-select { width: 18px; height: 18px; padding: 0; accent-color: var(--blue); cursor: pointer; }
.result-row:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.detail-row td { padding: 20px 24px; background: #f7faff; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px 24px; margin: 0; }
.detail-grid div { min-width: 0; }
.detail-grid dt { margin-bottom: 5px; color: #758097; font-size: 12px; font-weight: 700; }
.detail-grid dd { margin: 0; color: #172033; font-size: 14px; word-break: break-word; }
.no-detail { margin: 0; color: #758097; }
.memo-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.memo-heading { display: flex; justify-content: space-between; margin-bottom: 8px; }
.memo-heading label { display: block; font-size: 13px; }
.memo-status { color: #7a8497; font-size: 12px; }
.memo-input { width: 100%; min-height: 90px; padding: 12px 14px; resize: vertical; border: 1px solid #cbd3df; border-radius: 9px; background: white; font: inherit; line-height: 1.5; }
.memo-input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(36, 107, 253, .12); }
.value-with-copy { display: flex; align-items: flex-start; gap: 8px; }
.value-text { min-width: 0; flex: 1; }
.copy-value { flex: none; padding: 3px 7px; border: 1px solid #cbd3df; border-radius: 5px; color: #657188; background: white; font-size: 11px; line-height: 1.2; cursor: copy; }
.copy-value:hover { border-color: var(--blue); color: var(--blue); }
.copy-value:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.app-button { display: inline-flex; min-height: 42px; padding: 0 18px; align-items: center; justify-content: center; border-radius: 9px; font-weight: 800; text-decoration: none; }
.kakao-button, .kakao-navi-button { color: #191919; background: #fee500; }
.tmap-button { color: white; background: #ed1c24; }
.naver-button { color: white; background: #03c75a; }
.mobile-navigation { display: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10; padding: 11px 17px; border-radius: 9px; color: white; background: rgba(19, 35, 63, .94); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px; }

@media (max-width: 600px) {
  .auth-card { padding: 24px 20px; }
  header { height: 58px; padding: 0 16px; }
  .brand { font-size: 16px; }
  main { width: calc(100% - 20px); margin: 12px auto; }
  .search-panel { position: relative; padding: 16px; margin-bottom: 12px; }
  .search-panel .heading { display: block; }
  .eyebrow { display: none; }
  h1 { padding-right: 96px; font-size: 19px; line-height: 1.35; }
  .heading .secondary { position: absolute; top: 14px; right: 14px; min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
  form { margin-top: 14px; }
  input { height: 50px; padding: 0 14px; font-size: 15px; }
  .result-heading { padding: 18px 16px; }
  .todo-tabs { padding: 0 12px; }
  .result-summary > span { display: none; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody { padding: 9px; }
  tr { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 12px; }
  td { border: 0; }
  td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #778196; font-size: 11px; font-weight: 700; }
  .result-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .8fr) auto; gap: 13px 12px; padding: 14px; }
  .result-row td { display: block; min-width: 0; padding: 0; }
  .result-row .select-cell { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; align-items: center; padding: 0; text-align: center; }
  .result-row .select-cell::before { margin-bottom: 6px; }
  .result-row td:nth-child(2) { grid-column: 1 / 3; grid-row: 1; font-size: 18px; font-weight: 800; }
  .result-row td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; padding: 12px; border-radius: 9px; background: #f4f7fc; font-size: 15px; line-height: 1.5; }
  .result-row td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-row td:nth-child(5) { grid-column: 2 / 4; grid-row: 3; }
  .result-row .value-with-copy { align-items: center; }
  .row-select { width: 22px; height: 22px; }
  .detail-row { margin-top: -11px; border-top: 0; border-radius: 0 0 10px 10px; }
  .detail-row .detail-cell { display: block; padding: 14px 12px; }
  .detail-row .detail-cell::before { display: none; }
  .detail-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .app-button { width: 100%; padding: 0 4px; font-size: 13px; }
  .mobile-navigation { display: inline-flex; }
}
