/* smallthang 화면. 색의 **원본은 여기**다 — 아래 브랜드 램프(red/oak/linen/walnut)가 그것이고,
   다른 화면들(메모앱 · devboard · 프로젝트 작업대)은 그 램프를 `smallthang-design` 킷으로 옮겨 쓴다.

   그래서 이 파일은 킷을 **더해서** 쓴다. 킷에서 오는 것은 이 파일에 없던 것들이다 — 뜻이 있는 색 넷
   (--ok · --exception · --bad · --search), 머리띠 토큰(--head*), 선 아이콘 규칙(.icon · .with-icon),
   마크 자리(.brand · .st-mark), 그리고 그것들의 다크 벌. 아래 :root 가 킷보다 뒤에 있으므로 **이 파일이 정한
   이름은 그대로 이긴다** — 화면 모습은 달라지지 않는다.

   일부러 다른 두 가지: `--bg` 는 linen-100(킷의 --paper 는 linen-200)이고, `--accent` 는 브랜드 red-500 이다
   (킷은 리넨 위 AA 를 넘기려고 한 단계 어둡게 잡았다). 브랜드 화면이므로 램프 쪽을 따른다.

   글꼴은 부르지 않는다 — 이 사이트는 시스템 글꼴로 선다(킷의 fonts.css 는 글꼴을 함께 둔 프로젝트만 쓴다).
   `tokens.css` 는 여기서 **@import 하지 않는다** — `base.html` 이 이 파일보다 **먼저** `<link>` 로 부른다.
   @import 로 이으면 브라우저가 style.css 를 다 받은 뒤에야 tokens.css 를 찾아 첫 화면이 250ms 늦었다
   (2026-09-21 딜레이 점검). 킷을 고쳤으면 `tests/test_design_kit.py` 가 사본이 갈라졌는지 본다. */

:root {
  color-scheme: light;

  /* smallthang 브랜드 팔레트 (claude.ai/design 프로젝트에서 그대로 가져옴) */
  --red-100: #F7E7E4;
  --red-500: #A85A50;
  --red-600: #954E45;
  --red-700: #7C4139;
  --red-soft: #E8A193;
  /* 위험한 동작 전용 — 브랜드 red 램프 **바깥**이다. 램프 안에서 고르면 눌린 보통 단추와 겹친다
     (2026-09-22 전까지 --error 와 --accent-press 가 글자 그대로 같은 #7C4139 였다). 값은 CIEDE2000
     색차와 제1·제2 색각이상 시뮬레이션으로 골랐다 — 밝은 벌은 강조와 색차 20.2(색각이상에서도
     20.2 이상, 카드 위 대비 11.5), 어두운 벌은 12.0(색각이상 12.0 이상, 대비 7.4). */
  --crimson-700: #6F1114;
  --crimson-200: #E9AABB;
  --oak-100: #F4EDE1;
  --oak-200: #EDE4D3;
  --oak-300: #D3B58F;
  --oak-500: #B08258;
  --oak-600: #93683F;
  --oak-700: #6E5233;
  --light-200: #F7E4C4;
  --light-500: #EFC68C;
  --linen-000: #FDFBF6;
  --linen-100: #FCF6EC;
  --linen-200: #FAF1E4;
  --gray-400: #ADA7A0;
  --gray-500: #8C8781;
  --sky-300: #A9C6D6;
  --sky-500: #6E96AE;
  --walnut-500: #6E5C4A;
  --walnut-700: #463A2D;
  --walnut-900: #33291F;

  --bg: var(--linen-100);
  --panel: var(--linen-000);
  --ink: var(--walnut-700);
  --muted: var(--walnut-500);
  --accent: var(--red-500);
  --accent-hover: var(--red-600);
  --accent-press: var(--red-700);
  --accent-fg: var(--linen-000);
  --border: var(--oak-200);
  --border-strong: var(--oak-500);
  --error: var(--crimson-700);
  --fill: var(--oak-100);
  --lens: var(--sky-500);            /* smallens 표식 — 파스텔 블루(사용자 피드백 #4) */
  --logo-word: var(--gray-500);      /* 첫 화면 글씨 — 회색 쪽으로(#5 · #17) */

  --font-body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", -apple-system, sans-serif;
  --font-display: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", -apple-system, sans-serif;

  /* 화면 폭 하나 — 킷이 --kit-page-w 를 주면 그것을, 아니면 1120px. 화면마다 폭을 따로 정하지 않는다. */
  --page-w: var(--kit-page-w, 1120px);
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 34px;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 0 rgba(70, 58, 45, 0.05);
  --shadow-md: 0 10px 28px -18px rgba(70, 58, 45, 0.28);
}

