/* =========================================================
   Studist 資格アプリの外枠（SSOT）
   宅建道場 /takken/ と 運転免許 /menkyo/ が共有する。
   色・書体などのトークンは base.css。ここは「画面の骨」だけ。

     ・ヘッダー（STUDISTの印＋資格名）
     ・モバイル＝画面下のタブ帯／PC＝左に240pxのサイドバー
     ・main の幅と余白、カード、ボタン、札、○×の印

   ここに書くのは2つのアプリで同じもの限定。
   片方だけの見た目は、そのページの <style> に置く。
   （以前は宅建のCSSを免許へ書き写していた。同じものが2か所にあると、
     片方を直したときにもう片方がずれる）
   ========================================================= */

:root{
  --navh:61px;          /* 下タブ = ボタン60px + 上境界1px */
  --sidebar-w:240px;
}

body{
  font-family:var(--font-sans);
  background:var(--paper);color:var(--text);
  font-size:17px;line-height:1.85;      /* 読みやすさ優先で大きめ */
  letter-spacing:.01em;
  padding-bottom:calc(88px + env(safe-area-inset-bottom));
}
h1,h2,h3{font-weight:700;line-height:1.5}

/* SVGアイコン（絵文字より視認性が高く、拡大しても崩れない） */
.ic{width:1.15em;height:1.15em;flex:none;vertical-align:-.18em;fill:none;
    stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ic.fill{fill:currentColor;stroke:none}

/* ---- ヘッダー ---- */
header{
  background:var(--paper-2);color:var(--text);border-bottom:1px solid var(--line);
  padding:8px 14px;padding-top:calc(8px + env(safe-area-inset-top));
  display:flex;align-items:center;gap:9px;
  position:sticky;top:0;z-index:40;
}
header .htitle{min-width:0}
header h1{font-size:16px;font-weight:700;letter-spacing:.03em;white-space:nowrap;line-height:1.4}
/* ブランドの印（本＋フクロウ）。資格ごとに変えない。
   画像は1つ（/assets/mark-mask.png）だけ置き、マスクとして使って
   --ink で塗る。こうすると夜モードでも色が合い、
   同じ絵を各ページに埋め込まずに済む（埋め込むと片方だけ古くなる）。 */
.hdrmark{
  display:inline-block;width:24px;height:24px;vertical-align:-5px;margin-right:7px;flex:none;
  background:var(--ink);
  -webkit-mask:url(/assets/mark-mask.png) center/contain no-repeat;
  mask:url(/assets/mark-mask.png) center/contain no-repeat;
}
header .brand{
  color:var(--ink);font-family:var(--font-mono);font-weight:700;
  letter-spacing:.12em;font-size:16px;
}
header .spacer{flex:1}

/* ---- タブバー(モバイル) / サイドバー(PC) ---- */
/* 下タブの高さは --navh だけで決める。固定ボタンの位置も同じ値を使うので、
   実行時に測る必要がない（測る方式は環境により画面高が返り、ボタンが画面外へ出た）。 */
nav{
  position:fixed;bottom:0;left:0;right:0;z-index:50;
  background:var(--card);border-top:1px solid var(--line);
  display:flex;padding-bottom:env(safe-area-inset-bottom);
}
nav button{
  flex:1;min-height:calc(var(--navh) - 1px);border:0;background:none;color:var(--sub);
  font-size:14.5px;
  font-family:inherit;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
}
nav button .ico{font-size:21px;line-height:1;display:flex}
nav button.on{color:var(--ink);font-weight:700}
nav button:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
.nv{line-height:1.3}

/* ---- 共通の器 ---- */
main{max-width:640px;margin:0 auto;padding:14px 2vw 30px}
section{display:none}
section.on{display:block}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;margin-bottom:12px;box-shadow:var(--shadow);
}
.btn{
  min-height:var(--tap);border-radius:var(--radius-sm);border:1px solid var(--line);
  background:var(--card);color:var(--text);font-family:inherit;font-size:15px;
  cursor:pointer;padding:10px 18px;
}
.btn.primary{background:var(--ink);border-color:var(--ink);color:#fff;font-weight:700}
.btn:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.pill{
  display:inline-block;font-size:14.5px;
  padding:2px 9px;border-radius:999px;
  background:var(--paper-2);border:1px solid var(--line);color:var(--sub);
  margin-right:5px;margin-bottom:4px;
}
.pill.gold{color:var(--gold);border-color:var(--gold);font-weight:700}
.mark{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;border-radius:50%;font-weight:800;font-size:15px;flex:none;
}
.mark.o{background:var(--maru-bg);color:var(--maru)}
.mark.x{background:var(--batu-bg);color:var(--batu)}

/* =========================================================
   ホーム画面（宅建道場と共通）

   宅建道場の /takken/ に書いてあったものを、そのまま持ってきた。
   資格ごとにホームを作り直さない。中身（どこへ行くボタンか、
   何点の配り方か）だけを試験ごとに差し替える。

   宅建側の index.html にはまだ同じ指定が中に残っている。
   このファイルは先に読まれるので、宅建の見た目は変わらない。
   宅建側で中の指定を消せば、両方がここ1か所を見るようになる。
   ========================================================= */

/* ---- 今日のカード ---- */
.todaycard{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:14px 16px;box-shadow:var(--shadow);margin-bottom:14px;
}
.tdrow{display:flex;align-items:center;gap:10px;font-size:15px}
.tdrow b{font-size:16px}
.tdgoal{margin-left:auto;color:var(--sub);font-size:14.5px}
.tdbar{height:8px;background:var(--paper-2);border-radius:4px;overflow:hidden;margin-top:10px}
.tdbar i{display:block;height:100%;width:0;background:var(--ink);transition:width .3s var(--ease)}

/* ---- ラジアルメニュー ---- */
.radialmenu{
  position:relative;width:100%;max-width:330px;aspect-ratio:1;margin:0 auto 14px;
}
.rmsvg{position:absolute;inset:0;width:100%;height:100%}
.rmhub,.rmnode{
  position:absolute;left:50%;top:50%;border-radius:50%;
  font-family:inherit;cursor:pointer;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:3px;
}
.rmhub{
  width:31%;aspect-ratio:1;transform:translate(-50%,-50%);
  background:var(--ink);border:0;color:#fff;box-shadow:var(--shadow-glow);
  font-size:14.5px;font-weight:800;line-height:1.35;z-index:2;
}
.rmnode{
  width:26%;aspect-ratio:1;
  background:var(--card);border:1.5px solid var(--line-strong);color:var(--text);
  font-size:14.5px;font-weight:700;box-shadow:var(--shadow);
  transform:translate(-50%,-50%);
  transition:transform .18s var(--ease);
}
.rmnode .ic{width:22px;height:22px;color:var(--ink)}
.rmnode:active{transform:translate(-50%,-50%) scale(.93)}
.rmnode:active{background:var(--card-hover)}
.rmhub:focus-visible,.rmnode:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
/* 丸の中に説明を入れると読めない。丸のときは名前だけ出す */
.nv small,.rmnode small{display:none}

.goalbox{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:12px 16px;box-shadow:var(--shadow);
}
.goalbox summary{font-weight:700;cursor:pointer;font-size:15px}
.goalbox .strategy{margin-top:10px}
.strategy{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.strategy .cell{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px}
.strategy .cell b{font-size:22px;color:var(--ink)}
.strategy .cell small{display:block;font-size:14.5px;color:var(--sub);margin-top:2px}

/* 大きい入口（アイコン＋名前＋ひとこと＋矢印） */
.sub{color:var(--sub);font-size:14.5px;line-height:1.75}
/* .ico は下タブでも使っている。入口の中だけに効かせる。
   絞らないと、宅建の下タブの絵が2px縮む */
.card[data-go] .ico .ic{width:22px;height:22px}
.card[data-go] .arr{font-size:20px;line-height:1}

/* =========================================================
   ログインのシート（宅建道場と共通）

   学習内容は会員限定（利用者の指示 2026-08-05）。
   データを取りに行って弾かれた場所からも、メニューのボタンからも、
   同じシートを開く。中身は /assets/auth.js が組み立てる。
   ========================================================= */
/* ---- ログインのシート ---- */
.sheet[hidden]{display:none}
.sheet{position:fixed;inset:0;z-index:300;display:flex;align-items:flex-end;justify-content:center}
.sheet-bg{position:absolute;inset:0;background:rgba(0,0,0,.42)}
.sheet-body{
  position:relative;width:100%;max-width:420px;background:var(--card);
  border-radius:var(--radius) var(--radius) 0 0;padding:22px 20px;
  padding-bottom:calc(22px + env(safe-area-inset-bottom));
  max-height:92vh;overflow-y:auto;box-shadow:0 -8px 40px rgba(0,0,0,.2);
}
@media(min-width:600px){
  .sheet{align-items:center}
  .sheet-body{border-radius:var(--radius);padding-bottom:22px}
}
.sheet-x{position:absolute;top:12px;right:12px;background:none;border:0;color:var(--muted);
  width:38px;height:38px;display:grid;place-items:center;cursor:pointer}
.sheet-body>b{font-size:19px;display:block}
.sheet-sub{font-size:14.5px;color:var(--sub);line-height:1.8;margin:6px 0 16px}
.gbtn{width:100%;background:#fff;color:#1d1d1f;border:1px solid var(--line-strong);gap:10px}
.gbtn svg{width:20px;height:20px;flex:none}
.sheet-or{display:flex;align-items:center;gap:10px;margin:16px 0;color:var(--muted);font-size:14.5px}
.sheet-or::before,.sheet-or::after{content:"";flex:1;height:1px;background:var(--line)}
.fld{display:block;margin-bottom:12px}
.fld>span{display:block;font-size:14.5px;font-weight:700;margin-bottom:5px}
.fld>span small{font-weight:400;color:var(--muted);margin-left:6px}
.fld input{
  width:100%;min-height:var(--tap);padding:11px 13px;font-size:16px;font-family:inherit;
  border:1px solid var(--line-strong);border-radius:var(--radius-sm);
  background:var(--paper);color:var(--text);
}
.fld input:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
.sheet-msg{font-size:14.5px;color:var(--batu);line-height:1.7;margin-top:9px;min-height:1.2em}
.sheet-foot{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px}
.linkbtn{background:none;border:0;color:var(--sub);font:inherit;font-size:14.5px;
  text-decoration:underline;cursor:pointer;padding:6px 0}
.sheet-note{font-size:14.5px;color:var(--muted);line-height:1.8;margin-top:14px}
/* 押す的は44px以上（R-9）。閉じるボタンは38pxしか無かった */
.sheet-x{width:var(--tap);height:var(--tap)}
.btn.ghost{background:none;border-color:transparent;color:var(--sub)}

/* ---- レスポンシブ: タブレット ---- */
@media (min-width:768px){
  main{max-width:760px;padding:20px 24px 40px}
}
/* ---- レスポンシブ: PC = パシャ勤怠ダッシュボード風サイドバー ---- */
@media (min-width:1024px){
  body{padding-bottom:0;padding-left:var(--sidebar-w)}
  nav{
    top:0;bottom:0;left:0;right:auto;width:var(--sidebar-w);
    flex-direction:column;justify-content:flex-start;
    background:var(--paper-2);border-top:0;border-right:1px solid var(--line);
    padding-top:0;gap:6px;
  }
  nav button{
    flex:none;flex-direction:row;justify-content:flex-start;gap:12px;
    min-height:60px;padding:0 20px;font-size:15.5px;border-radius:var(--radius-xs);
    margin:0 12px;text-align:left;
  }
  nav button.on{background:var(--ink-subtle);color:var(--ink)}
  header{position:sticky;z-index:60;padding-left:28px}
  main{max-width:1120px;padding:30px 36px 56px}
  .card{padding:24px 28px;margin-bottom:18px}
  .strategy{grid-template-columns:repeat(4,1fr)}

  /* ホームは丸い配置をやめ、カードを並べる */
  .radialmenu{
    max-width:none;aspect-ratio:auto;display:grid;
    grid-template-columns:repeat(3,1fr);gap:12px;margin:0 0 16px;
  }
  .rmsvg{display:none}
  .rmhub,.rmnode{
    position:static;transform:none;width:auto;aspect-ratio:auto;
    flex-direction:row;justify-content:flex-start;gap:12px;padding:0 20px;
    border-radius:var(--radius-sm);min-height:88px;font-size:15px;
  }
  .rmhub{grid-column:1/-1;min-height:60px;justify-content:center;font-size:15px}
  .rmhub .t br{display:none}
  .rmnode:active{transform:scale(.99)}
  .rmnode .ic{width:26px;height:26px;flex:none}
  .rmnode span{display:flex;flex-direction:column;gap:2px;text-align:left;line-height:1.3}
  /* 横に並べたら説明を出せる。丸のときは出さない（上で切っている） */
  .rmnode small{display:block;font-size:14.5px;font-weight:400;color:var(--sub)}
  .sub{font-size:15px;line-height:1.9}
}
/* マウスがある環境だけ、指す先を明るくする */
@media (hover:hover) and (min-width:1024px){
  .card[data-go]:hover,.rmnode:hover,.rmhub:hover{
    border-color:var(--line-strong);background:var(--card-hover);
  }
}
@media (min-width:1440px){
  main{max-width:1320px;padding:36px 48px 64px}
  .card{padding:28px 32px;margin-bottom:22px}
  nav button{min-height:64px;padding:0 24px}
}
