@charset "UTF-8";
/* ==========================================================
   八千代市医師会 会員専用ページ
   落ち着いたグリーン系／読みやすさ重視
   ========================================================== */

:root {
  --green-900: #163d2c;
  --green-800: #1f5139;
  --green-700: #2d6a4f;   /* メインカラー */
  --green-600: #3d7f60;
  --green-500: #52936f;
  --green-200: #cfe5d8;
  --green-100: #e5f1ea;
  --green-50:  #f2f8f4;

  --bg:        #f4f6f4;
  --surface:   #ffffff;
  --text:      #1e2a24;
  --text-sub:  #5b6862;
  --text-mute: #8a958f;
  --border:    #dde4df;
  --border-strong: #c6d0c9;

  --warn-bg:   #fdf4dc;
  --warn-text: #8a6100;
  --danger:    #b23a3a;
  --danger-bg: #fbeaea;
  --info-bg:   #e8f1f8;
  --info-text: #23517a;

  --radius:    8px;
  --radius-sm: 5px;
  --shadow:    0 1px 2px rgba(22, 61, 44, .06), 0 1px 6px rgba(22, 61, 44, .04);
  --header-h:  64px;
  --sidebar-w: 268px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  letter-spacing: .02em;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); text-decoration: underline; }
img { max-width: 100%; vertical-align: middle; }
code { font-family: Consolas, Menlo, monospace; font-size: .92em; background: var(--green-50); padding: 1px 6px; border-radius: 4px; }
mark { background: #fff0a8; color: inherit; padding: 0 1px; border-radius: 2px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }

/* ----------------------------------------------------------
   ヘッダー
   ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--green-800);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.site-header__inner {
  height: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; color: #fff; }
.brand:hover { color: #fff; text-decoration: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; }
.brand__sub { font-size: .75rem; opacity: .8; }

.header-search {
  flex: 1; max-width: 420px; margin-left: 12px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 0 14px;
}
.header-search:focus-within { background: #fff; color: var(--text); }
.header-search .icon { opacity: .8; }
.header-search input {
  flex: 1; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: .9rem; height: 38px; outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,.7); }
.header-search:focus-within input::placeholder { color: var(--text-mute); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.view-switch {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 4px 6px 4px 12px;
}
.view-switch__label { display: flex; align-items: center; gap: 6px; font-size: .82rem; white-space: nowrap; }
.view-switch select {
  font: inherit; font-size: .85rem;
  border: 0; border-radius: 6px;
  padding: 5px 28px 5px 10px; height: 32px;
  color: var(--green-900); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f5139' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  appearance: none; cursor: pointer; font-weight: 500;
}

.user-menu { position: relative; }
.user-menu__btn {
  display: flex; align-items: center; gap: 6px;
  font: inherit; font-size: .9rem; color: #fff;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  padding: 6px 10px; cursor: pointer;
}
.user-menu__btn:hover, .user-menu.is-open .user-menu__btn { background: rgba(255,255,255,.12); }
.user-menu__panel {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 220px;
  background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
}
.user-menu.is-open .user-menu__panel { display: block; }
.user-menu__info { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu__info strong { display: block; }
.user-menu__info span { font-size: .8rem; color: var(--text-sub); }
.user-menu__panel a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: .9rem;
}
.user-menu__panel a:hover { background: var(--green-50); text-decoration: none; }

.nav-toggle { display: none; }
.nav-backdrop { display: none; }

/* 表示確認モード */
.preview-bar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: var(--warn-bg);
  border-bottom: 1px solid #f0dca3;
  color: var(--warn-text);
  font-size: .9rem;
}
.preview-bar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 24px;
}
.preview-bar__inner .icon { vertical-align: -4px; }
.preview-bar__btn {
  font: inherit; font-size: .82rem; font-weight: 500;
  border: 1px solid #d9b860; background: #fff; color: var(--warn-text);
  border-radius: 999px; padding: 4px 14px; cursor: pointer;
}
.preview-bar__btn:hover { background: #fffaf0; }

/* ----------------------------------------------------------
   レイアウト
   ---------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.main { padding: 28px 36px 60px; max-width: 1180px; width: 100%; }

/* サイドバー */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 40px;
}
.sidebar nav { position: sticky; top: calc(var(--header-h) + 18px); max-height: calc(100vh - var(--header-h) - 36px); overflow-y: auto; }
.is-preview .sidebar nav { top: calc(var(--header-h) + 58px); max-height: calc(100vh - var(--header-h) - 76px); }

