/* AYG掲示板 管理画面（デザインテンプレートA：カード型ライトを土台に、余白を詰めた構成） */
:root {
  --primary: #7b1a2e;
  --primary-dark: #5a0f1f;
  --primary-light: #a83250;
  --primary-soft: #fbeef1;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, .15), 0 4px 8px rgba(0, 0, 0, .06);
  --radius: 12px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  word-break: auto-phrase; /* 日本語を文節の切れ目で改行する（単語の途中で折り返さない） */
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- ログイン ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: linear-gradient(160deg, #3d0b17 0%, #7b1a2e 45%, #5a0f1f 100%);
}
.login-card {
  width: 100%; max-width: 380px;
  padding: 32px 28px 28px;
  background: #fff;
  border-radius: 18px;
  border-top: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 30px;
}
.login-title { text-align: center; font-size: 24px; font-weight: 900; letter-spacing: .12em; color: var(--primary-dark); }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; min-height: 44px; margin-top: 6px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }
.login-note { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- ヘッダー ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.hdr-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.hdr-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.hdr-title { font-size: 17px; font-weight: 900; letter-spacing: .1em; }
.tabs { display: flex; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px;
  border: none; background: none; color: rgba(255, 255, 255, .78);
  font-weight: 700; white-space: nowrap; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tab.active { color: #fff; border-bottom-color: #fff; background: rgba(255, 255, 255, .12); }
.hdr-user { margin-left: auto; position: relative; }
.hdr-em { margin-left: auto; min-height: 32px; background: #fff; border-color: #fff; }
.hdr-em + .hdr-user { margin-left: 0; }
.hdr-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff;
  white-space: nowrap; cursor: pointer;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 190px; padding: 6px;
  background: #fff; color: var(--text);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  z-index: 30;
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: none; text-align: left; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.menu button:hover { background: var(--bg); }
.menu .menu-role { padding: 6px 12px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* 緊急表示中の帯（どのタブでも上に出す） */
.em-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: #b91c1c; color: #fff;
  font-weight: 700;
  animation: banner-pulse 2s ease-in-out infinite;
}
.em-banner i.fa-triangle-exclamation { font-size: 18px; }
.em-banner .em-banner-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-banner .btn { margin-left: auto; background: #fff; color: #b91c1c; border-color: #fff; }
.em-banner-sub { font-weight: 400; opacity: .95; }
.em-banner-off { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .28); font-size: 12px; }
.warn-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: #fef3c7; color: #92400e;
  border-bottom: 1px solid #fde68a;
  font-weight: 700;
}
.warn-banner .wb-list { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-banner .wb-hint { font-weight: 400; }
.warn-banner .btn { margin-left: auto; text-decoration: none; }
@keyframes banner-pulse { 0%, 100% { background: #b91c1c; } 50% { background: #991b1b; } }

/* ---------- 共通部品 ---------- */
.page { max-width: 1680px; margin: 0 auto; padding: 14px 16px 40px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 14px 16px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1 1 auto; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; margin: 0 0 8px; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { background: #f8fafc; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-emergency { background: #fff; border: 2px solid var(--danger); color: var(--danger); }
.btn-emergency:hover { background: #fef2f2; }
.btn-sm { min-height: 28px; padding: 0 9px; font-size: 12px; gap: 5px; }
.btn-icon { min-height: 28px; width: 30px; padding: 0; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.chip .n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.active .n { background: rgba(255, 255, 255, .25); color: #fff; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .count { font-size: 11px; color: var(--muted); text-align: right; }
.search { width: 200px; }

/* 表（文字は折り返さず、はみ出したら横スクロール） */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; vertical-align: middle; }
.tbl th { position: sticky; top: 0; background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 800; z-index: 1; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl tr.clickable { cursor: pointer; }
.tbl .t-title { display: block; max-width: 460px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.tbl .t-title-wrap { display: flex; align-items: center; gap: 6px; max-width: 440px; }
.tbl .t-title-wrap .t-title { min-width: 0; }
.tbl .t-target { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tbl .t-period { display: flex; align-items: center; gap: 6px; }
.tbl th.act-col, .tbl td.act-col { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 8px -8px rgba(15, 23, 42, .25); }
.tbl th.act-col { background: #f8fafc; z-index: 2; }
.tbl tbody tr:hover td.act-col { background: #fafbfc; }
.days { padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.days.long { background: #fef3c7; color: #92400e; }
.btn-em-stop { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-em-stop:hover { background: #991b1b; }
.link-btn { border: none; background: none; padding: 0; color: var(--info); font-weight: 800; text-decoration: underline; cursor: pointer; }
.cycle.long { color: var(--warning); font-weight: 800; }
.warn-card { margin-bottom: 10px; background: #fffbeb; color: #92400e; font-weight: 700; }
.tbl .t-actions { display: flex; gap: 4px; justify-content: flex-end; }
.tbl td.c, .tbl th.c { text-align: center; }
.thumb-sm { width: 64px; height: 40px; border-radius: 6px; object-fit: cover; display: block; background: var(--bg); }
.thumb-ph { width: 64px; height: 40px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty i { font-size: 32px; color: #cbd5e1; display: block; margin-bottom: 8px; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill-cat { color: #fff; }
.pill-imp { background: #dc2626; color: #fff; }
.pill-new { background: #fde68a; color: #78350f; }
.pill-em { background: #b91c1c; color: #fff; }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; white-space: nowrap; }
.st::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.st-active { color: var(--success); }
.st-scheduled { color: var(--info); }
.st-stopped { color: #94a3b8; }
.st-ended { color: #94a3b8; }
.st-ended::before { background: transparent; border: 2px solid currentColor; width: 7px; height: 7px; }
.st-cleared { color: #94a3b8; }
.st-cleared::before { background: transparent; border: 2px solid currentColor; width: 7px; height: 7px; }

/* ---------- モーダル ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px;
  background: rgba(15, 23, 42, .5);
  overflow-y: auto;
}
.modal { width: 100%; max-width: 520px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 1320px; display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal.xl .modal-bd { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 800; }
.modal-hd .x { margin-left: auto; }
.modal-hd.em-hd { background: #b91c1c; color: #fff; border-bottom: none; }
.modal-bd { padding: 14px 16px; }
.modal-ft { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: #f8fafc; }
.modal-ft .spacer { flex: 1 1 auto; }

/* ---------- 掲示物の編集 ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.ed-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: inline-flex; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #f8fafc; }
.seg button { flex: 1 1 auto; padding: 6px 12px; border: none; background: none; font-weight: 700; white-space: nowrap; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: #fff; }
.seg-prio button.on.seg-normal { background: #475569; }
.seg button.on.seg-imp { background: #dc2626; }
.seg button.on.seg-em { background: repeating-linear-gradient(-45deg, #b91c1c 0 10px, #7f1d1d 10px 20px); }
.seg.full { display: flex; }

.drop {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px;
  border: 2px dashed #cbd5e1; border-radius: var(--radius-sm);
  background: #f8fafc; color: var(--muted);
  font-weight: 700; cursor: pointer; text-align: center;
}
.drop:hover, .drop.over { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 104px; height: 68px; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); cursor: grab; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb .no { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(15, 23, 42, .7); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.thumb .del { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(220, 38, 38, .92); color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.thumb.loading { display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: default; font-size: 12px; gap: 6px; }
.thumb.sortable-ghost { opacity: .35; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: #f8fafc; }
.radio-card.on { border-color: var(--primary); background: var(--primary-soft); }
.radio-card i { font-size: 20px; color: var(--primary); width: 24px; text-align: center; }
.radio-card b { display: block; white-space: nowrap; }
.radio-card span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }

.period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period .input { width: auto; flex: 1 1 180px; }
.quick-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.quick-label { flex: 0 0 auto; width: 28px; font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.quick button { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.quick button:hover { border-color: var(--primary); color: var(--primary); }
.quick button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.warn { color: var(--warning); font-size: 12px; font-weight: 700; }
.warn.info { color: var(--info); }
.warn:empty { display: none; }

.screen-picks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.screen-pick { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 2px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 700; white-space: nowrap; background: #fff; }
.screen-pick.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* 右の列（見え方と、いつ・どこに出すか）は、左を下まで書いても見える位置に留める */
.ed-side { position: sticky; top: 0; align-self: start; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ed-side .section-title { margin: 0; }
.ed-when { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f8fafc; }
.pv-box { position: relative; width: 100%; max-width: 100%; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #0f1218; padding: 10px; }
.pv-note { font-size: 12px; color: var(--muted); }
.pv-note:empty { display: none; }
.pv-note.long { color: var(--warning); font-weight: 700; }
.pv-scale { position: relative; transform-origin: 0 0; }
.pv-slide { position: absolute; left: 0; top: 0; width: 1296px; height: 872px; }
.pv-em { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.pv-pager { display: flex; align-items: center; justify-content: center; gap: 10px; }
.logs { font-size: 12px; color: var(--muted); }
.logs summary { cursor: pointer; font-weight: 700; white-space: nowrap; }
.logs .log-line { white-space: nowrap; padding-left: 14px; }
.logs .log-item { padding-left: 14px; }
.logs .log-item summary { font-weight: 400; }
.log-detail { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); color: var(--text); }
.log-body { margin: 4px 0; max-height: 160px; overflow: auto; line-height: 1.6; }
.ed-active { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.choice span { font-size: 12px; color: var(--muted); }

/* 緊急発信 */
.tpl { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl button { padding: 5px 14px; border-radius: 999px; border: 2px solid #fecaca; background: #fef2f2; color: #b91c1c; font-weight: 800; cursor: pointer; white-space: nowrap; }
.tpl button:hover { background: #fee2e2; }
.em-note { padding: 10px 12px; border-radius: var(--radius-sm); background: #fef2f2; color: #991b1b; font-size: 13px; font-weight: 700; }
.em-status { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-size: 12px; font-weight: 700; }
.em-status-note { flex-basis: 100%; color: var(--warning); }
.em-drill { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }

/* ---------- モニター ---------- */
.guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.guide-step { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: #f8fafc; border: 1px solid var(--border); font-size: 13px; }
.guide-step .n { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.guide-step code { background: #e2e8f0; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.guide-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.guide-notes i { width: 18px; color: var(--warning); }
.online { color: var(--success); }
.offline { color: var(--warning); }
.never { color: #94a3b8; }
.url-cell { display: flex; align-items: center; gap: 6px; }
.url-cell code { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; background: #f1f5f9; padding: 2px 8px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.drag-handle { cursor: grab; color: #94a3b8; padding: 0 4px; }
.map-pick { position: relative; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; cursor: crosshair; }
.map-pick .cl-map { border: none; border-radius: 0; }

/* ---------- 区分 ---------- */
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: #0f172a; }
.icons { display: grid; grid-template-columns: repeat(8, 40px); gap: 6px; }
.icon-pick { width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--border); background: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.icon-pick.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* ---------- 権限（列ごとに色を分けたトグル） ---------- */
.perm-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 92px; height: 28px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1; background: #fff; color: #94a3b8;
  font-weight: 800; font-size: 12px; white-space: nowrap; cursor: pointer;
}
.perm-toggle.on { color: #fff; border-color: transparent; }
.perm-toggle.on.k-admin { background: var(--primary); }
.perm-toggle.on.k-poster { background: var(--info); }
.perm-toggle.on.k-emergency { background: #ea580c; }
.perm-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.perm-legend b { color: var(--text); }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 10px;
  background: #0f172a; color: #fff; font-weight: 700;
  box-shadow: var(--shadow-lg);
  width: max-content;
}
.toast.error { background: var(--danger); }

/* 1366幅などのノートPCでも、掲示物一覧が横にはみ出さないように */
@media (max-width: 1420px) {
  .tbl .t-title-wrap { max-width: 360px; }
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 900px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .ed-side { position: static; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .hdr-title { display: none; }
  .search { width: 100%; }
}
@media (max-width: 560px) {
  .ed-row, .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .hdr-user-btn .uname { display: none; }
}
