:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #13334a;
  background: #f4f8fb;
  --blue: #064773;
  --orange: #ed9907;
  --muted: #466173;
  --line: #d8e5ee;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top .wrap { padding-block: 24px; }
.logo { display: block; width: min(245px, 100%); height: auto; }
main { padding-block: 42px 60px; }
.intro { margin-bottom: 28px; }
.intro::before { content: ""; display: block; width: 38px; height: 4px; margin-bottom: 13px; border-radius: 4px; background: var(--orange); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.1; letter-spacing: -.045em; color: var(--blue); }
h2 { font-size: 1.18rem; line-height: 1.3; }
.directory .wrap { width: min(960px, calc(100% - 32px)); }
.directory .top .wrap { padding-block: 12px; }
.directory .logo { width: min(176px, 100%); }
.directory main { padding-block: 22px 32px; }
.directory .intro { margin-bottom: 16px; }
.directory .intro::before { width: 26px; height: 3px; margin-bottom: 8px; }
.directory h1 { font-size: clamp(1.45rem, 3.6vw, 2rem); }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card, .empty, .panel { border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 23px; }
.card { position: relative; display: grid; grid-template-rows: 2rem 7rem 7.75rem; min-width: 0; padding: 0; color: var(--blue); overflow-wrap: anywhere; }
.card-link { color: inherit; text-underline-offset: 3px; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: 15px; }
.card:hover { border-color: var(--blue); background: #fafdff; box-shadow: 0 5px 18px #06477312; }
.card p, .empty, .hint { color: var(--muted); line-height: 1.55; }
.card-preview { display: flex; align-items: center; gap: 6px; padding-inline: 10px; border-radius: 14px 14px 0 0; background: #eef4f8; color: #33566e; font-size: .8125rem; font-weight: 600; }
.card-preview img { flex: none; width: 18px; height: 18px; object-fit: contain; }
.card-preview span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-preview[data-theme="kroho"] { background: #e8f2ff; color: #1b5188; }
.card-preview[data-theme="nfse"] { background: #fff3dc; color: #674712; }
.card-thumbnail { position: relative; overflow: hidden; display: grid; place-items: center; background: #f2f6fa; border-bottom: 1px solid var(--line); }
.card-thumbnail:has(iframe) { z-index: 1; }
.card-thumbnail[data-theme="kroho"] { background: linear-gradient(135deg, #eaf4ff, #f7fbff); }
.card-thumbnail[data-theme="nfse"] { background: linear-gradient(135deg, #fff7e8, #f4f8fa); }
.thumbnail-identity { display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); padding: 7px 10px; border-radius: 8px; background: white; box-shadow: 0 3px 12px #06477313; font-size: .875rem; font-weight: 650; }
.thumbnail-identity img { flex: none; width: 21px; height: 21px; object-fit: contain; }
.card-thumbnail iframe { position: absolute; inset: 0; width: 200%; height: 200%; border: 0; background: #fff; transform: scale(.5); transform-origin: top left; }
.card-detail { display: grid; align-content: start; gap: 3px; min-height: 0; padding: 9px 10px; }
.card-detail h2 { font-size: 1rem; }
.card-detail p { font-size: .875rem; line-height: 1.45; }
.card-detail .card-note { font-size: .8125rem; line-height: 1.3; }
.card-detail h2, .card-detail p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.admin { max-width: 760px; }
.admin .intro p { margin-top: 12px; }
.panel { margin-bottom: 16px; }
form, .entries { display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-weight: 650; }
input, textarea, button { font: inherit; }
input, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #9eb5c5; border-radius: 8px; color: inherit; }
textarea { resize: vertical; }
button { min-height: 44px; border: 1px solid var(--blue); border-radius: 8px; padding: 9px 14px; color: white; background: var(--blue); font-weight: 650; cursor: pointer; }
button:hover { filter: brightness(.88); }
.secondary { background: white; color: var(--blue); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.entry { display: grid; gap: 8px; overflow-wrap: anywhere; }
.entry + .entry { border-top: 1px solid var(--line); padding-top: 14px; }
#message { margin-top: 12px; }
.error { color: #a12a25; }
@media (max-width: 560px) {
  .wrap { width: calc(100% - 30px); }
  main { padding-top: 30px; }
  .top .wrap { padding-block: 18px; }
}
