/*
  西浦田楽 撮影管理システム（管理者画面）
  - dashboard 側のトーンと統一感を持たせつつ、タブレット向けサイズを維持する
  - 想定端末：タブレット（縦長 / 2160×1620 目安）
  - 目的：誤操作防止（大型UI / 明確な階層 / 低彩度ダークトーン）
*/

/* ============
   Design tokens
   ============ */
:root {
  --bg-0: #0e0f10;
  --bg-1: #101214;
  --bg-2: #141516;
  --bg-3: #24272b;
  --bg-4: #2d3136;
  --bg-5: #121315;

  --text: #eaeaea;
  --text-soft: #d9d9d9;
  --text-strong: #f5f5f5;
  --muted: #babec4;
  --muted-2: #a1a6ad;
  --muted-3: #8f949c;

  --line: #454b54;
  --line-strong: #4a505a;
  --line-contrast: #606875;
  --line-light: #6f757d;

  --accent: #ff6b6b;
  --accent-strong: #ff4d4d;
  --accent-soft: #ffd6d6;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;

  --shadow: 0 0 12px rgba(0, 0, 0, 0.55);

  /* Tablet scale */
  --fs-base: 16px;
  --fs-sm: 14px;
  --fs-xs: 12px;
  --fs-h: 22px;
  --fs-title: 26px;

  --pad-1: 12px;
  --pad-2: 16px;
  --pad-3: 20px;
  --gap-1: 12px;
  --gap-2: 12px;
  --gap-3: 20px;

  --btn-h: 68px;
}

/* ============
   Base
   ============ */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.admin {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "YuGothic", "Meiryo", system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

body.admin :where(h1, h2, h3, p) {
  margin: 0;
}

body.admin :where(button, input) {
  font-family: inherit;
}

body.admin ::selection {
  background: rgba(255, 107, 107, 0.24);
}

/* ============
   Layout
   ============ */
/*
  2160×1620 縦長を前提にしつつ、ブラウザUIの変動に耐えるため dvh を採用。
  "アプリ枠"の雰囲気は維持しつつ、幅はタブレット向けに拡張。
*/
body.admin .app-wrapper {
  min-height: 100dvh;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 var(--pad-3) var(--pad-3);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

body.admin .app-header {
  margin: 0;
  padding: 14px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--bg-1);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

body.admin main.content {
  padding-top: var(--pad-3);
}

body.admin .footer-space {
  height: 20px;
}

/* ============
   Headnav (dashboard-like)
   ============ */
body.admin .headnav {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

body.admin .headnav-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
}

body.admin .status-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-sizing: border-box;
  background: var(--bg-3);
  border: 2px solid var(--line-contrast);
  border-bottom: 0;
  font-size: 30px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.3px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

body.admin .status-label {
  font-size: 21px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--text-strong);
  letter-spacing: 0.6px;
  line-height: 1.2;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
  animation: live-pulse 1.6s ease-in-out infinite;
}

body.admin .status-label-text {
  display: inline-block;
  transform: translateY(-5%);
}

body.admin .status-title-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

body.admin .status-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
  transform: translateY(-3%);
  display: inline-block;
  white-space: nowrap;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

body.admin .status-title.is-marquee {
  animation: status-marquee var(--marquee-duration, 10s) linear infinite;
}

@keyframes status-marquee {
  0% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(0);
  }
  85% {
    transform: translateX(calc(-1 * var(--marquee-distance, 0px)));
  }
  100% {
    transform: translateX(calc(-1 * var(--marquee-distance, 0px)));
  }
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 77, 77, 0), 0 0 10px rgba(255, 77, 77, 0.18);
    filter: saturate(1);
  }
  45% {
    box-shadow: 0 0 0 rgba(255, 77, 77, 0), 0 0 14px rgba(255, 77, 77, 0.32);
    filter: saturate(1.08);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 77, 77, 0), 0 0 10px rgba(255, 77, 77, 0.18);
    filter: saturate(1);
  }
}
body.admin .headnav-sub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  padding: 3px 10px 5px;
  background: var(--bg-3);
  border-left: 2px solid var(--line-contrast);
  border-right: 2px solid var(--line-contrast);
  border-bottom: 0;
  border-top: 2px solid var(--line-contrast);
  border-radius: 0;
  box-shadow: none;
}

