/* /kyotsu-kakomon/ hub and /kyotsu-test-YYYY/ year pages: data-browsing UI. Scoped to .kyotsu-kakomon; colors and fonts come from tokens.css. */
.kyotsu-kakomon{--kk-pale:#eef5fb;--kk-line:#d9e4ef;--kk-text:#1f2d3d;--kk-sub:#3c4c5f;--kk-top:var(--header-height);color:var(--kk-text);font-family:var(--font-body);font-size:14px;overflow-x:clip}
.kyotsu-kakomon *{box-sizing:border-box}
.kyotsu-kakomon [hidden]{display:none!important}
.kyotsu-kakomon a{color:var(--blue)}
.kyotsu-kakomon a:focus-visible,.kyotsu-kakomon button:focus-visible,.kyotsu-kakomon input:focus-visible,.kyotsu-kakomon select:focus-visible{outline:3px solid #7fa6d6;outline-offset:2px}
.kyotsu-kakomon ul{list-style:none;margin:0;padding:0}
.kyotsu-kakomon h1,.kyotsu-kakomon h2,.kyotsu-kakomon h3,.kyotsu-kakomon h4{font-family:var(--font-body);font-weight:700;color:var(--navy);margin:0;line-height:1.45;letter-spacing:.02em}
.kk-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Header band */
.kx-head{background:var(--kk-pale);border-bottom:1px solid var(--kk-line);padding:18px 0 16px}
.kx-head>.container{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"main main" "stats search";gap:12px 28px;align-items:center}
.kx-head-main{grid-area:main}
.kx-head h1{font-size:26px}
.kx-desc{margin:4px 0 0;font-size:14px;line-height:1.6;color:var(--kk-sub)}
.kx-stats{grid-area:stats;display:flex;flex-wrap:wrap;gap:6px}
.kx-stats li{display:inline-flex;align-items:baseline;gap:4px;padding:5px 12px;background:#fff;border:1px solid var(--kk-line);border-radius:6px;font-size:13px;color:var(--kk-sub);white-space:nowrap}
.kx-stats b{font-family:var(--font-english);font-size:18px;color:var(--navy);font-weight:500}
.kx-stats small{margin-left:4px;font-size:12px}
.kx-search{grid-area:search;display:flex;align-items:center;gap:10px;justify-self:end;width:min(100%,480px)}
.kx-search label{font-size:14px;font-weight:700;color:var(--navy);white-space:nowrap}
.kx-search input{flex:1;min-width:0;height:40px;padding:0 12px;border:1px solid #b9cbe0;border-radius:8px;background:#fff;font:inherit;font-size:15px;color:var(--kk-text)}
.kx-hits{font-size:13px;color:var(--kk-sub);white-space:nowrap}

/* Hub body: filter panel + results */
.kx-body{padding-top:20px;padding-bottom:48px}
.kx-side{background:#fff;border:1px solid var(--kk-line);border-radius:10px;padding:12px}
.kx-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.kx-tabs button{min-height:40px;padding:6px 8px;border:1px solid var(--blue);border-radius:8px;background:#fff;color:var(--blue);font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.kx-tabs button[aria-selected="true"]{background:var(--blue);color:#fff}
.kyotsu-kakomon:not(.kx-js) .kx-tabs{display:none}
.kx-pane{margin-top:12px}
.kyotsu-kakomon:not(.kx-js) .kx-pane+.kx-pane{border-top:1px solid var(--kk-line);padding-top:12px}
.kx-ygroup+.kx-ygroup{margin-top:14px}
.kx-glabel{margin:0 0 6px;font-size:14px;font-weight:700;color:var(--navy)}
.kx-glabel span{margin-left:8px;font-weight:400;color:var(--kk-sub)}
.kx-ygrid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.kyotsu-kakomon .kx-ygrid a{display:flex;align-items:center;justify-content:center;height:36px;border:1px solid var(--kk-line);border-radius:6px;font-family:var(--font-english);font-size:16px;font-weight:500;color:var(--navy);text-decoration:none;background:#fff}
.kyotsu-kakomon .kx-ygrid a:hover{border-color:var(--blue);background:var(--kk-pale)}
.kyotsu-kakomon .kx-ygrid a[aria-current="true"],.kyotsu-kakomon .kx-slist a[aria-current="true"]{background:var(--blue);border-color:var(--blue);color:#fff}
.kx-acc{border-top:1px solid var(--kk-line)}
.kx-acc:first-child{border-top:0}
.kx-acc-btn{display:flex;align-items:center;width:100%;min-height:40px;padding:6px 4px;border:0;background:none;font:inherit;font-size:15px;font-weight:700;color:var(--navy);cursor:pointer;text-align:left}
.kx-acc-btn span{margin-left:auto;margin-right:10px;font-size:13px;font-weight:400;color:var(--kk-sub)}
.kx-acc-btn::after{content:"";width:8px;height:8px;border-right:2px solid var(--blue);border-bottom:2px solid var(--blue);transform:translateY(-2px) rotate(45deg);transition:transform .15s}
.kx-acc-btn[aria-expanded="true"]::after{transform:translateY(2px) rotate(225deg)}
.kx-js .kx-acc-btn[aria-expanded="false"]+.kx-slist{display:none}
.kx-slist{padding-bottom:8px!important}
.kyotsu-kakomon .kx-slist a{display:flex;align-items:center;gap:8px;min-height:36px;padding:6px 10px;border-radius:6px;font-size:14px;color:var(--kk-text);text-decoration:none;line-height:1.4}
.kyotsu-kakomon .kx-slist a:hover{background:var(--kk-pale);color:var(--blue)}
.kx-slist a span{margin-left:auto;font-size:13px;color:var(--kk-sub);white-space:nowrap}
.kx-slist a[aria-current="true"] span{color:#fff}
.kx-selects{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.kx-selects label{display:flex;flex-direction:column;gap:4px;font-size:14px;font-weight:700;color:var(--navy)}
.kx-selects select{width:100%;height:44px;padding:0 10px;border:1px solid #b9cbe0;border-radius:8px;background:#fff;font:inherit;font-size:15px;color:var(--kk-text)}
.kx-selects select.on{border:2px solid var(--blue);font-weight:700;color:var(--navy)}

.kx-main{min-width:0}
.kx-result-head{display:flex;align-items:flex-end;justify-content:space-between;gap:8px 20px;flex-wrap:wrap;padding-bottom:10px}
.kx-result-head h2{font-size:20px}
.kx-result-meta{margin:2px 0 0;font-size:14px;color:var(--kk-sub)}
.kyotsu-kakomon a.kx-yearlink{display:inline-flex;align-items:center;min-height:36px;padding:6px 14px;border:1px solid var(--blue);border-radius:8px;font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}
.kyotsu-kakomon a.kx-yearlink:hover{background:var(--blue);color:#fff}
.kx-panel+.kx-panel{margin-top:28px}
.kx-panel h3{font-size:17px;margin-bottom:8px}
.kx-panel h3 span{margin-left:10px;font-size:13px;font-weight:400;color:var(--kk-sub)}
.kx-js .kx-panel h3{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.kx-js .kx-panel+.kx-panel{margin-top:0}
.kx-empty{margin:0;padding:20px;border:1px dashed var(--kk-line);border-radius:8px;text-align:center;color:var(--kk-sub)}
.kx-special{margin-top:28px}
.kx-special>h3{font-size:17px}
.kx-special-item{margin-top:12px}
.kx-special-item h3,.kx-special-item h4{font-size:15px;margin-bottom:6px}

/* Shared data table */
.kd-wrap{border:1px solid var(--kk-line);border-radius:8px;background:#fff}
.kd{width:100%;border-collapse:separate;border-spacing:0;font-size:14px;line-height:1.4}
.kd th,.kd td{padding:5px 6px;border-bottom:1px solid var(--kk-line);text-align:center;vertical-align:middle}
.kd thead th{position:sticky;top:var(--kk-top);z-index:2;background:#e6eef7;color:var(--navy);font-size:13px;font-weight:700;white-space:nowrap}
.kd thead tr:first-child th{height:30px}
.kd thead tr.kd-sub-head th{top:calc(var(--kk-top) + 30px);height:28px;background:#f1f6fb}
.kd thead tr:first-child th:first-child{border-top-left-radius:8px}
.kd thead tr:first-child th:last-child{border-top-right-radius:8px}
.kd .kd-exam-s,.kd th:not(.s)+th.s,.kd td:not(.s)+td.s{border-left:2px solid var(--kk-line)}
.kd .kd-first{width:1%;min-width:150px;text-align:left;padding-left:12px}
.kd-subject .kd .kd-first{min-width:88px}
.kd .kd-rm{text-align:left}
.kd thead .kd-rm{width:1%;min-width:120px}
.kd tbody tr{height:40px}
.kd tbody tr:nth-child(even):not(.kd-g){background:#f7fafd}
.kd tbody tr:not(.kd-g):hover{background:#edf4fb}
.kd tbody th{text-align:left;padding-left:12px;font-weight:700;color:var(--navy)}
.kd tbody th a{font-family:var(--font-english);font-size:16px;font-weight:500;text-decoration:none}
.kd tbody th a:hover{text-decoration:underline}
.kd-sub{display:block;font-size:12px;font-weight:400;color:var(--kk-sub)}
.kd tr.kd-g th{padding:6px 12px;background:#dfe9f4;font-size:14px;color:var(--navy);text-align:left;border-bottom:1px solid #c7d6e7}
.kd td.e{color:#9aa5b1}
.kd td.kd-era{font-size:13px;color:var(--kk-sub);white-space:nowrap}
.kd tbody tr:last-child>*{border-bottom:0}
.kd td a{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 9px 0 7px;margin:1px;border:1px solid var(--blue);border-radius:6px;background:#fff;font-size:13px;font-weight:700;text-decoration:none;white-space:nowrap}
.kd td a::before{content:"";width:13px;height:13px;flex:none;background:currentColor;-webkit-mask:var(--ki) center/contain no-repeat;mask:var(--ki) center/contain no-repeat}
.kd td a:hover{background:var(--blue);color:#fff}
.kd td a.kq{--ki:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 1h7l3 3v11H3z' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M5.5 7h5M5.5 10h5M5.5 13h3' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E");background:#e8f0fa}
.kd td a.kq:hover{background:var(--blue)}
.kd td a.ka{--ki:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M5 8.2l2.1 2.1L11 6' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3C/svg%3E")}
.kd td a.ku{--ki:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6h3l4-3.5v11L5 10H2z' fill='%23000'/%3E%3Cpath d='M11 5.5a3.5 3.5 0 0 1 0 5M12.8 3.5a6 6 0 0 1 0 9' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E");border-color:#8a5a00;color:#7a4f00}
.kd td a.ku:hover{background:#7a4f00;border-color:#7a4f00;color:#fff}
.kd td a.ko,.kd td a.kd-guide{--ki:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3h7v7M13 3L4 12' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3C/svg%3E")}
.kd td a.kd-guide{border-color:transparent;background:none;padding:0 4px;text-decoration:underline;text-underline-offset:3px}
.kd td a.kd-guide:hover{color:var(--navy-3);background:none}
.kd-b{display:inline-block;margin:1px 4px 1px 0;padding:2px 7px;font-size:12px;font-weight:700;border-radius:4px;background:#fdf1d8;color:#6b4700;white-space:nowrap}
.kd-b-n{background:#e6eef7;color:var(--blue)}

/* Related + CTA */
.kx-related{padding:28px 0;border-top:1px solid var(--kk-line)}
.kx-related h2{font-size:18px}
.kx-related ul{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px!important}
.kyotsu-kakomon .kx-related a{display:flex;flex-direction:column;gap:4px;height:100%;padding:10px 12px;border:1px solid var(--kk-line);border-radius:8px;font-size:14px;font-weight:700;line-height:1.5;text-decoration:none;color:var(--navy)}
.kyotsu-kakomon .kx-related a:hover{border-color:var(--blue);background:var(--kk-pale)}
.kx-tag{align-self:flex-start;padding:1px 8px;font-size:12px;font-weight:400;border-radius:4px;background:var(--kk-pale);color:var(--blue)}
.kk-eyebrow{font-family:var(--font-english);font-size:13px;font-weight:500;letter-spacing:.14em;color:var(--blue);margin:0}
.kk-jump{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}
.kk-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 26px;border-radius:999px;font-size:14px;letter-spacing:.04em;text-decoration:none;border:2px solid var(--blue);transition:background .2s,color .2s}
.kyotsu-kakomon a.kk-btn-outline{background:#fff;color:var(--blue)}
.kyotsu-kakomon a.kk-btn-outline:hover{background:var(--kk-pale)}
.kyotsu-kakomon a.kk-btn-line{background:#06c755;border-color:#06c755;color:#fff}
.kyotsu-kakomon a.kk-btn-line:hover{background:#05a948;border-color:#05a948}
.kk-cta{padding:40px 0;background:var(--kk-pale);border-top:1px solid var(--kk-line)}
.kk-cta h2{font-size:clamp(18px,2.2vw,22px);line-height:1.7;margin-top:6px}
.kk-cta p:not(.kk-eyebrow){margin:10px 0 0;font-size:14px}

/* Year page */
.ky-crumb{margin-bottom:8px;font-size:13px}
.ky-crumb ol{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}
.ky-crumb li+li::before{content:"\203A";margin:0 8px;color:var(--kk-sub)}
.kyotsu-year .ky-crumb a{text-decoration:none}
.ky-crumb [aria-current]{color:var(--kk-sub)}
.ky-head>.container{display:block}
.ky-head-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px 24px;flex-wrap:wrap}
.ky-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px!important}
.ky-badges li{padding:3px 10px;background:#fff;border:1px solid var(--kk-line);border-radius:6px;font-size:13px;color:var(--kk-sub)}
.ky-badges li.ky-badge-era{background:var(--blue);border-color:var(--blue);color:#fff;font-weight:700}
.ky-yearnav{display:flex;gap:6px}
.kyotsu-year .ky-yearnav a,.ky-off{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:6px 14px;border:1px solid var(--blue);border-radius:8px;background:#fff;font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}
.kyotsu-year .ky-yearnav a:hover{background:var(--blue);color:#fff}
.kyotsu-year .ky-yearnav a.ky-hub{background:var(--blue);color:#fff}
.kyotsu-year .ky-yearnav a.ky-hub:hover{background:var(--navy-3)}
.ky-off{border-color:var(--kk-line)!important;color:#7d8a99;font-weight:400!important}
.ky-body{padding-top:20px;padding-bottom:40px}
.ky-body>section+section{margin-top:28px}
.ky-body h2{font-size:20px}
.ky-kv-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px;align-items:start}
.ky-kv{border:1px solid var(--kk-line);border-radius:8px;background:#fff;overflow:hidden}
.ky-kv h3{padding:8px 12px;font-size:14px;background:#e6eef7}
.ky-kv dl{margin:0}
.ky-kv dl>div{display:flex;justify-content:space-between;gap:12px;padding:7px 12px;border-top:1px solid var(--kk-line)}
.ky-kv h3+dl>div:first-child{border-top:0}
.ky-kv dt{font-size:14px;color:var(--kk-text)}
.ky-kv dd{margin:0;font-size:14px;font-weight:700;color:var(--navy);text-align:right;font-variant-numeric:tabular-nums}
.ky-kv .ky-kv-head{background:#f1f6fb}
.ky-kv .ky-kv-head dt,.ky-kv .ky-kv-head dd{font-size:13px;font-weight:700;color:var(--kk-sub)}
.ky-notes p,.ky-overview-body p{margin:8px 0 0;font-size:13px;line-height:1.8;color:var(--kk-sub)}
.ky-overview-body .emdash-table-wrapper{max-width:100%;overflow-x:auto;margin-top:10px;border:1px solid var(--kk-line);border-radius:8px;background:#fff}
.ky-overview-body table{width:100%;border-collapse:collapse;font-size:14px}
.ky-overview-body th,.ky-overview-body td{padding:8px 12px;border-bottom:1px solid var(--kk-line);text-align:left}
.ky-overview-body th{background:var(--kk-pale);color:var(--navy)}
.ky-overview-body td p,.ky-overview-body th p{margin:0;font-size:inherit;color:inherit}
.ky-data-head{margin-bottom:10px}
.ky-data-head p{margin:2px 0 0;font-size:14px;color:var(--kk-sub)}
.ky-strip ul{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px!important}
.kyotsu-year .ky-strip a{display:inline-flex;align-items:center;justify-content:center;min-width:56px;height:36px;border:1px solid var(--kk-line);border-radius:6px;font-family:var(--font-english);font-size:15px;font-weight:500;text-decoration:none;color:var(--navy);background:#fff}
.kyotsu-year .ky-strip a:hover{border-color:var(--blue);background:var(--kk-pale)}
.kyotsu-year .ky-strip a[aria-current="page"]{background:var(--blue);border-color:var(--blue);color:#fff}

/* PC: two columns */
@media(min-width:1024px){
  .kx-body{display:grid;grid-template-columns:280px minmax(0,1fr);gap:24px;align-items:start}
  .kx-side{position:sticky;top:calc(var(--header-height) + 16px);max-height:calc(100vh - var(--header-height) - 32px);overflow-y:auto;overscroll-behavior:contain}
  .kx-js .kx-selects{display:none!important}
}
@media(min-width:1024px) and (max-width:1279px){
  .kx-body{grid-template-columns:248px minmax(0,1fr);gap:16px}
}
@media(min-width:601px) and (max-width:1279px){
  .kd th,.kd td{padding:4px 3px}
  .kd td a{gap:3px;padding:0 6px 0 5px}
  .kd .kd-first{min-width:128px}
  .kd-subject .kd .kd-first{min-width:72px}
  .kd thead .kd-rm{min-width:112px}
  .kd td a.kd-guide{white-space:normal;height:auto;line-height:1.4}
}
@media(min-width:601px) and (max-width:767px){
  .kd td a::before{display:none}
  .kd td a{padding:0 7px}
}
@media(max-width:1023px){
  .kx-head>.container{grid-template-columns:1fr;grid-template-areas:"main" "stats" "search"}
  .kx-search{justify-self:stretch;width:100%}
  .kx-side{margin-bottom:16px}
  .kx-js .kx-pane{display:none!important}
  .kx-related ul{grid-template-columns:1fr 1fr}
  .ky-kv-grid{grid-template-columns:1fr}
}
@media(max-width:680px){
  .kx-head h1{font-size:22px}
  .ky-head-row{display:block}
  .ky-yearnav{margin-top:10px}
  .ky-yearnav>*{flex:1}
  .kk-jump .kk-btn{flex:1 1 100%}
}

/* Phones: rows become stacked cards (name, then buttons) so nothing scrolls sideways. */
@media(max-width:600px){
  .kd-wrap{border:0;background:none}
  .kd,.kd tbody{display:block;width:100%}
  .kd thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .kd tbody tr{display:flex;flex-wrap:wrap;align-items:center;gap:6px;height:auto;padding:10px 12px;margin-bottom:8px;background:#fff!important;border:1px solid var(--kk-line);border-radius:8px}
  .kd tr.kd-g{display:block;padding:0;margin:14px 0 6px;border:0;background:none!important}
  .kd tr.kd-g th{display:block;padding:0;background:none;border:0;font-size:15px}
  .kd th,.kd td{display:contents;border:0!important;padding:0}
  .kd tbody tr:not(.kd-g) th{display:block;flex:0 0 100%;padding:0;font-size:15px}
  .kd tbody th a{font-size:17px}
  .kd-sub{display:inline;margin-left:8px}
  .kd td.e,.kd td.kd-era{display:none}
  .kd td a{height:36px;padding:0 12px 0 10px;font-size:14px}
  .kd td.s a::after{content:"追試";order:-1;font-weight:400}
  .kd td.kd-rm a.kd-guide{border-color:var(--blue);padding:0 12px}
  .kx-related ul{grid-template-columns:1fr}
}