/* 원본 디자인에는 다크 배색이 없어 walnut/oak 톤을 그대로 반전해 만든 것 — 브랜드 채도는
   유지하되 밝기만 뒤집었다. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--walnut-900);
    --panel: var(--walnut-700);
    --ink: var(--linen-000);
    --muted: var(--light-500);
    --accent: var(--red-soft);
    --accent-hover: #f0b4a7;
    --accent-press: var(--red-500);
    --accent-fg: var(--walnut-900);
    --border: var(--oak-600);
    --border-strong: var(--oak-300);
    --error: var(--crimson-200);
    --fill: var(--oak-700);
    --lens: var(--sky-300);
    --logo-word: var(--gray-400);
  }
}

* { box-sizing: border-box; }

/* 선택자를 늘어놓으면 새로 들어온 요소가 빠진다 — select 와 summary 가 그렇게 빠져 있었다. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  /* 한글은 기본이 글자마다 줄바꿈 자리라 좁은 화면에서 "관리자" 같은 낱말이 「관/리/자」처럼
     끊긴다 — keep-all 로 막는다. 예전에는 여기서 overflow-wrap:anywhere 로 공백 없는 긴 토큰을
     끊었는데, `anywhere` 는 min-content 계산에도 끼어들어 PC 기기 표의 긴 이름 칸까지 한 글자
     폭으로 짜부라뜨렸다(재점검 #2 · 2026-09-25, 표 칸 134px 줄 높이). `break-word` 는 실제 줄바꿈은
     그대로 하되 min-content 계산에는 끼어들지 않는다 — 인증 키·otpauth 주소처럼 꼭 끊어야 하는
     자리는 `.totp-secret`·`.totp-uri code` 가 따로 `anywhere` 를 쓴다(#1). */
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1 { font-size: 1.5rem; margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; }
/* 가운데 정렬은 로고 아래 서는 화면(첫 화면 · 로그인 · 오류)만 — 작업 화면의 제목은 왼쪽(2026-09-21). */
.home h1, .login h1, .error-page h1 { text-align: center; }

a { color: var(--accent); }

input, button, select, textarea {
  font: inherit;
  color: inherit;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  padding: 10px 12px;
}

input { background: var(--panel); }
input[type="checkbox"] { accent-color: var(--accent); }

/* <summary> 는 눌러서 펼치는 자리다 — 어디 있든 44px 아래로 내려가지 않는다(#18). display 는
   기본(list-item) 그대로 둔다 — flex 로 바꾸면 펼침 삼각형이 사라져 펼치는 상자인 줄 모른다. */
summary {
  cursor: pointer;
  min-height: 44px;
  /* 닫힌 「삭제」 같은 짧은 글자는 높이만 44px 이고 폭은 글자만큼(30px 안팎)이었다 — 폭도
     맞춘다(#8). */
  min-width: 44px;
  padding-block: 10px;
  box-sizing: border-box;
}
/* 되돌릴 수 없거나 끄는 동작을 여는 summary 는 링크처럼 — 위험색 + 밑줄(#18). */
.confirm summary {
  color: var(--error);
  text-decoration: underline;
  text-underline-offset: 2px;
}

button {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 500;
}
button:hover { background: var(--accent-hover); }
button:active { background: var(--accent-press); }

button.link, a.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: none;
  color: var(--accent);
  border: none;
  padding: 4px 8px;
  text-decoration: underline;
}
button.link:hover, a.link:hover { background: none; color: var(--accent-press); }

/* 되돌릴 수 없는 동작은 **색만으로 가르지 않는다.** 이 팔레트는 전부 따뜻한 빨강 계열이라,
   위험색을 아무리 옮겨도 제1·제2 색각이상과 흑백에서 강조색 옆에 붙는다(2026-09-22 실측:
   어두운 벌에서 조건을 다 걸고 훑으면 남는 자리가 연한 분홍뿐이었고, 그건 위험을 뜻하지
   못한다). 그래서 **채움 여부**로 가른다 — 보통 단추는 꽉 찬 강조색, 위험한 단추는 두른 빈
   단추다. 가리키거나 초점이 가거나 누를 때만 채워서 지금 누르는 것이 무엇인지 분명히 한다.
   WCAG 1.4.1 이 요구하는 「색만을 유일한 수단으로 쓰지 않는다」가 이것이다. */