.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500;
}
.side-link:hover { background: var(--green-50); color: var(--green-800); text-decoration: none; }
.side-link.is-active { background: var(--green-100); color: var(--green-800); }
.side-link .icon { color: var(--green-600); }

.side-group { margin-top: 4px; }
.side-group__head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 500; color: var(--text); text-align: left;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 9px 12px; cursor: pointer;
}
.side-group__head:hover { background: var(--green-50); }
.side-group__head span { flex: 1; }
.side-group__head .icon { color: var(--green-600); }
.side-group__arrow { width: 14px; height: 14px; color: var(--text-mute) !important; transition: transform .2s; }
.side-group.is-open .side-group__arrow { transform: rotate(90deg); }
.side-group__list {
  display: none;
  list-style: none; margin: 2px 0 8px; padding: 0 0 0 22px;
  border-left: 2px solid var(--green-100); margin-left: 20px;
}
.side-group.is-open .side-group__list { display: block; }
.side-group__list a {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text-sub); line-height: 1.5;
}
.side-group__list a:hover { background: var(--green-50); color: var(--green-800); text-decoration: none; }
.side-group__list a.is-active { background: var(--green-100); color: var(--green-800); font-weight: 500; }
.side-group__list .count {
  flex-shrink: 0;
  font-size: .75rem; color: var(--text-mute);
  background: var(--bg); border-radius: 999px; padding: 0 8px; line-height: 1.7;
}

.side-admin { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.side-admin__title { margin: 0 0 6px 12px; font-size: .75rem; font-weight: 700; color: var(--text-mute); letter-spacing: .1em; }
.side-link--primary { background: var(--green-700); color: #fff; margin-bottom: 4px; }
.side-link--primary .icon { color: #fff; }
.side-link--primary:hover, .side-link--primary.is-active { background: var(--green-800); color: #fff; }

/* フッター */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center; font-size: .8rem; color: var(--text-mute);
  padding: 18px;
}
.site-footer p { margin: 0; }

/* ----------------------------------------------------------
   ページ共通
   ---------------------------------------------------------- */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--text-mute);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-sub); }

