:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7785;
  --border: #e1e5ea;
  --primary: #1f5fbf;
  --primary-soft: #e8f0fc;
  --exec: #9a3412;
  --exec-soft: #fdeee4;
  --pin: #b91c1c;
  --pin-soft: #fdecec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --surface: #1d232a;
    --text: #e6e9ed;
    --muted: #9aa5b1;
    --border: #2e3640;
    --primary: #7aa7ec;
    --primary-soft: #1f2d42;
    --exec: #f4a37a;
    --exec-soft: #3a261c;
    --pin: #f19a9a;
    --pin-soft: #3b2224;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }

.header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: .6rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
}
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.nav { display: flex; gap: .25rem; }
.nav a { padding: .3rem .7rem; border-radius: 6px; color: var(--text); }
.nav a.active, .nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.search-box { flex: 1; min-width: 180px; }
.search-box input, label input, label select, label textarea {
  width: 100%; padding: .45rem .7rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit;
}
.user-menu { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.user-menu form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.card-pin { border-left: 4px solid var(--pin); }
.more { margin-left: auto; font-size: .85rem; font-weight: normal; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row .right { margin-left: auto; }
.desc { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .88rem; }
.empty { color: var(--muted); padding: .5rem 0; }
.date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.ext {
  font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge {
  font-size: .72rem; padding: .05rem .5rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); white-space: nowrap;
}
.badge-exec { background: var(--exec-soft); color: var(--exec); }
.badge-pin { background: var(--pin-soft); color: var(--pin); }

.meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.body { overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filters a {
  padding: .2rem .8rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .9rem;
}
.filters a.active { background: var(--primary); border-color: var(--primary); color: var(--surface); }

.pagination { display: flex; justify-content: center; gap: 1rem; align-items: center; }

.login { max-width: 420px; margin: 3rem auto; }
.brand-large { font-size: 2rem; margin-bottom: 0; }
.sub { color: var(--muted); margin-top: 0; }
label { display: block; margin-bottom: .9rem; font-size: .9rem; }
label input { margin-top: .25rem; }
.button {
  width: 100%; padding: .6rem; border: 0; border-radius: 6px;
  background: var(--primary); color: var(--surface); font: inherit; font-weight: 700; cursor: pointer;
}
.error, .message {
  padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem;
}
.error { background: var(--pin-soft); color: var(--pin); }
.message { background: var(--primary-soft); color: var(--primary); }

@media (max-width: 640px) {
  .user-menu { width: 100%; justify-content: flex-end; }
  .row .right { margin-left: 0; }
}

/* 社長メッセージ */
:root { --president: #0f5132; --president-soft: #e6f4ec; }
@media (prefers-color-scheme: dark) { :root { --president: #8fd6ad; --president-soft: #1b3326; } }
.president { margin-bottom: 1rem; }
.president-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--president);
  border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: .75rem;
}
.president-card h3 { margin: .25rem 0 .25rem; font-size: 1.1rem; }
.president-card .body p:first-child { margin-top: 0; }
.president-message { background: var(--president-soft); }
.president-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.president-head .right { margin-left: auto; }
.president-kind { font-weight: 700; color: var(--president); font-size: .9rem; }
.president-period { font-size: .85rem; color: var(--muted); }

/* 部署 */
.dept-card { display: block; color: var(--text); }
.dept-card:hover { border-color: var(--primary); text-decoration: none; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a { padding: .5rem 1rem; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; text-decoration: none; }
details.card summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.form { margin-top: 1rem; }
.form .button { width: auto; padding: .5rem 1.5rem; }
label textarea { margin-top: .25rem; resize: vertical; }
label input[type=file] { background: none; border: 0; padding-left: 0; }
.help { color: var(--muted); font-size: .82rem; margin: -.6rem 0 .9rem; }
.reply { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.reply .body p { margin: .2rem 0; }
.link-button.danger { color: var(--pin); font-size: .85rem; }
.row form { margin: 0; }