button.danger {
  background: none;
  color: var(--error);
  border: 2px solid var(--error);
  padding: 8px 14px;   /* 테두리 2px 를 좌우·상하에서 덜어 보통 단추와 같은 크기로 선다 */
}
button.danger:hover,
button.danger:focus-visible,
button.danger:active {
  background: var(--error);
  color: var(--accent-fg);
}

/* 브랜드 마크 — 픽셀 하트 네 개로 만든 워드마크 로고. assets/smallthang-mark.svg 를 마스크로 얹어
   accent 색(라이트 red-500 · 다크 red-soft)을 그대로 입힌다. */
.st-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.st-logo__mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-color: var(--accent);
  -webkit-mask: url(/static/assets/smallthang-mark.svg) no-repeat center / contain;
  mask: url(/static/assets/smallthang-mark.svg) no-repeat center / contain;
}
.st-logo__word {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--logo-word);
  text-transform: lowercase;
  font-size: 1.2rem;
}
.st-logo--lg {
  flex-direction: column;
  gap: var(--space-2);
}
.st-logo--lg .st-logo__mark { width: 64px; height: 64px; }
.st-logo--lg .st-logo__word { font-size: 1.15rem; }

/* 한 폭 — 모든 화면은 --page-w 안에 선다. 기본 환경은 회사 PC 브라우저(1280~1920px)이고 폰(390px)은
   아래 @media 가 한 열로 세운다(사용자 2026-09-21). 좁은 화면은 그 폭의 몫으로 잡는다. */
.login { max-width: calc(var(--page-w) * 0.32); margin: 10vh auto 0; text-align: center; }
.login .st-logo { margin-bottom: var(--space-4); }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login label { text-align: left; display: flex; flex-direction: column; gap: 4px; }

/* 계정 줄 — 화면 맨 위 오른쪽. 이름은 표식(링크 아님), 나머지는 링크. */
.site-head {
  max-width: var(--page-w);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-head form { margin: 0; }
.account-name { font-weight: 600; color: var(--ink); margin-right: 8px; }

.home { max-width: var(--page-w); margin: 6vh auto 0; text-align: center; }
.home .st-logo { justify-content: center; margin-bottom: var(--space-4); }

/* 앱 칸과 DEVBOARD 칸이 한 격자 — 넓은 화면에 세 칸, 폰에서는 한 열. */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: 28px;
  text-align: left;
}
.app-links { display: contents; list-style: none; margin: 0; padding: 0; }
/* 권한 없는 계정의 안내 문구 — 격자의 첫 칸에 갇혀 PC 에서 왼쪽에 붙어 있었다(재점검 LOW #11).
   격자 셋 칸을 모두 가로질러 가운데로. */
.home-grid > .empty { grid-column: 1 / -1; text-align: center; }
.app-links li { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

.app-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 20px 48px 20px 24px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
  transition: box-shadow 180ms cubic-bezier(0.32, 0.72, 0.3, 1);
}
a.app-link:hover, a.app-link:active { box-shadow: var(--shadow-md); }
.app-link.is-soon { color: var(--muted); }
.app-icon { font-size: 1.4rem; }
/* 표식은 이모지와 같은 자리를 차지한다 — 줄 높이가 칸마다 달라지지 않게. */
.app-mark {
  width: 1.4rem;
  height: 1.4rem;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.app-mark--lines {
  background-color: var(--accent);
  -webkit-mask-image: url(/static/assets/smallines-mark.svg);
  mask-image: url(/static/assets/smallines-mark.svg);
}
.app-mark--lens {
  background-color: var(--lens);
  -webkit-mask-image: url(/static/assets/smallens-mark.svg);
  mask-image: url(/static/assets/smallens-mark.svg);
}
.app-name {
  font-size: 1.1rem;
  font-weight: 600;
  /* 램프 변수(walnut-500)를 직접 박으면 어두운 화면에서 바탕과 붙는다 — 역할 변수를 쓴다. */
  color: var(--ink);
}
.app-chevron { position: absolute; right: 18px; color: var(--accent); font-size: 1.4rem; }
.app-note { font-size: 0.85rem; color: var(--muted); }

/* DEVBOARD 칸 — 앱 칸과 같은 문법(카드)이되 점선 테두리와 「개발용」 라벨로 가른다(사용자 피드백 #3). */
.dev-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 20px 48px 20px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 180ms cubic-bezier(0.32, 0.72, 0.3, 1);
}
.dev-link:hover, .dev-link:active { border-style: solid; box-shadow: var(--shadow-md); }
.dev-icon { font-size: 1.4rem; }
.dev-label {
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  white-space: nowrap;
}

