
:root{
  --aqua:#19cce3;
  --aqua2:#43e7f0;
  --cyan:#02b9d8;
  --blue:#38a9ff;
  --sky:#eafcff;
  --sky2:#d9f8ff;
  --ink:#30506a;
  --ink2:#466b84;
  --muted:#7a9aae;
  --line:#bcecf4;
  --white:#ffffff;
  --pink:#ff73b8;
  --orange:#ffb55a;
  --green:#63db9b;
  --purple:#9c7bff;
  --cute:#ff91a8;
  --happy:#ffd76f;
  --pure:#7adba1;
  --shadow:0 10px 30px rgba(42,155,187,.16);
  --rainbow:#20b9d6;
}
*{box-sizing:border-box}
html{
  background:#f5fdff;
  color:var(--ink);
  font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",system-ui,-apple-system,sans-serif;
  scroll-behavior:smooth;
}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 8% 14%,rgba(80,226,242,.22),transparent 25rem),
    radial-gradient(circle at 93% 18%,rgba(255,126,185,.12),transparent 24rem),
    linear-gradient(180deg,#f9feff 0%,#eefdff 48%,#f9feff 100%);
}
button,select,input{font:inherit}
button{touch-action:manipulation}

/* ===== header ===== */
.topbar{
  min-height:92px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  padding:12px max(22px,calc((100vw - 1500px)/2));
  background:rgba(255,255,255,.96);
  border-bottom:1px solid #d9f5fa;
  box-shadow:0 5px 22px rgba(21,176,207,.08);
  position:sticky;
  top:0;
  z-index:30;
  backdrop-filter:blur(14px);
}
.brand-wrap{display:flex;align-items:center;gap:10px;min-width:230px}
.brand-mark{
  position:relative;
  width:56px;height:56px;border-radius:18px;
  background:linear-gradient(145deg,#24e5ec,#14bde1);
  box-shadow:0 7px 16px rgba(24,197,222,.28);
  transform:rotate(-5deg);
}
.brand-mark:before{
  content:"";
  position:absolute;inset:10px;
  background:white;
  clip-path:polygon(50% 0,61% 34%,100% 28%,69% 53%,86% 88%,51% 70%,22% 100%,28% 61%,0 48%,38% 38%);
  opacity:.96;
}
.spark{position:absolute;font-weight:900;z-index:2;text-shadow:0 1px 0 #fff}
.s1{right:-8px;top:-6px;color:#ff81bd;font-size:17px}
.s2{left:-7px;bottom:-3px;color:#71dfff;font-size:16px}
.s3{right:-8px;bottom:3px;color:#ffd463;font-size:15px}
.brand-copy{line-height:1}
.brand-hololive{font-size:14px;color:#32bcd7;font-weight:900;letter-spacing:.02em}
.brand-dreams{
  margin-top:-1px;
  font-size:30px;
  font-weight:1000;
  letter-spacing:-.055em;
  line-height:.92;
  color:#20b9d6;
  filter:drop-shadow(0 2px 0 rgba(255,255,255,.8));
}
.brand-sub{font-size:10px;color:#66889b;font-weight:800;margin-top:5px;letter-spacing:.08em}
.top-badges{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.badge{
  border:1px solid #a8e8f2;
  background:linear-gradient(180deg,#ffffff,#eafcff);
  color:#218aa8;
  border-radius:999px;
  padding:7px 11px;
  font-size:11px;
  font-weight:900;
  box-shadow:0 3px 8px rgba(17,177,206,.08);
}
.badge.muted{color:#7696aa;border-color:#d2edf2;background:#f9feff}
.menu-button{
  display:none;
  width:54px;height:54px;border:0;background:transparent;padding:11px;cursor:pointer;
}
.menu-button span{display:block;height:6px;background:#25cde2;border-radius:999px;margin:5px 0}

/* ===== hero ===== */
.dream-hero{
  position:relative;
  overflow:hidden;
  min-height:215px;
  background:
    linear-gradient(135deg,rgba(35,217,236,.96),rgba(70,200,240,.93) 48%,rgba(73,224,238,.95)),
    radial-gradient(circle,#fff 1px,transparent 1.5px);
  background-size:auto,28px 28px;
  border-bottom:5px solid #d5fbff;
}
.hero-inner{
  position:relative;z-index:4;
  max-width:1500px;margin:0 auto;
  padding:38px 24px 55px;
  text-align:center;
  color:white;
}
.hero-kicker{
  font-weight:1000;
  letter-spacing:.12em;
  text-shadow:0 2px 8px rgba(13,139,169,.2);
  font-size:clamp(14px,2vw,21px);
}
.hero-title{
  margin-top:6px;
  font-size:clamp(45px,7vw,78px);
  font-weight:1000;
  letter-spacing:-.06em;
  color:white;
  text-shadow:0 4px 0 rgba(13,173,201,.12),0 8px 20px rgba(6,140,176,.18);
}
.hero-title span{color:white;}
.hero-ribbon{
  display:inline-flex;margin-top:13px;
  padding:8px 18px;border-radius:999px;
  background:rgba(255,255,255,.19);
  border:2px solid rgba(255,255,255,.55);
  font-size:11px;font-weight:900;letter-spacing:.14em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35);
}
.hero-glow{position:absolute;border-radius:50%;filter:blur(5px);opacity:.4}
.glow-a{width:300px;height:300px;left:-50px;top:-120px;background:#fff}
.glow-b{width:330px;height:330px;right:-70px;bottom:-190px;background:#97aaff}
.wave{position:absolute;left:-5%;width:110%;height:80px;background:#fff;border-radius:50% 50% 0 0/50% 50% 0 0;opacity:.12}
.wave-1{bottom:-55px;transform:rotate(2deg)}
.wave-2{bottom:-66px;transform:rotate(-3deg);opacity:.18}

/* ===== navigation ===== */
.tabs{
  position:sticky;
  top:92px;
  z-index:25;
  display:flex;
  gap:8px;
  justify-content:center;
  padding:10px max(18px,calc((100vw - 1500px)/2));
  background:rgba(246,254,255,.93);
  border-bottom:1px solid #cef1f6;
  backdrop-filter:blur(12px);
  overflow-x:auto;
}
.tab{
  border:2px solid transparent;
  background:transparent;
  color:#6691a7;
  padding:10px 17px;
  border-radius:999px;
  font-weight:1000;
  white-space:nowrap;
  cursor:pointer;
  transition:.15s ease;
}
.tab:hover{background:#e7fbff;color:#18a8c5}
.tab.active{
  color:white;
  border-color:#fff;
  background:linear-gradient(135deg,#33dce8,#21bde0);
  box-shadow:0 4px 12px rgba(20,183,215,.25),0 0 0 2px #8be8f2;
}

/* ===== layout ===== */
main{max-width:1500px;margin:0 auto;padding:24px}
.tab-panel{display:none}.tab-panel.active{display:block}
.grid.two{display:grid;grid-template-columns:minmax(430px,.9fr) minmax(520px,1.1fr);gap:18px}
.card{
  position:relative;
  border:2px solid var(--line);
  border-radius:26px;
  background:rgba(255,255,255,.95);
  box-shadow:var(--shadow);
}
.card:before{
  content:"";
  pointer-events:none;
  position:absolute;
  inset:4px;
  border:1px solid rgba(255,255,255,.9);
  border-radius:20px;
}
.section-card{padding:20px;margin-bottom:18px}
.section-title{
  position:relative;
  display:flex;justify-content:space-between;align-items:center;gap:14px;
  margin:-20px -20px 18px;
  padding:16px 20px 14px;
  border-radius:24px 24px 0 0;
  background:linear-gradient(180deg,#f7feff,#eafcff);
  border-bottom:1px solid #cceff5;
}
.section-title:after{
  content:"✦";
  position:absolute;right:18px;bottom:-10px;
  color:#57ddea;font-size:15px;
  background:#fff;border:1px solid #c9f1f6;border-radius:50%;
  width:22px;height:22px;display:grid;place-items:center;
}
h1{margin:0}
h2{
  margin:2px 0 0;
  font-size:22px;
  color:#315d75;
  font-weight:1000;
  letter-spacing:-.02em;
}
.eyebrow{
  font-size:10px;
  letter-spacing:.15em;
  color:#22b9d3;
  text-transform:uppercase;
  font-weight:1000;
}

/* ===== inputs/buttons ===== */
.field{display:grid;gap:7px;margin:12px 0;color:#588198;font-size:12px;font-weight:900}
select,input{
  width:100%;
  background:#fff;
  color:#31566e;
  border:2px solid #bcebf2;
  border-radius:14px;
  padding:11px 13px;
  outline:none;
  box-shadow:inset 0 1px 2px rgba(56,165,194,.05);
}
select:focus,input:focus{
  border-color:#26c9de;
  box-shadow:0 0 0 4px rgba(38,201,222,.12);
}
.compact{display:flex;align-items:center;gap:8px;color:#62899f;font-size:12px;font-weight:900}
.row,.quick-actions,.rank-controls,.filters{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.quick-actions{margin-bottom:10px}
.button{
  border:2px solid #9fe5ef;
  border-radius:999px;
  padding:10px 15px;
  background:linear-gradient(180deg,#fff,#e9fbff);
  color:#168dac;
  font-weight:1000;
  cursor:pointer;
  box-shadow:0 4px 10px rgba(18,174,205,.1);
  transition:.15s ease;
}
.button:hover{transform:translateY(-1px);box-shadow:0 7px 14px rgba(18,174,205,.16)}
.button.primary{
  color:white;
  border-color:#fff;
  background:linear-gradient(135deg,#42dfe9,#1eb9dc);
  box-shadow:0 5px 14px rgba(24,188,218,.24),0 0 0 2px #9debf3;
}
.member-selectors{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.member-selectors .field:last-child{grid-column:1/-1}

/* ===== metrics ===== */
.metrics,.board-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.metric{
  background:linear-gradient(180deg,#fff,#effcff);
  border:2px solid #c9eef4;
  border-radius:18px;
  padding:14px;
  box-shadow:inset 0 1px 0 white;
}
.metric span{display:block;color:#7496aa;font-size:11px;font-weight:900;margin-bottom:6px}
.metric strong{
  color:#35617a;
  font-size:22px;
  font-weight:1000;
  font-variant-numeric:tabular-nums;
}
.metric.emphasis{
  border-color:#58d8e8;
  background:linear-gradient(135deg,#f9ffff,#e4fbff);
  box-shadow:0 4px 14px rgba(36,191,217,.12),inset 0 1px 0 #fff;
}
.metric.emphasis strong{color:#35617a;}

/* ===== statuses ===== */
.condition-summary{display:grid;gap:8px;margin-top:12px}
.condition-line{
  display:flex;justify-content:space-between;gap:10px;
  padding:10px 12px;
  border:1px solid #cbeef3;border-radius:14px;
  background:#fbfeff;
  font-size:12px;
}
.condition-line .ok{color:#2bbf7c}.condition-line .ng{color:#ef6d88}
.subtext{color:#7396aa;font-size:12px;line-height:1.75}
.warning{
  background:#fff5f8;border:2px solid #ffc2d2;color:#b84f6a;
  border-radius:14px;padding:10px 12px;margin-top:10px;font-size:12px;
}
.hidden{display:none}

/* ===== board ===== */
.board-card{
  background:
    linear-gradient(180deg,rgba(255,255,255,.97),rgba(244,253,255,.97)),
    radial-gradient(circle at 80% 10%,rgba(255,132,190,.1),transparent 18rem);
}
.board-summary{margin:14px 0}
.board-allocations{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:12px 0}
.alloc-card{
  border:2px solid #cceff5;
  border-radius:18px;
  background:linear-gradient(180deg,#fff,#effcff);
  padding:12px;
  text-align:center;
}
.alloc-card strong{display:block;margin-bottom:8px;color:#426c83}
.alloc-card .bonus{
  margin:8px 0 4px;
  font-size:25px;
  color:#20b9d6;
  font-weight:1000;
}
.type-pill{
  display:inline-flex;border-radius:999px;padding:4px 9px;
  font-weight:1000;font-size:10px;border:1px solid rgba(255,255,255,.8);
}
.type-pill.cute{background:#ffe0e7;color:#d95472}
.type-pill.happy{background:#fff3c8;color:#b78112}
.type-pill.pure{background:#dff8e9;color:#299a60}

/* ===== timeline ===== */
.timeline-wrap{
  margin-top:18px;
  border:2px solid #bfeaf2;
  border-radius:18px;
  padding:14px;
  background:linear-gradient(180deg,#faffff,#eefdff);
  overflow-x:auto;
}
.timeline-axis{display:flex;justify-content:space-between;color:#7d9bad;font-size:10px;margin-left:140px}
.timeline-row{
  display:grid;
  grid-template-columns:130px minmax(700px,1fr);
  gap:10px;align-items:center;margin:8px 0;
}
.timeline-label{font-size:11px;font-weight:1000;color:#547991;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timeline-track{
  height:26px;
  background:repeating-linear-gradient(90deg,#edfaff 0,#edfaff calc(10% - 1px),#cfeff5 calc(10% - 1px),#cfeff5 10%);
  border-radius:999px;position:relative;overflow:hidden;border:1px solid #bee9f1;
}
.timeline-block{height:100%;position:absolute;border-radius:999px;opacity:.84;border-right:2px solid rgba(255,255,255,.7)}
.timeline-block.cute{background:linear-gradient(90deg,#ff9bb1,#ff779f)}
.timeline-block.happy{background:linear-gradient(90deg,#ffe280,#ffc954)}
.timeline-block.pure{background:linear-gradient(90deg,#8be3ad,#5ed793)}
.model-note{
  margin-top:12px;
  color:#547b92;
  background:#edfaff;
  border:1px solid #c4edf4;
  border-left:5px solid #2fcadd;
  border-radius:12px;
  padding:11px 13px;
  font-size:11px;line-height:1.75;
}

/* ===== tables ===== */
.table-wrap{overflow:auto;border:2px solid #c8edf4;border-radius:18px;background:#fff}
table{border-collapse:separate;border-spacing:0;width:100%;min-width:900px;background:#fff}
th,td{padding:10px 11px;border-bottom:1px solid #e0f3f7;text-align:left;font-size:11px;vertical-align:top;color:#4d7086}
th{
  position:sticky;top:0;
  background:linear-gradient(180deg,#e9fcff,#daf7fb);
  color:#3b7087;z-index:2;white-space:nowrap;font-weight:1000;
}
tr.clickable{cursor:pointer}
tr.clickable:hover td{background:#effcff}
.skill-cell{max-width:420px;color:#5d7c91;line-height:1.58}
.search-status{color:#7295a8;padding:10px 0;font-size:12px;font-weight:800}
.result-inline{
  border:2px solid #aee8f1;
  background:linear-gradient(180deg,#fff,#edfcff);
  border-radius:18px;padding:14px;margin-top:10px;
}
.result-inline strong{color:#12aeca}

/* ===== ownership/data ===== */
.filters{margin-bottom:14px}
.filters input{min-width:280px;flex:1}
.owned-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.owned-item{
  display:flex;gap:10px;align-items:flex-start;
  border:2px solid #d0eef4;
  border-radius:17px;
  background:linear-gradient(180deg,#fff,#f2fcfe);
  padding:12px;
  transition:.12s ease;
}
.owned-item:has(input:checked){
  border-color:#57d5e5;
  box-shadow:0 5px 14px rgba(31,188,214,.12);
  background:linear-gradient(180deg,#fff,#e7fbff);
}
.owned-item input{
  margin-top:3px;
  width:20px;height:20px;
  accent-color:#23c5dc;
}
.owned-meta{font-size:10px;color:#86a3b3;margin-top:3px}

/* ===== footer ===== */
footer{
  max-width:1500px;margin:0 auto;
  padding:10px 24px 36px;
  color:#87a5b6;font-size:10px;text-align:center;
}

/* ===== decorative page pattern ===== */
main:before{
  content:"";
  position:fixed;z-index:-1;
  inset:0;
  background-image:
    radial-gradient(circle at 20px 20px,rgba(46,202,222,.08) 0 2px,transparent 3px),
    radial-gradient(circle at 60px 55px,rgba(255,126,185,.05) 0 2px,transparent 3px);
  background-size:90px 90px,120px 120px;
}

/* ===== responsive ===== */
@media(max-width:1000px){
  .topbar{min-height:84px;padding:10px 18px}
  .top-badges{display:none}
  .menu-button{display:block}
  .tabs{top:84px;justify-content:flex-start;padding:9px 12px}
  .dream-hero{min-height:180px}
  .hero-inner{padding:30px 16px 46px}
  .grid.two{grid-template-columns:1fr}
  main{padding:14px}
  .member-selectors{grid-template-columns:1fr}
  .metrics,.board-summary{grid-template-columns:1fr 1fr}
  .board-allocations{grid-template-columns:1fr 1fr}
  .section-card{padding:15px}
  .section-title{margin:-15px -15px 16px;padding:14px 15px 13px}
  .timeline-row{grid-template-columns:100px minmax(600px,1fr)}
  .timeline-axis{margin-left:110px}
}
@media(max-width:560px){
  .brand-mark{width:48px;height:48px;border-radius:15px}
  .brand-wrap{min-width:0}
  .brand-hololive{font-size:12px}
  .brand-dreams{font-size:25px}
  .brand-sub{font-size:8px}
  .menu-button{width:48px;height:48px}
  .dream-hero{min-height:150px}
  .hero-title{font-size:43px}
  .hero-kicker{font-size:12px}
  .hero-ribbon{font-size:9px}
  .tabs{scrollbar-width:none}
  .tab{padding:9px 13px;font-size:12px}
  main{padding:10px}
  .card{border-radius:22px}
  .metrics,.board-summary{grid-template-columns:1fr 1fr}
  .metric{padding:12px}
  .metric strong{font-size:19px}
  .board-allocations{grid-template-columns:1fr 1fr}
  .button{font-size:12px;padding:9px 12px}
  h2{font-size:19px}
}


/* ===== metric help ===== */
.metric-label-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.metric-label-row > span{
  margin-bottom:6px;
}
.help-button{
  flex:0 0 auto;
  width:23px;
  height:23px;
  border-radius:50%;
  border:2px solid #8ee2ed;
  background:#ffffff;
  color:#1ab4cf;
  font-size:13px;
  font-weight:1000;
  line-height:1;
  display:grid;
  place-items:center;
  cursor:pointer;
  padding:0;
  box-shadow:0 2px 7px rgba(25,181,208,.12);
}
.help-button:hover{
  background:#e8fbff;
  border-color:#25c6db;
}
.help-button:active{transform:scale(.96)}

/* ===== help modal ===== */
.help-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:18px;
}
.help-modal.hidden{display:none}
.help-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(44,86,105,.35);
  backdrop-filter:blur(4px);
}
.help-modal-card{
  position:relative;
  z-index:2;
  width:min(620px,100%);
  max-height:min(80vh,760px);
  overflow:auto;
  background:#ffffff;
  border:3px solid #a9e9f2;
  border-radius:26px;
  box-shadow:0 25px 70px rgba(28,121,148,.28);
  padding:24px;
}
.help-modal-card h2{
  margin:4px 38px 16px 0;
  font-size:23px;
}
.help-modal-close{
  position:absolute;
  right:16px;
  top:14px;
  width:36px;
  height:36px;
  border-radius:50%;
  border:2px solid #baeaf1;
  background:#effcff;
  color:#2b9fba;
  font-size:24px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
}
.help-modal-body{
  color:#57788d;
  font-size:13px;
  line-height:1.85;
}
.help-modal-body p{margin:10px 0}
.formula-box{
  margin:12px 0;
  padding:13px 14px;
  border:2px solid #c8edf3;
  border-radius:15px;
  background:#f2fcfe;
}
.formula-box strong{
  display:block;
  margin-bottom:7px;
  color:#2c6d84;
  font-size:12px;
}
.formula-box code{
  display:block;
  white-space:normal;
  word-break:break-word;
  font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",sans-serif;
  font-weight:800;
  color:#35677d;
  font-size:12px;
  line-height:1.7;
}
body.modal-open{overflow:hidden}

@media(max-width:560px){
  .help-modal{padding:12px}
  .help-modal-card{padding:20px 16px;border-radius:22px}
  .help-modal-card h2{font-size:20px}
  .help-button{width:22px;height:22px;font-size:12px}
}


/* v0.1.7: result panel simplified to four key metrics */
.result-card .metrics{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
@media(max-width:560px){
  .result-card .metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* ===== v0.1.8 result layout ===== */
.result-metrics{
  display:grid;
  gap:16px;
}

.result-metrics .metric-main{
  min-height:210px;
  padding:24px 28px 28px;
  border:2px solid #40cfe1;
  background:#ffffff;
  box-shadow:0 10px 28px rgba(31,177,207,.12);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.result-metrics .metric-main .metric-label-row > span{
  font-size:16px;
  color:#315d75;
  font-weight:1000;
}

.result-metrics .metric-main strong{
  display:block;
  margin-top:28px;
  font-size:clamp(34px,5vw,56px);
  line-height:1;
  letter-spacing:-.025em;
  color:#315d75;
  font-weight:800;
}

.metric-secondary-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.metric-secondary-row .metric{
  min-height:145px;
  padding:18px 20px 20px;
  background:#ffffff;
  border:2px solid #bcebf2;
  box-shadow:0 7px 18px rgba(31,177,207,.08);
}

.metric-secondary-row .metric .metric-label-row > span{
  font-size:13px;
  font-weight:1000;
  color:#4b7288;
}

.metric-secondary-row .metric strong{
  display:block;
  margin-top:22px;
  font-size:clamp(22px,3vw,32px);
  line-height:1.05;
  color:#315d75;
  font-weight:800;
  letter-spacing:-.015em;
}

/* Keep the main result visually dominant */
.result-card .section-title{
  margin-bottom:20px;
}

@media(max-width:760px){
  .result-metrics .metric-main{
    min-height:170px;
    padding:20px 18px;
  }

  .result-metrics .metric-main strong{
    margin-top:22px;
    font-size:clamp(32px,10vw,50px);
  }

  .metric-secondary-row{
    grid-template-columns:1fr;
    gap:10px;
  }

  .metric-secondary-row .metric{
    min-height:105px;
  }

  .metric-secondary-row .metric strong{
    margin-top:14px;
    font-size:26px;
  }
}


/* ===== v0.1.10: unofficial badge only ===== */
.unofficial-badge{
  padding:8px 14px;
  border:2px solid #9fe5ef;
  background:#ffffff;
  color:#168dac;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
}


/* ===== v0.1.13: board help button ===== */
.board-title-line{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.board-title-line h2{
  margin:2px 0 0;
}
.board-help-button{
  width:26px;
  height:26px;
  font-size:14px;
  margin-top:2px;
}

@media(max-width:560px){
  .board-title-line{
    gap:7px;
  }
  .board-help-button{
    width:24px;
    height:24px;
    font-size:13px;
  }
}


/* ===== v0.1.14: search mode status ===== */
#ownedRankingStatus,
#ownedSearchStatus{
  font-weight:800;
  color:#5f8da3;
}


/* ===== v0.1.15: preset comparison ===== */
.preset-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.preset-slot{
  min-width:0;
  padding:15px;
  border:2px solid #c9edf4;
  border-radius:18px;
  background:linear-gradient(180deg,#fff,#f3fcfe);
}
.preset-slot.best{
  border-color:#35cada;
  box-shadow:0 5px 16px rgba(31,188,214,.13);
}
.preset-slot.empty{
  display:flex;
  min-height:210px;
  flex-direction:column;
  justify-content:space-between;
}
.preset-slot-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:#436c83;
}
.preset-best-label,
.preset-empty-label{
  flex:0 0 auto;
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:1000;
}
.preset-best-label{
  color:#0c94b1;
  background:#dffaff;
  border:1px solid #8ce5ef;
}
.preset-empty-label{
  color:#879fac;
  background:#f3f9fa;
  border:1px solid #d8edf1;
}
.preset-score{
  margin-top:14px;
  color:#315d75;
  font-size:30px;
  font-weight:800;
  letter-spacing:-.025em;
}
.preset-duration{
  color:#1aabc5;
  font-size:11px;
  font-weight:1000;
  margin-top:2px;
}
.preset-leader{
  margin-top:12px;
  font-size:12px;
  color:#52768c;
}
.preset-members{
  margin-top:7px;
  color:#7896a8;
  font-size:10px;
  line-height:1.65;
  min-height:50px;
}
.preset-diff{
  margin-top:7px;
  font-size:10px;
  color:#8da4b1;
}
.preset-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:12px;
}
.preset-actions .button{
  padding:7px 10px;
  font-size:10px;
}
.preset-delete{
  color:#b45b6e;
  border-color:#f2c9d2;
  background:#fff7f9;
}
.preset-empty-message{
  color:#819dab;
  font-size:11px;
  line-height:1.65;
  margin:14px 0;
}
.preset-badge{font-size:11px}

/* ===== v0.1.15: ownership backup ===== */
.owned-backup-note{
  margin:-3px 0 10px;
  padding:9px 11px;
  border-radius:12px;
  border:1px solid #caedf3;
  background:#f1fcfe;
  color:#6f91a4;
  font-size:10px;
  line-height:1.65;
}

@media(max-width:900px){
  .preset-grid{grid-template-columns:1fr}
  .preset-slot.empty{min-height:150px}
}


/* ===== v0.1.17: smartphone layout cleanup ===== */

/* Prevent badges/type labels/Japanese UI labels from being broken one character at a time. */
.type-pill,
.badge,
.button,
.tab,
.compact,
.field > span,
.metric span,
.preset-best-label,
.preset-empty-label{
  word-break:keep-all;
  overflow-wrap:normal;
  writing-mode:horizontal-tb;
}

/* Type pills must always remain horizontal. */
.type-pill{
  white-space:nowrap;
  flex-wrap:nowrap;
  min-width:max-content;
  line-height:1.25;
}

/* Tables should scroll horizontally rather than crush columns. */
.table-wrap{
  overflow-x:auto;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
}
.table-wrap table{
  table-layout:auto;
}
#rankingTable table{
  min-width:860px;
}
#rankingTable th:nth-child(1),
#rankingTable td:nth-child(1){
  width:48px;
  min-width:48px;
}
#rankingTable th:nth-child(2),
#rankingTable td:nth-child(2){
  min-width:180px;
  white-space:nowrap;
}
#rankingTable th:nth-child(3),
#rankingTable td:nth-child(3){
  min-width:470px;
  white-space:nowrap;
}
#rankingTable th:nth-child(4),
#rankingTable td:nth-child(4){
  min-width:120px;
  white-space:nowrap;
}

#dataTable table{
  min-width:1320px;
}
#dataTable th:nth-child(1),
#dataTable td:nth-child(1){
  min-width:150px;
}
#dataTable th:nth-child(2),
#dataTable td:nth-child(2){
  width:92px;
  min-width:92px;
  white-space:nowrap;
}
#dataTable th:nth-child(3),
#dataTable td:nth-child(3),
#dataTable th:nth-child(4),
#dataTable td:nth-child(4),
#dataTable th:nth-child(5),
#dataTable td:nth-child(5){
  width:112px;
  min-width:112px;
  white-space:nowrap;
}

/* Keep Japanese headings readable. */
.section-title h2{
  line-height:1.3;
  word-break:normal;
  overflow-wrap:normal;
}

@media(max-width:760px){
  /* Put heading and its controls on separate rows on phones. */
  .section-title{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:12px;
  }
  .section-title > div:first-child{
    width:100%;
    min-width:0;
  }
  .section-title > .row,
  .section-title > .rank-controls,
  .section-title > .button,
  .section-title > .badge{
    align-self:stretch;
  }

  /* Simulator duration selector: horizontal label, no vertical "曲時間". */
  .section-title .compact{
    width:100%;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    white-space:nowrap;
  }
  .section-title .compact select{
    width:min(180px,52vw);
    flex:0 0 auto;
  }

  /* Ranking controls become two clean full-width selectors. */
  .rank-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
    gap:8px;
  }
  .rank-controls select{
    min-width:0;
  }

  /* Owned-management actions can use the full width without crushing the title. */
  #tab-owned .section-title .row{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  #tab-owned .section-title .row .button{
    width:100%;
    min-width:0;
    white-space:normal;
    line-height:1.35;
  }
  #tab-owned #ownedCountBadge{
    justify-self:start;
    width:max-content;
  }

  /* Other section header buttons become comfortable full-width controls. */
  #searchOwnedBest,
  #optimizeBoard{
    width:100%;
  }

  /* Avoid character-by-character wrapping in board title. */
  .board-title-line{
    align-items:flex-start;
  }
  .board-title-line h2{
    flex:1 1 auto;
    min-width:0;
  }

  /* Mobile table typography: smaller but not compressed. */
  .table-wrap th,
  .table-wrap td{
    font-size:10.5px;
    padding:10px 10px;
  }

  /* Give a subtle cue that wide tables can be swiped. */
  #rankingTable,
  #dataTable,
  #memberDetailTable{
    background:
      linear-gradient(to right,#fff 30%,rgba(255,255,255,0)),
      linear-gradient(to left,#fff 30%,rgba(255,255,255,0)),
      linear-gradient(to right,rgba(33,189,224,.14),rgba(255,255,255,0)),
      linear-gradient(to left,rgba(33,189,224,.14),rgba(255,255,255,0));
    background-position:left center,right center,left center,right center;
    background-repeat:no-repeat;
    background-size:34px 100%,34px 100%,12px 100%,12px 100%;
    background-attachment:local,local,scroll,scroll;
  }
}

@media(max-width:480px){
  /* On narrower phones, owned action buttons stack for stable text. */
  #tab-owned .section-title .row{
    grid-template-columns:1fr;
  }
  #tab-owned #ownedCountBadge{
    margin-top:2px;
  }

  .rank-controls{
    grid-template-columns:1fr;
  }

  .quick-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .quick-actions .button{
    width:100%;
  }

  /* Preserve readable option text in simulator selects. */
  select{
    font-size:14px;
  }
}


/* ===== v0.1.18: strongest-search standalone tab ===== */
.title-with-help{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}
.title-with-help h2{
  margin:0;
}
#tab-ownedsearch .section-card{
  margin-bottom:0;
}
#tab-ownedsearch .section-title{
  align-items:center;
}
@media(max-width:760px){
  #tab-ownedsearch .section-title{
    align-items:stretch;
  }
  #tab-ownedsearch .title-with-help{
    justify-content:flex-start;
  }
}


/* ===== v0.1.19: remove hamburger + arbitrary strongest-search duration ===== */
.top-header{
  grid-template-columns:auto 1fr;
}
.top-badges{
  justify-self:end;
}

/* Search controls */
.owned-search-controls{
  display:flex;
  align-items:flex-end;
  gap:10px;
}
.owned-search-duration{
  display:flex;
  flex-direction:column;
  gap:5px;
  color:#5b8499;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.duration-input-wrap{
  display:flex;
  align-items:center;
  gap:6px;
}
#ownedSearchDuration{
  width:94px;
  min-width:94px;
  height:42px;
  padding:0 12px;
  border:2px solid #bfeaf2;
  border-radius:14px;
  background:#fff;
  color:#315f76;
  font:inherit;
  font-size:15px;
  font-weight:800;
  outline:none;
}
#ownedSearchDuration:focus{
  border-color:#37c8db;
  box-shadow:0 0 0 3px rgba(55,200,219,.11);
}
.duration-unit{
  color:#6c93a6;
  font-size:12px;
  font-weight:900;
}

@media(max-width:760px){
  .owned-search-controls{
    width:100%;
    display:grid;
    grid-template-columns:140px 1fr;
    align-items:end;
    gap:8px;
  }
  .owned-search-duration{
    width:100%;
  }
  .duration-input-wrap{
    width:100%;
  }
  #ownedSearchDuration{
    width:100%;
    min-width:0;
  }
  #tab-ownedsearch #searchOwnedBest{
    width:100%;
    min-height:42px;
  }
}

@media(max-width:430px){
  .owned-search-controls{
    grid-template-columns:1fr;
  }
}


/* ===== v0.1.21: SEO / about section ===== */
.about-card{
  margin-top:18px;
}
.about-text{
  max-width:980px;
  line-height:1.9;
}
