:root{
  --bg:#fffef9;
  --paper:#ffffff;
  --ink:#18222f;
  --muted:#5a6475;
  --border:#e6e7ea;
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --azure:#e6f2ff;
  --greige:#f6f7f9;
  --cyan:#e7fbff;
  --sepia:#fff1e0;
  --article:#ffeaa7;
  --stem:#eef2ff;
  --ending:#d1fae5;
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(700px 400px at 0% 0%, #fffbd6 0%, transparent 60%),
    radial-gradient(700px 400px at 100% 0%, #e8fbff 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #fff0da 0%, transparent 55%),
    var(--bg);
  color:var(--ink);
  font:16px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  padding:12px;
  display:block;
}

.wrap{
  width:100%;
  max-width:720px;            /* phone-first */
  margin:0 auto;
  background:var(--paper);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.head{padding:12px}
.title{font-weight:800; font-size:20px; line-height:1.2; margin:0}
.subtitle{color:var(--muted); font-size:12px; margin:.25rem 0 0}

.card.main{padding:12px}

.table-shell{
  overflow:auto;              /* horizontal scroll if needed */
  border:1px solid var(--border);
  border-radius:12px;
}
table{width:100%; border-collapse:separate; border-spacing:0; font-variant-numeric:tabular-nums}
thead th{
  position:sticky; top:0; z-index:1;
  background:linear-gradient(180deg,#f8fbff 0%,#f2f6ff 100%);
  text-align:left; padding:8px 10px; border-bottom:1px solid var(--border);
  font-size:12px; text-transform:uppercase; letter-spacing:.25px;
}
td,th{padding:8px 10px}

/* Row tints */
tbody tr:nth-child(1) td{background:linear-gradient(90deg, var(--azure), transparent 65%)}
tbody tr:nth-child(2) td{background:linear-gradient(90deg, var(--greige), transparent 65%)}
tbody tr:nth-child(3) td{background:linear-gradient(90deg, var(--cyan), transparent 65%)}
tbody tr:nth-child(4) td{background:linear-gradient(90deg, var(--sepia), transparent 65%)}

/* Narrower first column, no wrap */
.case{
  font-weight:800;
  min-width:88px;            /* tighter for phones */
  width:1%;
  white-space:nowrap;
  font-size:14px;
}

.form{
  font-weight:800;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
}
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding:2px 8px; border-radius:999px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
  line-height:1.2;
}
.article{background:var(--article)}
.stem{background:var(--stem); border-radius:6px}
.ending{background:var(--ending); border-radius:6px; border:1px dashed rgba(0,0,0,.08)}

.legend{
  display:flex; gap:8px; flex-wrap:wrap;
  margin-top:10px; color:var(--muted); font-size:12px
}
.dot{
  width:10px; height:10px; border-radius:2px; display:inline-block; margin-right:6px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08)
}
.badge{
  display:inline-block; padding:4px 8px; border-radius:999px; font-weight:700;
  background:#f1f5f9; border:1px solid var(--border); margin-left:6px
}
.hint{margin-top:10px; color:var(--muted); font-size:12px}

/* ≥768px: widen, airier spacing */
@media (min-width:768px){
  body{padding:18px}
  .wrap{max-width:980px}
  .head{padding:18px}
  .title{font-size:24px}
  .subtitle{font-size:13px}
  .card.main{padding:18px}
  thead th, td, th{padding:12px 14px}
  .case{min-width:112px; font-size:15px}
}