/* 첫 화면 맨 아래, 안드로이드 폰에서만 보이는 내려받기 한 줄 — 작게 둔다(사용자 요청 2026-09-18). */
.app-download { margin-top: 24px; text-align: center; font-size: 0.85rem; }
/* 폰에서 누르는 유일한 설치 링크다 — 글자는 작게 두되 누르는 자리는 44px 로 키운다(2026-09-21). */
.app-download a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
}

.account-page { max-width: calc(var(--page-w) * 0.6); margin: 5vh auto 0; }
.account-page > .st-logo { margin-bottom: var(--space-2); }
.account-page section { margin-top: 24px; }
.hint { color: var(--muted); font-size: 0.9rem; }
.device-code-box { display: flex; flex-direction: column; gap: 4px; }
.device-code { font-size: 2rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

/* 인증 앱(2단계 로그인) — 체크 한 줄, 손으로 옮겨 칠 키, 길어도 줄이 바뀌는 주소(#116). */
.login label.check, .account-page label.check {
  flex-direction: row; align-items: center; gap: 8px; text-align: left; min-height: 44px;
}
label.check input[type="checkbox"] { min-height: auto; width: 18px; height: 18px; flex: none; }
.account-page form label { display: flex; flex-direction: column; gap: 4px; max-width: 16rem; }
.account-page form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.totp-steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 16px; }
/* 32자 한 줄(397px)은 328px 폰 문서 폭을 넘긴다 — overflow-wrap:anywhere(body) 로 줄이
   바뀌게 하고, 4자씩 띄어 보이는 것은 하지 않는다: user-select:all 로 그대로 복사되는 값이라
   빈칸이 섞이면 붙여넣는 인증 앱이 그 빈칸을 지우지 않을 수 있다(#1). */
/* body 가 이제 anywhere 대신 break-word 라, 공백 없는 32자 키는 여기서 따로 anywhere 를 켠다(#1). */
.totp-secret {
  font-size: 1.25rem; letter-spacing: 0.12em; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.totp-key { margin: 8px 0; user-select: all; }
.totp-uri code { overflow-wrap: anywhere; font-size: 0.8rem; color: var(--muted); user-select: all; }
.totp-on { color: var(--accent); font-weight: 600; }

/* 표 공통 — 계정 목록과 기기 목록이 같은 모양. */
.table-wrap { overflow-x: auto; }
.admin-list table, .device-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.admin-list th, .admin-list td, .device-table th, .device-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: middle;
}
.admin-list th, .device-table th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
/* 「잠김」이 「정상」과 같은 보통 글씨였다 — 색만이 아니라 표식과 굵기로도 가른다(#10). */
.status-locked { color: var(--error); font-weight: 700; }
.admin-list tr:last-child td, .device-table tr:last-child td { border-bottom: none; }
/* 기기 표 — 날짜 칸은 줄을 바꾸지 않아 「끊기」가 아래로 떨어지지 않는다. */
.device-table td { white-space: nowrap; }
.device-table td:first-child { white-space: normal; }
.cell-action { text-align: right; width: 1%; }
.cell-action form { margin: 0; }
.danger-link { color: var(--error); }
button.link.danger-link:hover, a.link.danger-link:hover { color: var(--error); }