body.admin .headnav-sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1px;
  min-width: 0;
  padding: 1px 8px;
}

body.admin .headnav-sub-item + .headnav-sub-item {
  border-left: 1px solid var(--line);
}

body.admin .headnav-sub-label {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted-3);
  white-space: nowrap;
  line-height: 1.1;
}

body.admin .headnav-sub-value {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  white-space: nowrap;
  min-width: 0;
  line-height: 1.15;
}

body.admin .headnav-sub-center .headnav-sub-value {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-strong);
  line-height: 1.15;
}

body.admin .op-notice {
  padding: 6px 10px 8px;
  background: var(--bg-3);
  border-left: 2px solid var(--line-contrast);
  border-right: 2px solid var(--line-contrast);
  border-bottom: 2px solid var(--line-contrast);
  border-top: 2px solid var(--line-contrast);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: none;
}

body.admin .op-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

body.admin .op-notice-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-3);
}

body.admin .op-notice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.admin .op-notice .notice-body {
  max-height: none;
  overflow: visible;
  padding: 4px 8px;
  line-height: 1.45;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  border-left: 4px solid transparent;
  box-shadow: inset 0 0 0 0 transparent;
  background: var(--bg-4);
  border-radius: var(--r-md);
  min-height: 22px;
}

body.admin .op-notice .notice-body p {
  margin: 0;
}

body.admin .op-notice-item.is-important {
  border-left-color: var(--accent-strong);
  box-shadow: inset 4px 0 0 var(--accent-strong);
}

body.admin .op-notice-item.is-normal {
  border-left-color: var(--line-light);
  box-shadow: inset 4px 0 0 var(--line-light);
}

/* ============
   Section headings
   ============ */
body.admin .piece-block {
  display: grid;
  gap: var(--gap-2);
}

body.admin .piece-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding: 6px 0 8px;
  border-bottom: 2px solid var(--line-strong);
}

body.admin .piece-title > span {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

/* ============
   Card / Box
   ============ */
body.admin .box {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

body.admin .box-title {
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--text-strong);
  background: var(--bg-4);
  border-bottom: 1px solid var(--line);
}

body.admin .scroll-area {
  padding: 14px;
}

body.admin .admin-empty {
  font-size: var(--fs-base);
  line-height: 1.8;
  color: var(--text-soft);
}

body.admin .admin-placeholder {
  padding: 0;
}

/* ============
   Dashboard iframe preview
   ============ */
body.admin .user-preview-area {
  padding: 14px;
}

body.admin .dashboard-preview {
  display: grid;
  /*
    左：op選択（縦ボタン列）
    右：dashboardプレビュー（固定幅に寄せて“間の余白”を作らない）
    - 2列目を max 470px に固定し、phone-frame を 100% で埋める
    - これにより、2列目が 1fr で広がって phone-frame が右寄せになり、
      中間に“空白”ができる問題を回避する
  */
  grid-template-columns: 150px minmax(0, 450px);
  gap: 0;
  align-items: stretch;
  justify-content: start;
}

body.admin .op-selector {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
}

body.admin .op-selector-title {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

body.admin .op-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex: 1;
  align-content: start;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 0;
}

body.admin .op-select-btn {
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-4);
  color: var(--text);
  font-size: 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease;
}

body.admin .op-select-btn:hover {
  background: var(--bg-3);
  border-color: var(--line-light);
}

body.admin .op-select-btn.is-active {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--text-strong);
}

body.admin .phone-frame {
  /* 2列目(最大470px)を余白なく埋める */
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  display: flex;
  justify-self: stretch;
}

body.admin .phone-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--bg-0);
}

/* ============
   Announce panel (UI demo)
   ============ */
body.admin .announce-panel {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: grid;
  gap: var(--gap-2);
}

body.admin .announce-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-2);
}

body.admin .announce-label {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.02em;
}

body.admin .announce-current {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--bg-5);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

body.admin .announce-current--selected {
  border-color: rgba(255, 107, 107, 0.6);
  background: rgba(255, 107, 107, 0.12);
}