.page-head { margin-bottom: 22px; }
.page-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-eyebrow { margin: 0 0 2px; font-size: .82rem; color: var(--green-600); font-weight: 500; }
.page-title { margin: 0; font-size: 1.55rem; font-weight: 700; line-height: 1.45; color: var(--green-900); }
.page-lead { margin: 6px 0 0; color: var(--text-sub); font-size: .92rem; }
.page-count { margin: 0; color: var(--text-sub); font-size: .9rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.panel--narrow { max-width: 560px; }
.panel--muted { background: var(--green-50); box-shadow: none; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel__title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--green-900); }
.panel__title--sm { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel__title .icon { color: var(--green-600); }

.link-more { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; font-weight: 500; }
.link-more .icon { width: 15px; height: 15px; }

.empty { padding: 32px 0; text-align: center; color: var(--text-mute); }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .page-title { margin-bottom: 8px; }
.note { font-size: .88rem; color: var(--warn-text); background: var(--warn-bg); display: inline-block; padding: 8px 14px; border-radius: var(--radius-sm); }
.text-muted { color: var(--text-mute); font-size: .88rem; }
.nowrap { white-space: nowrap; }

/* アラート */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 18px;
  font-size: .92rem; border: 1px solid transparent;
}
.alert--success { background: var(--green-100); border-color: var(--green-200); color: var(--green-900); }
.alert--error   { background: var(--danger-bg); border-color: #f0caca; color: var(--danger); }
.alert--info    { background: var(--info-bg); border-color: #cddfee; color: var(--info-text); }

/* バッジ・タグ */
.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 500; line-height: 1.6;
  padding: 1px 9px; border-radius: 999px;
  background: var(--bg); color: var(--text-sub); white-space: nowrap;
}
.badge--ok     { background: var(--green-100); color: var(--green-800); }
.badge--warn   { background: var(--warn-bg); color: var(--warn-text); }
.badge--stop   { background: var(--danger-bg); color: var(--danger); }
.badge--target { background: #fff; border: 1px solid var(--border); color: var(--text-sub); }
.badge--class-office   { background: var(--green-700); color: #fff; }
.badge--class-officer  { background: var(--green-200); color: var(--green-900); }
.badge--class-director { background: var(--green-100); color: var(--green-800); }
.badge--class-member   { background: var(--bg); color: var(--text-sub); }

.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  font-size: .76rem; line-height: 1.6;
  padding: 1px 10px; border-radius: var(--radius-sm);
  background: var(--green-50); color: var(--green-800);
  border: 1px solid var(--green-100);
}
a.tag:hover { background: var(--green-100); text-decoration: none; }
.tag--sm { font-size: .72rem; padding: 0 7px; }

.article-no {
  font-family: Consolas, Menlo, monospace;
  font-size: .8rem; color: var(--text-sub);
  background: var(--bg); border-radius: 4px; padding: 1px 7px;
}
.article-no--pending { border: 1px dashed var(--border-strong); background: transparent; }

.chip-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-block;
  font-size: .86rem; padding: 5px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text);
}
.chip:hover { border-color: var(--green-500); color: var(--green-800); text-decoration: none; }
.chip--sm { font-size: .8rem; padding: 2px 12px; }

/* ----------------------------------------------------------
   トップ：カテゴリーカード
   ---------------------------------------------------------- */
.cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cat-card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--green-900);
}
.cat-card__head:hover { background: var(--green-50); text-decoration: none; color: var(--green-900); }
.cat-card__icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--green-100); color: var(--green-700);
}
.cat-card__icon .icon { width: 21px; height: 21px; }
.cat-card__name { flex: 1; font-weight: 700; font-size: 1.05rem; }
.cat-card__count { font-size: .8rem; color: var(--text-mute); }
.cat-card__list { list-style: none; margin: 0; padding: 8px 8px 10px; }
.cat-card__list a {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: var(--radius-sm);
  font-size: .87rem; color: var(--text-sub); line-height: 1.5;
}
.cat-card__list a:hover { background: var(--green-50); color: var(--green-800); text-decoration: none; }
.cat-card__list .icon { width: 13px; height: 13px; color: var(--green-500); }

/* ----------------------------------------------------------
   記事一覧
   ---------------------------------------------------------- */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-item { border-bottom: 1px solid var(--border); }
.article-item:last-child { border-bottom: 0; }
.article-item__link {
  display: block; padding: 14px 10px; margin: 0 -10px;
  border-radius: var(--radius-sm); color: var(--text);
}
.article-item__link:hover { background: var(--green-50); text-decoration: none; color: var(--text); }
.article-item__link:hover .article-item__title { color: var(--green-700); text-decoration: underline; }
.article-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--text-sub); }
.article-item__title { margin: 4px 0 6px; font-size: 1.03rem; font-weight: 500; line-height: 1.6; }
.article-item__excerpt { margin: 0; font-size: .86rem; color: var(--text-sub); }
.article-item__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: .8rem; color: var(--text-mute); }
.article-item__clip { display: inline-flex; align-items: center; gap: 2px; color: var(--green-700); font-weight: 500; }
.article-item__clip .icon { width: 15px; height: 15px; }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.pager a {
  min-width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem;
}
.pager a.is-current { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ----------------------------------------------------------
   記事詳細
   ---------------------------------------------------------- */
.article { padding: 30px 34px; }
.article__head { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.article__meta-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--text-sub); }
.article__title { margin: 10px 0 12px; font-size: 1.6rem; line-height: 1.5; color: var(--green-900); }
.article__info {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin: 16px 0 0; padding: 12px 16px;
  background: var(--bg); border-radius: var(--radius-sm);
  font-size: .86rem;
}
.article__info div { display: flex; gap: 8px; }
.article__info dt { color: var(--text-mute); }
.article__info dd { margin: 0; font-weight: 500; }
.article__actions { margin-top: 14px; }
.article__body { font-size: 1rem; line-height: 2; min-height: 60px; }