/* 눈에는 안 보이되 자동완성 · 스크린리더는 읽는 칸(재점검 LOW #9) — `hidden` 속성이나
   display:none 은 일부 비밀번호 관리자가 아예 건너뛴다. 값은 변하지 않으니 layout 은 1px. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error { color: var(--error); }
.error-page { text-align: center; margin-top: 15vh; }
.error-page .st-logo { justify-content: center; margin-bottom: var(--space-4); }

.admin { max-width: var(--page-w); margin: 5vh auto 0; }
.admin > .st-logo { margin-bottom: var(--space-2); }
/* h1(1.5rem)과 h2 가 똑같이 24px 로 서던 것을 가른다 — 관리 화면과 같은 크기로(#19). */
.admin h2, .account-page h2 { font-size: 1.05rem; margin: 24px 0 8px; font-family: var(--font-display); }

/* 설명 두 상자 — 줄이 화면 폭만큼 길어지면 읽기 어렵다: 70자쯤에서 접는다. */
.admin-explainer {
  background: var(--fill);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-top: 16px;
  max-width: 70ch;
}
.admin-explainer summary { cursor: pointer; font-weight: 600; }
.admin-explainer ul { margin: 12px 0 0; padding-left: 1.2em; }
.admin-explainer li { margin-bottom: 10px; line-height: 1.6; }
.admin-explainer li:last-child { margin-bottom: 0; }
/* 설명 상자 바탕(--fill) 위의 보통 강조색 글자는 밝은 벌에서 4.25:1 — AA(4.5) 에 못 미쳤다.
   더 짙은(밝은 벌) · 더 옅은(어두운 벌) 벌로 옮긴다(#22). */
.admin-explainer a.link { color: var(--accent-press); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .admin-explainer a.link { color: var(--red-100); }
}

/* 새 계정 — 세 칸과 단추가 가로 한 줄(PC). 폰에서는 아래 @media 가 세로로 세운다. */
.admin-create form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.admin-create label { display: flex; flex-direction: column; gap: 4px; text-align: left; flex: 1 1 12rem; }

/* 계정 줄 + 동작 줄이 한 쌍 — 사이 선을 지우고 동작 줄 아래에만 선을 둔다. */
.admin-list tr.account td { border-bottom: none; padding-bottom: 4px; }
.admin-list tr.panel td { padding: 0 12px 10px; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.action-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.action-bar input { min-height: 44px; padding: 6px 8px; width: 12rem; max-width: 100%; }
.action-bar button { min-height: 44px; padding: 6px 12px; }
/* 두른 단추는 테두리 2px 만큼 안쪽을 덜어야 옆 단추와 같은 높이로 선다. */
.action-bar button.danger { padding: 4px 10px; }
.action-bar summary {
  cursor: pointer;
  color: var(--accent);
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* 펼친 것은 한 줄을 다 쓴다 — 옆 손잡이들이 밀리지 않게. */
.action-bar details[open] { flex-basis: 100%; }
.action-bar details form { margin: 4px 0 8px; }
.action-bar .confirm { margin-left: auto; }
.action-bar .confirm summary { color: var(--error); }
.action-bar .confirm form span { color: var(--error); }

/* 계정 표의 "쓰는 앱" 칸 — 펼치지 않고도 누가 무엇을 어느 단계로 쓰는지 보인다. 알약 모양은
   전부 같다 — 「모든 앱」도 알약이다(2026-09-21). */
.app-tag {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1px 8px;
  margin: 1px 2px 1px 0;
  border-radius: 999px;
  background: var(--fill);
  white-space: nowrap;
}
/* 열람만은 글자를 흐리게 하지 않는다 — 어두운 모드에서 흐린 색이 명암비 4.5:1 아래로 떨어졌다.
   구분은 채운 바탕 대신 테두리로 하고, 뜻은 알약 안의 "· 열람만" 글자가 지고 간다. */
.app-tag.is-view { background: none; border: 1px solid var(--border); padding: 0 7px; }
.app-none { color: var(--muted); font-size: 0.8rem; }

/* 앱 할당 — 앱 하나가 한 칸(체크 · 이름 · 단계), 다섯 칸이 한 줄. */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 16px;
  width: 100%;
}
.app-choice { display: flex; flex-direction: column; gap: 4px; }
.app-checkbox { display: flex; align-items: center; gap: 6px; min-height: 44px; white-space: nowrap; }
.app-checkbox input[type="checkbox"] {
  min-height: auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  background: none;
  flex: none;
}

/* select — 브라우저 기본 모양 대신 입력칸과 같은 테두리, 오른쪽에 화살표 하나(CSP 의 img-src data: 로 그린다). */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236E5C4A' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  /* 다른 입력칸과 같은 44px(#8) — 예전 36px 는 앱 할당 표의 select 가 누르는 자리로는 좁았다. */
  min-height: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23EFC68C' stroke-width='1.6'/%3E%3C/svg%3E");
  }
}

