/* Yin-Yang WebApp — clean, static, no deps */
:root{
  --bg:#10182c;
  --card:#17213a;
  --card2:#151f36;
  --text:#f2f5ff;
  --muted:#c3cbe8;
  --line:#334066;
  --accent:#7aa2ff;
  --accent2:#9cffc8;
  --warn:#ffd37a;
  --bad:#ff7a90;
  --good:#7affc8;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 30% 0%, #15204a 0%, var(--bg) 50%) fixed;
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.muted{color:var(--muted)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
.wrap{max-width:1180px;margin:0 auto;padding:18px 18px 40px}
.topbar{
  position:sticky;top:0;z-index:5;
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.07);
  background: rgba(16,24,44,.78);
  backdrop-filter: blur(10px);
}
.brand{display:flex;gap:12px;align-items:center}
.logo{
  width:42px;height:42px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(122,162,255,.25), rgba(156,255,200,.18));
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  font-size:20px;
}
.title{font-weight:800;letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted);margin-top:2px}
.controls{display:flex;gap:10px;align-items:center}

.tabs{
  display:flex;gap:10px;flex-wrap:wrap;
  padding:14px 0 10px;
}
.tab{
  border:1px solid rgba(255,255,255,.09);
  background: rgba(26,34,58,.62);
  color:var(--text);
  padding:10px 12px;border-radius:999px;
  cursor:pointer;
}
.tab.active{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 3px rgba(122,162,255,.18);
}

.view{display:none}
.view.active{display:block}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid2{grid-template-columns:1fr}
}

.card{
  background: linear-gradient(180deg, rgba(26,34,58,.92), rgba(18,24,44,.92));
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.card-hd{margin-bottom:12px}
.card h2{margin:0 0 6px;font-size:18px}
.h3{margin:10px 0 8px;font-size:14px;color:#dfe5ff}
.divider{height:1px;background:rgba(255,255,255,.08);margin:14px 0}

.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.row.gap{gap:12px}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;
  background: rgba(122,162,255,.12);
  border:1px solid rgba(122,162,255,.25);
  color:#dfe7ff;
  font-size:12px;
}
.note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.7);
  color: var(--muted);
  font-size:13px;
}

.chip{
  display:inline-flex;align-items:center;justify-content:center;
  padding:8px 10px;border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(26,34,58,.55);
  cursor:pointer;
  font-size:13px;
}
.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(122,162,255,.16);
  color:var(--text);
  padding:10px 12px;border-radius:14px;
  cursor:pointer;
}
.btn.ghost{
  background: transparent;
}
.kbd{
  padding:1px 6px;border-radius:6px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  font-size:12px;
}

