/* ═══════════════════════════════════════════════════════════════
   SMS · 학원 알림톡 관리 시스템 — app.css
   ═══════════════════════════════════════════════════════════════ */

/* ── 본문 글꼴 ─────────────────────────────────────────────────
   Paperlogy 한 벌만 두고 굵기는 브라우저가 합성한다. (font-weight: 400 700)
   파일은 /assets/Paperlogy-Regular.woff2 · 외부에서 받아오지 않는다.
   font-display: swap — 글꼴이 늦게 와도 글자가 먼저 보인다. */
@font-face {
  font-family: 'Paperlogy';
  src: url('/assets/Paperlogy-Regular.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F4F6F9;
  --surface: #ffffff;
  --surface-2: #F8F9FC;
  --border: #E4E7EE;
  --text: #171A21;
  --muted: #6A7180;
  --muted-2: #99A0AD;
  --primary: #2F6BE0;
  --primary-dark: #2557BC;
  --primary-soft: #EAF1FE;
  --on-primary: #ffffff;
  --sidebar: #141821;
  --sidebar-2: #1D2331;
  --sidebar-text: #C6CCD8;
  --sidebar-muted: #7B8395;
  --green: #12A15D;
  --green-soft: #E6F6EE;
  --amber: #D98216;
  --amber-soft: #FDF3E3;
  --red: #DC3A45;
  --red-soft: #FDECED;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 22px -14px rgba(20, 24, 33, .45);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* ── 뼈대 ─────────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 20px 16px 16px; border-bottom: 1px solid var(--sidebar-2); }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.brand-sub { color: var(--sidebar-muted); font-size: 10.5px; margin-top: 2px; }

.nav { flex: 1; padding: 10px 8px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item svg { flex: 0 0 17px; opacity: .8; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.is-active { background: var(--primary); color: #fff; }
.nav-item.is-active svg { opacity: 1; }

.nav-foot { padding: 10px 8px 14px; border-top: 1px solid var(--sidebar-2); }
.who { padding: 6px 11px 10px; font-size: 11.5px; color: var(--sidebar-text); display: flex; align-items: center; gap: 6px; }
.who strong { color: #fff; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17.5px; font-weight: 700; letter-spacing: -.3px; }
.topbar-title p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 16px; cursor: pointer; color: var(--text);
}

.content { padding: 22px 26px 60px; flex: 1; }

/* ── 카드 ─────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-2);
}
.card-title { font-size: 13.5px; font-weight: 700; flex: 1; min-width: 0; }
.card-title small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 1px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ── 통계 타일 ────────────────────────────────────────────────── */

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; }

/* ── 표 ───────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  position: sticky; top: 0;
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ── 버튼 ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: var(--surface); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── 폼 ───────────────────────────────────────────────────────── */

.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-group > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.form-group .hint { font-size: 11px; color: var(--muted-2); margin-top: 4px; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=search], input[type=email], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.check-list { display: flex; flex-wrap: wrap; gap: 10px 18px; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 130px; }

/* ── 배지 · 알림 ──────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-admin { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge-member { background: var(--sidebar-2); color: var(--sidebar-text); border-color: transparent; }
.badge-ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge-warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge-bad { background: var(--red-soft); color: var(--red); border-color: transparent; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 12.5px; border: 1px solid transparent; }
.alert-ok { background: var(--green-soft); color: #0B6B3E; border-color: #BFE6D2; }
.alert-error { background: var(--red-soft); color: #9B252E; border-color: #F5C7CB; }
.alert-warn { background: var(--amber-soft); color: #8A5310; border-color: #F0DDBB; }
.alert-info { background: var(--primary-soft); color: #1E4CA1; border-color: #C9DCFB; }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: inherit; font-variant-numeric: tabular-nums; }

/* ── 로그인 · 설치 화면 ───────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1E2432 0%, #2F3B57 100%);
}
.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  padding: 34px 30px;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .6);
}
.auth-box h1 { font-size: 19.5px; text-align: center; margin-bottom: 4px; }
.auth-box .lead { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.auth-box .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

/* ── 시험지 인쇄 ──────────────────────────────────────────────── */

.paper-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.paper-toolbar label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.paper-toolbar select, .paper-toolbar input { width: auto; min-width: 80px; }

/* 시험지 한 장은 내용이 적어도 A4 한 페이지를 채운다.
   (* { box-sizing: border-box } 라 여백이 높이에 포함된다) */
.paper-sheet {
  background: #fff;
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 20px auto;
  padding: 18mm 15mm;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.paper-head { border-bottom: 2px solid #222; padding-bottom: 10px; margin-bottom: 14px; flex: 0 0 auto; }
.paper-head h2 { font-size: 1.5em; text-align: center; }
/* 제목과 학원명 줄 사이 여백 (전 8px → 16px) */
.paper-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .85em; color: #444; margin-top: 16px; flex-wrap: wrap; }
.paper-name { border-bottom: 1px solid #999; display: inline-block; min-width: 90px; }
/* 범위는 학원명 바로 아래 줄에 */
.paper-scope { display: block; margin-top: 2px; }

.paper-head h2 .paper-tag { color: #C0392B; font-size: .75em; margin-left: .3em; }

/* 단 사이 — 2단 이상이면 가운데 구분선을 반드시 넣는다.
   column-fill: auto 는 «왼쪽 단을 끝까지 채운 뒤 오른쪽» 으로 넘긴다.
   (기본값 balance 는 3문항을 2·1 로 나눠 담는다)
   높이가 정해져 있어야 동작하므로 flex 로 남은 높이를 받는다. */
.paper-items {
  column-gap: 10mm;
  --q-gap: 1.4em;
  column-fill: auto;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

/* column-rule 은 «내용이 있는 단 사이» 에만 그려진다.
   3문항이 왼쪽만 채우면 선이 사라지므로 직접 긋는다.
   배경이 아니라 테두리라서 «배경 그래픽 없이 인쇄» 해도 나온다. */
.paper-items.has-rule::before,
.paper-items.has-rule::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #999;
  pointer-events: none;
}
.paper-items.has-rule::after { display: none; }

.paper-items.cols-2.has-rule::before { left: 50%; }
.paper-items.cols-3.has-rule::before { left: 33.333%; }
.paper-items.cols-3.has-rule::after  { left: 66.666%; display: block; }

.paper-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: var(--q-gap) 0;          /* 좁게 · 기본 · 넓게 */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.paper-item .no { color: #666; min-width: 2.2em; text-align: right; }
.paper-item .q { font-weight: 600; }
.paper-item .blank { flex: 1; border-bottom: 1px dotted #999; min-height: 1.2em; }
/* «줄 없음» — 적을 자리는 두되 선은 그리지 않는다 */
.paper-item .blank.no-line { border-bottom: 0; }
.paper-item .ans { color: #C0392B; }

/* 학생용 — 시험지와 정답지 사이를 새 장으로 넘긴다 */
.page-break { break-after: page; page-break-after: always; height: 0; }

/* ── 통계 타일 줄 세우기 ──────────────────────────────────────── */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px;
}

/* ── 위지윅으로 쓴 글 (전달사항) ──────────────────────────────── */

.rich { line-height: 1.9; overflow-wrap: anywhere; }
.rich > *:first-child { margin-top: 0; }
.rich > *:last-child { margin-bottom: 0; }
.rich p { margin: 0 0 .8em; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5, .rich h6 { margin: 1.2em 0 .5em; line-height: 1.4; }
.rich h1 { font-size: 1.55em; }
.rich h2 { font-size: 1.35em; }
.rich h3 { font-size: 1.18em; }
.rich h4, .rich h5, .rich h6 { font-size: 1.05em; }
.rich ul, .rich ol { margin: 0 0 .8em; padding-left: 1.5em; }
.rich li { margin: .2em 0; }
.rich a { color: var(--primary); text-decoration: underline; }
.rich img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rich hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.rich blockquote {
  margin: 0 0 .8em; padding: 8px 14px;
  border-left: 3px solid var(--border); color: var(--muted); background: var(--surface-2);
}
.rich pre, .rich code { background: var(--surface-2); border-radius: 6px; }
.rich pre { padding: 12px 14px; overflow-x: auto; }
.rich code { padding: 1px 5px; }
.rich table { border-collapse: collapse; margin: 0 0 .8em; max-width: 100%; }
.rich th, .rich td { border: 1px solid var(--border); padding: 6px 10px; }
.rich th { background: var(--surface-2); font-weight: 600; }

/* 편집기가 화면 밖으로 나가지 않게 */
.note-editor.note-frame { margin-bottom: 0; border-radius: var(--radius-sm); }
.note-editor .note-editable { font-family: inherit; font-size: 13px; line-height: 1.9; }
.note-modal .note-form-control { font-family: inherit; }

/* ── 출석체크 화면 (/checkin) ─────────────────────────────────── */

.checkin-body { background: var(--sidebar); min-height: 100vh; }
.checkin {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  color: #fff;
}
.checkin-head { text-align: center; margin-bottom: 22px; }
.checkin-head h1 { font-size: 22px; font-weight: 700; }
.checkin-head p { color: var(--sidebar-muted); font-size: 13px; margin-top: 4px; }

.checkin-guide { display: block; text-align: center; color: var(--sidebar-text); font-size: 15px; margin-bottom: 14px; }

.checkin-input {
  width: 100%;
  text-align: center;
  font-size: 40px;
  letter-spacing: .4em;
  padding: 14px 0;
  border-radius: var(--radius);
  border: 1px solid var(--sidebar-2);
  background: var(--sidebar-2);
  color: #fff;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  border: 1px solid var(--sidebar-2);
  background: var(--sidebar-2);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 0;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.key:active { background: var(--primary); border-color: var(--primary); }
.key-sub { font-size: 16px; color: var(--sidebar-text); }

.checkin-submit { width: 100%; justify-content: center; padding: 15px; margin-top: 16px; font-size: 16px; }

.checkin-people { display: flex; flex-direction: column; gap: 10px; }
.checkin-person {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--sidebar-2); background: var(--sidebar-2); color: #fff;
  border-radius: var(--radius); padding: 16px 18px; cursor: pointer; font-family: inherit;
}
.checkin-person:active { border-color: var(--primary); }
.checkin-person-name { display: block; font-size: 20px; font-weight: 700; }
.checkin-person-sub { display: block; font-size: 12.5px; color: var(--sidebar-muted); margin-top: 2px; }
.checkin-person-state { display: block; font-size: 13px; color: var(--sidebar-text); margin-top: 8px; }

.checkin-result {
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  border: 1px solid var(--sidebar-2);
  background: var(--sidebar-2);
}
.checkin-result.is-present { border-color: var(--green); }
.checkin-result.is-absent { border-color: var(--amber); }
.checkin-name { font-size: 30px; font-weight: 700; }
.checkin-status { font-size: 17px; margin-top: 8px; }
.checkin-result.is-present .checkin-status { color: #6EE7B7; }
.checkin-result.is-absent .checkin-status { color: #FCD9A0; }
.checkin-note { font-size: 12.5px; color: var(--sidebar-muted); margin-top: 10px; }

.checkin-error {
  background: rgba(220, 58, 69, .16); border: 1px solid var(--red);
  color: #FFC9CE; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px; text-align: center;
}
.checkin-again { margin-top: 18px; text-align: center; }
.checkin-again .btn { min-width: 160px; justify-content: center; }

/* 잠긴 줄 (출석하지 않아 점수를 넣을 수 없는 학생) */
.row-off { background: var(--surface-2); }
.row-off input { opacity: .55; }

/* ── 레이어 팝업 ───────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-dim { position: absolute; inset: 0; background: rgba(16, 20, 28, .5); }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(16, 20, 28, .55);
  overflow: hidden;
}
.modal-box form { display: flex; flex-direction: column; min-height: 0; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 14px; }
.modal-x {
  border: 0; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px;
}
.modal-x:hover { color: var(--text); }

.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
}

.perm-list { display: flex; flex-direction: column; gap: 2px; }
.perm-row {
  padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid transparent;
  align-items: center;
}
.perm-row:hover { background: var(--surface-2); border-color: var(--border); }
.perm-row .mono { margin-left: 6px; }

/* 치환자 매핑 표 (알림톡 템플릿) */
.varmap-row { display: grid; grid-template-columns: minmax(90px, 1fr) 1.1fr 1.2fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.varmap-row .varmap-name { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.varmap-row select, .varmap-row input { width: 100%; }
.varmap-empty { color: var(--muted); font-size: 12.5px; padding: 10px 0; }

@media print {
  .paper-toolbar, .no-print { display: none !important; }
  body { background: #fff; }
  /* @page 여백이 14mm 라 실제로 쓸 수 있는 높이는 297 - 28 = 269mm.
     반올림 때문에 빈 장이 하나 더 나오지 않도록 조금 줄여 잡는다. */
  .paper-sheet {
    box-shadow: none; margin: 0; padding: 0;
    width: auto; max-width: none;
    min-height: 265mm;
  }
  .table thead th { position: static; }
  /* 화면에서는 흐린 회색이 보기 좋지만 인쇄에서는 진해야 한다 */
  .paper-items.has-rule::before,
  .paper-items.has-rule::after { border-left-color: #666; }
  @page { margin: 14mm; }
}

/* ── 반응형 ───────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -216px;
    z-index: 60;
    transition: left .2s;
  }
  .sidebar.is-open { left: 0; box-shadow: 0 0 0 100vw rgba(0, 0, 0, .4); }
  .menu-toggle { display: block; flex: 0 0 auto; }
  .content { padding: 16px 14px 50px; }

  /* 좁은 화면에서는 제목과 버튼이 한 줄을 다투다 «2026학년도 기 준» 처럼 끊긴다.
     버튼을 통째로 아랫줄로 내려 제목이 한 줄을 다 쓰게 한다. */
  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }
  .topbar-title { flex: 1 1 auto; }
  .topbar-title h1 { font-size: 15.5px; }
  .topbar-actions {
    order: 3;
    width: 100%;
    gap: 6px;
  }
  .topbar-actions .btn { padding: 7px 11px; }
}

@media (max-width: 420px) {
  .topbar-actions .btn { padding: 6px 9px; font-size: 11px; }
  .topbar-actions .btn svg { width: 14px; height: 14px; }
}