body.admin .announce-title {
  margin-top: 6px;
  display: inline-block;
  padding: 6px 10px;
  background: var(--bg-0);
  color: var(--text-strong);
  border: 1px solid var(--line-contrast);
  border-radius: 12px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  text-align: left;
}

body.admin .announce-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin .tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-4);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.admin .tag--muted {
  opacity: 0.8;
}

body.admin .announce-kana {
  margin-top: 8px;
  font-size: 18px;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

body.admin .announce-id {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.admin .announce-time {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.admin .announce-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2);
}

body.admin .announce-preview-item {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-5);
  border: 1px solid var(--line);
}

body.admin .announce-preview-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.35;
  word-break: break-word;
}

body.admin .announce-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2);
}

body.admin .announce-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.6fr);
  gap: var(--gap-2);
  align-items: center;
}

body.admin .piece-override {
  display: grid;
  gap: 8px;
}

body.admin .override-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

body.admin .override-input {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-5);
  color: var(--text);
  font-size: 16px;
}

body.admin .override-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-5);
  color: var(--text);
  font-size: 14px;
  appearance: none;
}

body.admin .override-input::placeholder {
  color: var(--muted-2);
}

body.admin .mini-btn {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-4);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

body.admin .mini-btn:hover {
  background: var(--bg-3);
  border-color: var(--line-light);
}

body.admin .mini-btn.is-toggle {
  background: var(--bg-3);
}

body.admin .mini-btn.is-toggle.is-off {
  background: var(--bg-5);
  border-color: var(--line);
  color: var(--muted);
}

body.admin .override-indicator {
  font-size: 13px;
  color: var(--muted);
}

body.admin .override-indicator.is-override {
  color: var(--accent-soft);
  font-weight: 700;
}

body.admin .announce-commit {
  display: grid;
  gap: 6px;
}

body.admin .commit-note {
  font-size: 12px;
  color: var(--muted-2);
}

body.admin .line-share-area {
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-4);
  display: none;
  gap: 8px;
}

body.admin .line-share-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

body.admin .line-share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body.admin .line-share-text {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-5);
  color: var(--text);
  font-size: 12px;
  padding: 8px;
}

/* Buttons (large, mistake-resistant) */
body.admin .timecode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  width: 100%;
  border-radius: var(--r-lg);
  border: 2px solid var(--line-contrast);
  background: var(--bg-4);
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease;
}

body.admin .timecode-btn:hover {
  background: var(--bg-3);
  border-color: var(--line-light);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.admin .timecode-btn:active {
  transform: translateY(1px);
}

body.admin .timecode-btn:focus-visible {
  outline: 2px solid rgba(223, 227, 232, 0.42);
  outline-offset: 2px;
}

body.admin .timecode-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

body.admin .timecode-btn--primary {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--text-strong);
}

body.admin .timecode-btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

body.admin .timecode-btn--danger {
  background: rgba(255, 77, 77, 0.18);
  border-color: rgba(255, 77, 77, 0.78);
  color: var(--text-strong);
}

body.admin .timecode-btn--danger:hover {
  background: rgba(255, 77, 77, 0.28);
}

body.admin .timecode-btn--ghost {
  background: var(--bg-3);
}

body.admin .announce-meta {
  display: grid;
  gap: 6px;
  padding-top: 6px;
}

body.admin .announce-status {
  font-size: var(--fs-sm);
  color: var(--text-soft);
}

body.admin .announce-updated-at {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============
   Camera table
   ============ */
body.admin .status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

body.admin .status-table th,
body.admin .status-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  color: var(--text-soft);
}

body.admin .status-table thead th {
  background: var(--bg-5);
  font-weight: 700;
  color: var(--text);
}

body.admin .status-table-corner {
  width: 90px;
}