.taiji-wrap{display:grid;grid-template-columns: 240px 1fr;gap:14px;align-items:center}
@media (max-width: 560px){
  .taiji-wrap{grid-template-columns:1fr;justify-items:center}
}
.taiji{width:240px;height:240px}
.ring{fill:rgba(255,255,255,.03)}
.outline{fill:none;stroke:rgba(255,255,255,.34);stroke-width:2}
.yin{fill:#0f1320}
.yang{fill:#e8ecff}
.yinDot{fill:#0f1320}
.yangDot{fill:#e8ecff}

.slider input[type="range"]{width:100%}
.label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:var(--muted)}
.callouts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
@media(max-width:560px){.callouts{grid-template-columns:1fr}}
.callout{
  background: rgba(16,20,34,.65);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding:12px;
}
.callout-title{font-weight:700;margin-bottom:6px}

.list{margin:8px 0 0 18px;color:var(--muted);line-height:1.55}
.list b{color:#e8ecff}
.mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:560px){.mini-grid{grid-template-columns:1fr}}
.mini{
  background: rgba(16,20,34,.65);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding:12px;
}
.mini-title{font-weight:800}
.mini-body{color:var(--muted);margin-top:6px;line-height:1.45}

.field{display:flex;flex-direction:column;gap:6px;min-width:180px}
.field-label{font-size:12px;color:var(--muted)}
select, .search{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(20,28,52,.70);
  color:var(--text);
  padding:10px 12px;border-radius:14px;
  outline:none;
}
.search{flex:1;min-width:240px}
.layer-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
@media(max-width:560px){.layer-cards{grid-template-columns:1fr}}
.lcard{
  border-radius:16px;padding:12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.65);
}
.lcard .t{font-weight:900;margin-bottom:6px}
.lcard .b{color:var(--muted);line-height:1.5}
.lcard.y{box-shadow: 0 0 0 2px rgba(156,255,200,.08) inset}
.lcard.n{box-shadow: 0 0 0 2px rgba(122,162,255,.08) inset}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips .chip.active{
  border-color: rgba(156,255,200,.55);
  box-shadow: 0 0 0 3px rgba(156,255,200,.16);
}
.detail{line-height:1.55}

.panel{
  margin-top:12px;
  background: rgba(16,20,34,.65);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding:12px;
}
.panel h3{margin:0 0 6px;font-size:15px}
.panel ul{margin:8px 0 0 18px;color:var(--muted);line-height:1.55}

.tbl{width:100%;border-collapse:collapse;margin-top:10px}
.tbl th,.tbl td{
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:10px 8px;
  vertical-align:top;
  text-align:left;
}
.tbl th{color:#dfe5ff;font-size:12px}
.tbl td{color:var(--muted);font-size:13px}

.meter{
  position:relative;
  height:16px;border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;margin-top:10px;
}
.meter-bar{
  height:100%;
  background: linear-gradient(90deg, rgba(156,255,200,.18), rgba(122,162,255,.22));
}
.meter-th{
  position:absolute;top:-5px;
  width:2px;height:26px;
  background: rgba(255,211,122,.9);
  box-shadow: 0 0 0 3px rgba(255,211,122,.12);
}

.quote{
  background: rgba(16,20,34,.65);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding:12px;
  color:var(--muted);
  line-height:1.6;
}
.casebox{
  margin-top:10px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.65);
  padding:12px;
}
.result{
  margin-top:10px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(20,28,52,.70);
  padding:12px;
  color:var(--muted);
  line-height:1.55;
}
.result.good{border-color: rgba(122,255,200,.35)}
.result.bad{border-color: rgba(255,122,144,.35)}

.accordion .acc{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.65);
  border-radius: 16px;
  margin:10px 0;
  overflow:hidden;
}
.acc button{
  width:100%;
  text-align:left;
  border:0;
  background: transparent;
  color:var(--text);
  padding:12px 12px;
  cursor:pointer;
  font-weight:800;
  display:flex;justify-content:space-between;align-items:center;
}
.acc .body{padding:0 12px 12px;color:var(--muted);line-height:1.55;display:none}
.acc.open .body{display:block}
.acc .chev{opacity:.7}

.glossary .item{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.65);
  border-radius: 16px;
  padding:12px;
  margin:10px 0;
}
.item .k{font-weight:900}
.item .d{color:var(--muted);margin-top:6px;line-height:1.55}
.item .en{margin-top:6px;color:#bfc7f0}

.bridgebox{
  margin-top:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(16,20,34,.65);
  padding:12px;
  color:var(--muted);
  line-height:1.6;
}

.footer{padding:20px 0 0;text-align:center}

/* dialog */
dialog{
  border:0;
  background: transparent;
}
dialog::backdrop{background: rgba(0,0,0,.6)}
.dlg{
  width:min(720px, calc(100vw - 30px));
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(18,22,35,.92);
  box-shadow: var(--shadow);
}
.dlg-hd{display:flex;justify-content:space-between;align-items:center;padding:12px 12px;border-bottom:1px solid rgba(255,255,255,.08)}
.dlg-title{font-weight:900}
.dlg-bd{padding:12px}
.export{margin-top:10px;white-space:pre-wrap}


/* Yin/Yang waxing-waning bars */
.yybars{display:flex;gap:12px;align-items:flex-end;margin:6px 0 10px}
.yycol{flex:1;min-width:110px}
.yyname{font-size:12px;color:var(--muted);margin-bottom:6px}
.yytrack{
  height:86px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  overflow:hidden;
  display:flex;
  align-items:flex-end;
}
.yyfill{
  width:100%;
  height:50%;
  background: linear-gradient(180deg, rgba(156,255,200,.22), rgba(122,162,255,.20));
}
.yypct{margin-top:6px;color:#dfe5ff;font-size:12px}

/* Make top-right chips more legible */
.controls .chip, .controls a.chip{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}
.controls .chip:hover, .controls a.chip:hover{
  background: rgba(255,255,255,.14);
}