.attachments { margin-top: 30px; }
.attachments__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; margin: 0 0 10px; color: var(--green-900);
}
.attachments__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.attachment {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.attachment:last-child { border-bottom: 0; }
.attachment__name { flex: 1; font-weight: 500; word-break: break-all; }
.attachment__size { font-size: .8rem; color: var(--text-mute); white-space: nowrap; }
.attachment__btns { display: flex; gap: 6px; }

.file-badge {
  display: inline-grid; place-items: center;
  width: 38px; height: 26px; flex-shrink: 0;
  border-radius: 4px; font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: #7b8a83;
}
.file-badge--pdf   { background: #c2483f; }
.file-badge--word  { background: #2f62a8; }
.file-badge--excel { background: #227347; }
.file-badge--ppt   { background: #c9682b; }
.file-badge--img   { background: #7a5bb0; }

.back-link a { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; }

/* ----------------------------------------------------------
   検索
   ---------------------------------------------------------- */
.search-form .tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 18px; margin-bottom: -1px; cursor: pointer;
  font-weight: 500; color: var(--text-sub);
  border-bottom: 3px solid transparent;
}
.tab input { display: none; }
.tab.is-active { color: var(--green-800); border-bottom-color: var(--green-700); }
.search-form__row { display: flex; gap: 10px; }
.search-form__row .input { flex: 1; }
.search-form__hints { margin-top: 12px; font-size: .82rem; color: var(--text-mute); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.file-results { list-style: none; margin: 0; padding: 0; }
.file-result {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.file-result:last-child { border-bottom: 0; }
.file-result__body { flex: 1; min-width: 0; }
.file-result__name { font-weight: 500; font-size: 1rem; word-break: break-all; }
.file-result__meta { margin: 2px 0 0; font-size: .8rem; color: var(--text-mute); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.file-result__size { font-size: .8rem; color: var(--text-mute); white-space: nowrap; }

/* ----------------------------------------------------------
   フォーム
   ---------------------------------------------------------- */
.form-row { margin-bottom: 18px; }
.form-row--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.req {
  display: inline-block; margin-left: 8px;
  font-size: .7rem; font-weight: 500; color: #fff; background: var(--danger);
  padding: 0 6px; border-radius: 3px; vertical-align: 1px; line-height: 1.6;
}
.form-help { margin: 6px 0 0; font-size: .8rem; color: var(--text-mute); line-height: 1.6; }
.form-static { margin: 0; display: flex; align-items: center; gap: 10px; }
.form-static .form-help { margin: 0; }

.input {
  width: 100%;
  font: inherit; font-size: .95rem; color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(45,106,79,.15); }
.input--lg { font-size: 1.02rem; padding: 11px 14px; }
.input--sm { width: auto; font-size: .86rem; padding: 6px 10px; }
.textarea { resize: vertical; min-height: 220px; line-height: 1.8; }
select.input { cursor: pointer; }

.check { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; cursor: pointer; font-size: .92rem; line-height: 1.5; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--green-700); flex-shrink: 0; }
.check.is-disabled { color: var(--text-mute); cursor: default; }
.check--inline { display: inline-flex; align-items: center; }
.check--inline input { margin: 0; }
.check-list { display: flex; flex-direction: column; }

.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }
.form-actions--sticky {
  position: sticky; bottom: 0; z-index: 10;
  background: rgba(244,246,244,.94); backdrop-filter: blur(4px);
  border-top: 1px solid var(--border);
  margin: 0 -36px; padding: 14px 36px;
}

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .92rem; font-weight: 500; line-height: 1.4;
  padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-800); color: #fff; }
.btn--outline { background: #fff; border-color: var(--green-500); color: var(--green-700); }
.btn--outline:hover { background: var(--green-50); color: var(--green-800); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-sub); }
.btn--ghost:hover { background: var(--green-50); color: var(--green-800); border-color: var(--green-200); }
.btn--danger-ghost { background: transparent; border-color: var(--border); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-bg); border-color: #f0caca; color: var(--danger); }
.btn--sm { font-size: .8rem; padding: 5px 10px; }
.btn--sm .icon { width: 15px; height: 15px; }
.btn--lg { font-size: 1rem; padding: 11px 24px; }
.btn--block { width: 100%; }

/* 投稿フォーム */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.edit-side .panel { padding: 18px 20px; }
.cat-select { border: 0; padding: 0; margin: 0 0 12px; }
.cat-select legend {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .86rem; color: var(--green-800);
  padding: 0; margin-bottom: 2px;
}
.cat-select legend .icon { width: 16px; height: 16px; }
.cat-select .check { padding-left: 6px; font-size: .88rem; }

.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--green-50); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--green-500); background: var(--green-100); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__icon { width: 30px; height: 30px; color: var(--green-600); }
.dropzone__text { font-size: .92rem; color: var(--text-sub); }
.dropzone__link { color: var(--green-700); font-weight: 500; text-decoration: underline; }
.dropzone__note { font-size: .76rem; color: var(--text-mute); }

.attach-edit, .attach-new { list-style: none; margin: 0 0 12px; padding: 0; }
.attach-new:empty { display: none; }
.attach-new { margin-top: 12px; }
.attach-edit__item, .attach-new li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: .9rem; background: #fff;
}
.attach-edit__item.is-removing { opacity: .5; text-decoration: line-through; background: var(--danger-bg); }
.attach-edit__name, .attach-new__name { flex: 1; word-break: break-all; }
.attach-edit__size, .attach-new__size { font-size: .78rem; color: var(--text-mute); white-space: nowrap; }
.attach-edit__remove { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--danger); cursor: pointer; white-space: nowrap; }
.attach-new li { border-color: var(--green-200); background: var(--green-50); }
.attach-new__tag { font-size: .7rem; color: var(--green-700); background: #fff; border: 1px solid var(--green-200); border-radius: 3px; padding: 0 5px; }
.attach-new__remove { border: 0; background: none; color: var(--text-mute); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; }
.attach-new__remove:hover { color: var(--danger); }

/* ----------------------------------------------------------
   テーブル（管理画面）
   ---------------------------------------------------------- */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter-bar__count { margin-left: auto; font-size: .88rem; color: var(--text-sub); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-weight: 500; font-size: .8rem; color: var(--text-sub);
  background: var(--green-50); border-bottom: 1px solid var(--border);
  padding: 9px 10px; white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: #fafcfb; }
.table tr.is-muted td { color: var(--text-mute); }
.table__title { min-width: 200px; font-weight: 500; }
.table__actions { white-space: nowrap; text-align: right; }
.table__actions > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.table__actions form { display: inline-flex; }
.table td .icon { width: 15px; height: 15px; color: var(--green-600); }

.note-list { margin: 0; padding-left: 1.3em; font-size: .9rem; color: var(--text-sub); }
.note-list li { margin-bottom: 4px; }

/* ----------------------------------------------------------
   モーダル・トースト
   ---------------------------------------------------------- */
.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.is-open { display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(22,40,32,.45); }
.modal__dialog {
  position: relative; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: #fff; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.2);
  padding: 22px 26px;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal__head h2 { margin: 0; font-size: 1.15rem; color: var(--green-900); }
.modal__close { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--text-mute); cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--green-900); color: #fff;
  padding: 11px 22px; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------------------------------------
   ログイン
   ---------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(82,147,111,.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(45,106,79,.14), transparent 45%),
    var(--bg);
}
.login {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 420px; align-items: center; gap: 60px;
  max-width: 1000px; margin: 0 auto; padding: 40px 24px;
}
.login--single { grid-template-columns: minmax(0, 440px); justify-content: center; }
.login__site { margin: 0; font-weight: 700; color: var(--green-700); letter-spacing: .12em; }
.login__title { margin: 4px 0 14px; font-size: 2.1rem; color: var(--green-900); letter-spacing: .08em; }
.login__lead { margin: 0; color: var(--text-sub); line-height: 1.9; }
.login__card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(22,61,44,.08);
  padding: 30px 32px;
}
.login__card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 1.2rem; color: var(--green-900); }
.login__card-title .icon { color: var(--green-600); }
.login__forgot { text-align: center; font-size: .86rem; margin: 16px 0 0; }
.login__back { grid-column: 1 / -1; text-align: center; font-size: .86rem; color: var(--text-mute); letter-spacing: .1em; margin: 0; }