body.admin .status-table thead th.status-table-corner {
  background-image: linear-gradient(
    to bottom left,
    transparent 49%,
    var(--line) 50%,
    transparent 51%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.admin .status-table tbody th {
  background: var(--bg-4);
  font-weight: 600;
  color: var(--text-soft);
}

body.admin .status-table tbody td {
  height: 28px;
}

body.admin .status-table tbody td:nth-child(2) {
  background: rgba(255, 90, 90, 0.14);
}

body.admin .status-table tbody td:nth-child(3) {
  background: rgba(70, 140, 255, 0.14);
}

body.admin .status-table tbody td:nth-child(4) {
  background: rgba(60, 200, 170, 0.14);
}

body.admin .status-table thead th:nth-child(2) {
  background-color: rgba(255, 90, 90, 0.2);
}

body.admin .status-table thead th:nth-child(3) {
  background-color: rgba(70, 140, 255, 0.2);
}

body.admin .status-table thead th:nth-child(4) {
  background-color: rgba(60, 200, 170, 0.2);
}

body.admin .sd-id,
body.admin .batt-id {
  font-size: 12px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.admin .sd-need,
body.admin .batt-need {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ============
   Emergency panel
   ============ */
body.admin .emergency-panel {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 8px 10px;
  background: var(--bg-5);
}

body.admin .emergency-panel[open] {
  border-color: rgba(255, 107, 107, 0.6);
  background: rgba(255, 107, 107, 0.08);
}

body.admin .emergency-summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-soft);
}

body.admin .emergency-content {
  margin-top: 12px;
}

body.admin .emergency-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-2);
}

body.admin .form-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

body.admin .form-input,
body.admin .form-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-contrast);
  background: var(--bg-5);
  color: var(--text);
  font-size: 16px;
}

body.admin .form-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 14px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

body.admin .emergency-preview {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--bg-4);
}

body.admin .emergency-preview-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

body.admin .emergency-preview-body {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============
   PIN gate (lightweight safety, not security)
   ============ */
body.admin.admin-locked main,
body.admin.admin-locked .footer-space {
  display: none;
}

body.admin .pin-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 22px;
}

body.admin .pin-gate-box {
  width: min(620px, 100%);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.admin .pin-gate-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

body.admin .pin-gate-desc {
  font-size: var(--fs-base);
  line-height: 1.75;
  opacity: 0.92;
  color: var(--text-soft);
  margin: 0 0 14px;
}

body.admin .pin-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

body.admin .pin-input {
  flex: 1;
  min-width: 260px;
  height: 52px;
  padding: 0 14px;
  font-size: 26px;
  letter-spacing: 0.35em;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-contrast);
  background: var(--bg-5);
  color: var(--text);
  outline: none;
}

body.admin .pin-input::placeholder {
  letter-spacing: 0.12em;
  opacity: 0.7;
}

body.admin .pin-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

body.admin .pin-btn {
  height: 52px;
  padding: 0 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-contrast);
  background: var(--bg-4);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease;
}

body.admin .pin-btn:hover {
  background: var(--bg-3);
  border-color: var(--line-light);
}

body.admin .pin-btn:active {
  transform: translateY(1px);
}

body.admin .pin-btn:focus-visible {
  outline: 2px solid rgba(223, 227, 232, 0.42);
  outline-offset: 2px;
}

body.admin .pin-error {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--accent-soft);
  display: none;
}

/* Scrollbar styling (dashboard-like) */
body.admin .scroll-area::-webkit-scrollbar {
  width: 6px;
}

body.admin .scroll-area::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

body.admin .pin-gate-box.shake {
  animation: admin-shake 280ms linear;
}

@keyframes admin-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* ============
   Responsive guardrails
   ============ */
@media (max-width: 980px) {
  body.admin .app-wrapper {
    width: 100%;
    padding-left: var(--pad-2);
    padding-right: var(--pad-2);
  }

  body.admin .announce-title {
    font-size: 28px;
  }

  body.admin .dashboard-preview {
    grid-template-columns: 138px minmax(0, 1fr);
  }

  body.admin .phone-frame {
    width: 100%;
  }

  body.admin .announce-grid,
  body.admin .announce-control-grid,
  body.admin .emergency-grid {
    grid-template-columns: 1fr;
  }
}


@media (prefers-reduced-motion: reduce) {
  body.admin .timecode-btn,
  body.admin .pin-btn,
  body.admin .status-label,
  body.admin .status-title.is-marquee {
    transition: none;
    animation: none;
  }
}