.action-bar form.session-row {
  width: 100%;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.action-bar form.session-row:last-child { border-bottom: none; }
.session-info { font-size: 0.9rem; color: var(--muted); }
/* 관리자가 보고 있는 바로 그 창 — 모르고 끊으면 자기가 로그아웃된다. */
.session-here { color: var(--accent); }

.admin-activity { margin-top: 24px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.activity-list li:last-child { border-bottom: none; }
.activity-at { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 0.9rem; }

/* 운영 화면(/admin/ops, #116) — 단추 표는 PC 에서 그대로, 폰 폭(700px 미만)에서는 접은 <details> 안.
   숨은 쪽은 display:none 이라 Tab 순서에도 들지 않는다. 꺼진 단추는 흐리게 + 까닭 글(색만으로 가르지 않는다). */
.ops-links { display: flex; flex-wrap: wrap; gap: 0 8px; }
.notice { background: var(--fill); border-radius: var(--radius-sm); padding: 8px 12px; }
.ops-table { width: 100%; border-collapse: collapse; background: var(--panel);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ops-table th, .ops-table td { padding: 10px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.ops-table th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table .cell-action { width: 14rem; text-align: left; }
.ops-table form { margin: 0; }
.ops-result.is-bad, .ops-warnings .is-bad { color: var(--error); font-weight: 600; }
.ops-reason { display: inline-block; margin-top: 4px; }
button:disabled { opacity: 0.55; cursor: not-allowed; background: var(--fill); color: var(--ink); }
.ops-warnings { margin: 8px 0 0; padding-left: 1.2em; }
.ops-warnings li { margin-bottom: 6px; line-height: 1.5; }
.ops-warnings .is-warn::marker { content: "! "; }
.ops-result.is-off { color: var(--muted); }
.ops-memory { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.ops-memory label { display: flex; flex-direction: column; gap: 4px; }
.ops-confirm-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ops-confirm-form label { display: flex; flex-direction: column; gap: 4px; }
.ops-word { font-size: 1.1rem; }
/* 사람 탭 봇팅 확인 — 고를 것 둘을 세로로(단추 아래에 풀이), 취소는 맨 아래 */
.ops-choices { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ops-choices .hint { margin: 0 0 10px; }
/* 재시작 확인 — 그 회차 창이 일하는가(2026-09-25). 일하는 중이면 테두리 + 굵은 글(색만으로 가르지 않는다). */
.ops-work { margin: 12px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fill); }
.ops-work p { margin: 4px 0; }
.ops-work.is-busy { border: 2px solid var(--error); background: var(--panel); }
.ops-busy { color: var(--error); }
.ops-result.is-busy { color: var(--error); font-weight: 600; }
.ops-actions.only-narrow { display: none; }
.ops-actions.only-narrow > summary { cursor: pointer; font-weight: 600; min-height: 44px;
  display: flex; align-items: center; color: var(--accent); }
@media (max-width: 699px) {
  .ops-actions.only-wide { display: none; }
  .ops-actions.only-narrow { display: block; margin-top: 16px; }
  .ops-table .cell-action { width: auto; }
  /* 5칸 표가 328px 에 눌려 머리글이 「이/어/달/리/기」처럼 한 글자씩 서던 것과, 단추가
     61×161px 로 세로 한 글자씩 눌리던 것 — 표를 줄마다 카드로 바꾼다(#2 관리 표와 같은 문법). */
  .ops-table thead { display: none; }
  .ops-table, .ops-table tbody, .ops-table tr, .ops-table td { display: block; width: 100%; }
  .ops-table { background: none; box-shadow: none; border-radius: 0; }
  .ops-table tr {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .ops-table tr:last-child { margin-bottom: 0; }
  .ops-table td { border-bottom: none; padding: 6px 0; }
  .ops-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
  }
  .ops-table .cell-action button,
  .ops-table .cell-action a.link { width: 100%; justify-content: center; }
  /* 값 없는 칸(예: 꺼진 프로젝트의 「이어 달리기」)이 라벨만 남아 빈 줄로 보였다(재점검 LOW #10). */
  .ops-table td[data-label]:empty { display: none; }
}

/* 폰(≤640px) — 깨지지 않으면 된다: 격자는 한 열, 가로 줄은 세로로, 누르는 자리는 44px. */
@media (max-width: 640px) {
  .login, .account-page { max-width: none; }
  .site-head { flex-wrap: wrap; justify-content: center; }
  .home { margin-top: 4vh; }
  .home-grid { grid-template-columns: 1fr; }
  .app-link, .dev-link { min-height: 64px; padding: 12px 44px 12px 16px; }
  .admin-create form { flex-direction: column; align-items: stretch; }
  .admin-create label { flex-basis: auto; }
  .action-bar { gap: 0 12px; }
  .action-bar summary { min-height: 44px; }
  .action-bar .confirm { margin-left: 0; }
  .apps-grid { grid-template-columns: 1fr; }
  .action-bar form.session-row { flex-wrap: wrap; }

  /* 계정 표(452px)가 328px 문서 폭을 넘고, 동작 줄의 단추가 화면 밖으로 밀리고, 머리글
     「관리자」가 글자 단위로 끊기던 것 — 계정마다 카드로 바꾼다(#2). 동작 줄(.panel)은
     사이 선 없이 같은 카드에 이어 붙인다. */
  .admin-list table { border: none; box-shadow: none; background: none; }
  .admin-list thead { display: none; }
  .admin-list tr.account, .admin-list tr.panel { display: block; width: 100%; }
  .admin-list tr.account td, .admin-list tr.panel td { display: block; border-bottom: none; padding: 4px 0; }
  .admin-list tr.account {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-sm);
    padding: 10px 12px 4px;
  }
  .admin-list tr.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0 12px 10px;
    margin-bottom: 12px;
  }
  .admin-list td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
  }
  /* 값 없는 칸(예: 관리자가 아닌 계정의 「관리자」, 인증 앱을 안 켠 계정의 「인증 앱」)이
     라벨만 남아 빈 줄로 보였다(재점검 LOW #10). */
  .admin-list td[data-label]:empty { display: none; }

  /* 기억한 브라우저 · 연결된 기기 표 — 날짜 셋이 각자 줄바꿈해 3~4줄이 되던 것을, 이름은
     제 줄로 두고 나머지는 작은 글자로 한 줄에 묶어 흐르게 한다. 단추는 nowrap · 44px 이상(#4·#18). */
  .device-table thead { display: none; }
  .device-table, .device-table tbody { display: block; width: 100%; }
  .device-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    padding: 10px 0;
  }
  .device-table td { display: block; border-bottom: none; padding: 0; white-space: nowrap; }
  .device-table td:first-child { flex-basis: 100%; white-space: normal; }
  .device-table td:nth-child(2), .device-table td:nth-child(3), .device-table td:nth-child(4) {
    font-size: 0.8rem;
    color: var(--muted);
  }
  /* 옛 규칙 .cell-action{width:1%}(줄 405 안팎)이 flex 줄에서는 칸 폭을 3px 로 짜부라뜨려
     단추가 화면 밖으로 밀렸다(재점검 HIGH #1, 360px 폭에서 341~385px) — 여기서 되돌린다. */
  .device-table td.cell-action {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .device-table .cell-action button, .device-table .cell-action a.link {
    min-width: 44px;
    justify-content: center;
  }
  /* 날짜 셋의 머리글(기억·연결·마지막 사용·만료)이 thead 와 함께 숨어 무슨 날짜인지 몰랐다 —
     각 칸에 짧은 이름표를 붙인다(재점검 HIGH #1). */
  .device-table td[data-label]::before {
    content: attr(data-label) " ";
    font-weight: 600;
  }
}

/* ── 테마 메뉴 — 화면 맨 위 왼쪽의 작은 폼(JS 없음). 리넨에서는 흐름 밖의 작은 글씨 ─────────── */
.palette-menu {
  position: absolute;
  top: 0;
  left: 8px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}
.palette-menu button.palette-choice {
  min-height: 0;
  padding: 2px 6px;
  font-size: inherit;
  text-decoration: none;
}
.palette-menu button.palette-choice[aria-current="true"] { font-weight: 700; text-decoration: underline; }