.demo-note {
  margin-top: 22px; padding: 12px 16px;
  border: 1px dashed var(--green-500); border-radius: var(--radius-sm);
  background: var(--green-50); font-size: .85rem;
}
.demo-note__title { margin: 0 0 6px; font-weight: 700; color: var(--green-800); font-size: .8rem; }
.demo-note dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.demo-note dt { color: var(--text-sub); }
.demo-note dd { margin: 0; }
.demo-note code { background: #fff; }

/* ----------------------------------------------------------
   レスポンシブ
   ---------------------------------------------------------- */
@media (max-width: 1100px) {
  .edit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .site-header__inner { padding: 0 12px; gap: 10px; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: #fff; cursor: pointer;
  }
  .nav-toggle .icon { width: 22px; height: 22px; }
    .brand__name { font-size: .95rem; }
  .header-search { display: none; }
  .view-switch__label span { display: none; }
  .user-menu__btn span { display: none; }

  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--header-h); bottom: 0; left: 0; z-index: 60;
    width: 290px; max-width: 86vw; overflow-y: auto;
    transform: translateX(-100%); transition: transform .25s;
    box-shadow: 4px 0 20px rgba(0,0,0,.1);
  }
  .sidebar nav, .is-preview .sidebar nav { position: static; max-height: none; overflow: visible; }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop { display: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 55; background: rgba(0,0,0,.3); }

  .main { padding: 20px 16px 48px; }
  .preview-bar__inner { padding: 8px 16px; }
  .form-actions--sticky { margin: 0 -16px; padding: 12px 16px; }

  .panel { padding: 18px 16px; }
  .article { padding: 22px 18px; }
  .article__title { font-size: 1.3rem; }
  .page-title { font-size: 1.3rem; }

  .login { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .login__lead br { display: none; }
  .login__card { text-align: left; padding: 24px 20px; }
  .login__title { font-size: 1.6rem; }

  /* テーブルをカード表示に */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 8px 12px; }
  .table td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .table td[data-label]::before { content: attr(data-label); flex: 0 0 82px; font-size: .76rem; color: var(--text-mute); }
  .table__actions { justify-content: flex-end; padding-top: 8px !important; }
  .table__title { min-width: 0; }
}

@media (max-width: 600px) {
  .attachment { flex-wrap: wrap; }
  .attachment__name { flex-basis: calc(100% - 50px); }
  .attachment__btns { width: 100%; justify-content: flex-end; }
  .file-result { flex-wrap: wrap; }
  .search-form__row { flex-direction: column; }
  .form-row--2col { grid-template-columns: 1fr; }
  .view-switch { padding: 3px 4px 3px 8px; }
  .view-switch select { font-size: .8rem; padding-right: 24px; }
  .brand__sub { display: none; }
}

/* 微調整 */
.brand__name, .brand__sub { white-space: nowrap; }
.table .tags { min-width: 180px; }
@media (max-width: 900px) { .table .tags { min-width: 0; } }
