/* Practice table picker + Profile, translated from Paper get_jsx
   (03 ฝึกทีละแม่ · เลือกแม่ · Final · Desktop/Mobile, โปรไฟล์ · Desktop/Mobile).
   Load after final.css. Desktop is the default; phone overrides at <=760px. */

/* ============ PRACTICE · page ============ */
#app.f-page:has(> .f-practice){max-width:1440px;padding:40px 64px 40px;gap:24px}
#app.f-page:has(> .f-practice) .f-page-title.f-page-title{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
#app.f-page:has(> .f-practice) .f-page-title>div{display:flex;flex-direction:column;gap:4px}
#app.f-page:has(> .f-practice) .f-page-title h1{margin:0;font:700 52px/72px IBM,sans-serif;letter-spacing:0;color:#273740}
#app.f-page:has(> .f-practice) .f-page-title .f-note.hand-note{margin:0;max-width:none;font:400 17px/22px Mali,IBM,sans-serif;letter-spacing:0;color:#5f7179}
/* Desktop Paper shows the mascot in the summary card, not the title row */
@media (min-width:761px){
  #app.f-page:has(> .f-practice) .f-page-title .f-mascot.f-mascot{display:none}
}

/* ---- picker card ---- */
#app .f-practice .table-picker.f-card{background:#fff;border:1px solid #e3e7ea;border-radius:28px;box-shadow:0 5px 0 #dfe3e8;padding:26px 28px 28px;gap:18px;min-width:0}
#app .f-practice .picker-toolbar.f-card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;margin:0;padding:0}
#app .f-practice .picker-toolbar h2{margin:0;font:700 24px/30px IBM,sans-serif;letter-spacing:0;color:#273740}
#app .f-practice .picker-toolbar .f-head-side{display:flex;align-items:center;gap:16px}
#app .f-practice .f-pill-btn.f-pill-btn{border:0;border-radius:14px;padding:9px 16px;background:#fff1c2;box-shadow:0 3px 0 #ead08a;font:700 15px/18px IBM,sans-serif;color:#7a5b00;letter-spacing:0}
#app .f-practice .picker-toolbar .f-link.f-link{font:600 15px/18px IBM,sans-serif;color:#5f7179}

/* fieldsets: legend becomes a normal flex item so gaps match Paper */
#app .f-practice fieldset{display:flex;flex-direction:column;gap:18px;min-width:0;margin:0;padding:0;border:0}
#app .f-practice fieldset+fieldset{margin-top:6px}
#app .f-practice fieldset legend{float:left;width:100%;margin:0;padding:0;font:700 15px/18px IBM,sans-serif;letter-spacing:0;color:#5f7179}
#app .f-practice .f-chips.six{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}

/* ---- chips ---- */
#app .f-practice .f-chip.f-chip.table-chip{height:72px;min-height:0;padding:0;border:0;border-radius:18px;background:var(--heat-bg);color:var(--heat-fg);box-shadow:inset 0 -4px 0 #0000001f;font:700 26px/32px IBM,sans-serif;letter-spacing:0;width:auto;transform:none}
#app .f-practice .f-chip.f-chip.table-chip:hover{transform:translateY(-2px)}
#app .f-practice .f-chip.f-chip.table-chip[style^="--heat-bg:#eceeec"]{background:#e9ece9;color:#9aa5aa}
#app .f-practice .f-chip.f-chip.table-chip[aria-pressed="true"],#app .f-practice .f-chip.f-chip.table-chip.selected{border:0;box-shadow:0 0 0 3px #fffaf1,0 0 0 6px #273740}
#app .f-practice .f-chip.f-chip.table-chip[aria-pressed="true"]::after,#app .f-practice .f-chip.f-chip.table-chip.selected::after{content:"";position:absolute;right:-8px;top:-8px;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:2px solid #fffaf1;background:#273740 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 L5 8.5 L9.5 3.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat;font-size:0;line-height:0;color:transparent}

/* ---- legend row ---- */
#app .f-practice .f-legend-row.picker-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:nowrap;width:100%;margin:0;padding:14px 0 0;border-top:1px solid #eef1f3;font:400 13px/16px IBM,sans-serif;color:#5f7179}
#app .f-practice .picker-note .heat-legend{display:flex;align-items:center;gap:6px;width:auto;margin:0;flex-wrap:nowrap;font:400 13px/16px IBM,sans-serif;color:#5f7179}
#app .f-practice .picker-note .heat-legend .heat-scale{display:block;flex-shrink:0;width:114px;height:12px;border:0;border-radius:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='114' height='12'%3E%3Crect width='18' height='12' rx='4' fill='%23C6392F'/%3E%3Crect x='24' width='18' height='12' rx='4' fill='%23DDA66E'/%3E%3Crect x='48' width='18' height='12' rx='4' fill='%23ECE6AC'/%3E%3Crect x='72' width='18' height='12' rx='4' fill='%2388DD6E'/%3E%3Crect x='96' width='18' height='12' rx='4' fill='%232FC64D'/%3E%3C/svg%3E") 0 0/114px 12px no-repeat}
#app .f-practice .picker-note .heat-legend .heat-none{display:block;flex-shrink:0;width:18px;height:12px;margin-left:8px;border:0;border-radius:4px;background:#e9ece9}

/* ---- summary card ---- */
#app .f-practice .f-summary.f-summary{display:flex;flex-direction:column;align-items:stretch;gap:16px;padding:24px;background:#e8f1fb;border:1px solid #cfe0f3;border-radius:28px;box-shadow:0 5px 0 #c6d9ee}
#app .f-practice .f-summary .f-summary-label{display:flex;align-items:center;font:600 15px/18px IBM,sans-serif;letter-spacing:0;color:#5f7179}
@media (min-width:761px){
  /* Paper: label row = text + mascot 86x68 (contain) on the right */
  #app .f-practice .f-summary .f-summary-label{min-height:68px;padding-right:96px;background:url(assets/calculator.png) right center/86px auto no-repeat}
}
#app .f-practice .f-summary.f-summary h2{margin:0;font:700 48px/56px IBM,sans-serif;letter-spacing:0;color:#1e61af}
#app .f-practice .f-summary.f-summary h2.empty{font-size:22px;line-height:28px;color:#5f7179}
#app .f-practice .f-summary .f-pills{display:flex;flex-wrap:wrap;gap:8px}
#app .f-practice .f-summary .f-pills span{padding:5px 12px;border-radius:999px;background:#fff;font:600 14px/18px IBM,sans-serif;color:#273740}
#app .f-practice .f-summary .f-sample{display:flex;flex-direction:column;gap:2px;padding:12px 16px;border-radius:18px;background:#232528}
#app .f-practice .f-summary .f-sample small{font:600 12px/16px IBM,sans-serif;color:#a9b9cf}
#app .f-practice .f-summary .f-sample b{font:700 36px/44px IBM,sans-serif;letter-spacing:0;color:#fff}
#app .f-practice .f-summary .f-start.f-start{height:68px;min-height:0;width:100%;padding:0;border-radius:22px;background:#ffc83d;box-shadow:0 6px 0 #c99516;font:700 22px/28px IBM,sans-serif;letter-spacing:0;color:#273740}
#app .f-practice .f-summary .f-start.f-start:active{box-shadow:0 1px 0 #c99516}
#app .f-practice .f-summary .f-start.f-start:disabled{background:#d5d9de;box-shadow:0 6px 0 #b5bac1;color:#7c8791}
#app .f-practice .f-summary .f-note{align-self:center;margin:0;text-align:center;font:400 14px/18px Mali,IBM,sans-serif;color:#5f7179}

/* ============ PROFILE ============ */
#app.f-page.f-profile{max-width:1440px;padding:40px 80px 56px;gap:20px}
#app.f-profile .f-page-title.f-page-title{display:flex;align-items:center;justify-content:flex-start;gap:14px}
#app.f-profile .f-page-title .f-mascot.f-mascot{order:-1;width:44px;height:52px}
#app.f-profile .f-page-title>div{display:flex;flex-direction:column;gap:0}
#app.f-profile .f-page-title h1{margin:0;font:700 34px/44px IBM,sans-serif;letter-spacing:0;color:#273740}
#app.f-profile .f-page-title .f-note.hand-note{margin:0;max-width:none;font:400 14px/18px IBM,sans-serif;letter-spacing:0;color:#5f7179}

#app.f-profile .f-card{background:#fff;border:1px solid #e3e7ea;border-radius:22px;box-shadow:0 4px 0 #dfe3e8;padding:22px 24px;gap:14px;min-width:0;margin:0}
#app.f-profile .f-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:nowrap;width:100%}
#app.f-profile .f-card-head h2{margin:0;font:700 20px/24px IBM,sans-serif;letter-spacing:0;color:#273740}
#app.f-profile .f-card-head .f-note{margin:0;font:400 14px/18px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-two{gap:20px;align-items:stretch}
@media (min-width:1181px){#app.f-profile .f-two{grid-template-columns:minmax(0,1fr) 568px}}

/* overview */
#app.f-profile .f-stat-grid{gap:12px}
#app.f-profile .f-stat{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border-radius:16px;background:#f7f8f6}
#app.f-profile .f-stat small{font:400 13px/16px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-stat b{font:700 30px/38px IBM,sans-serif;letter-spacing:0;color:#273740}
#app.f-profile .f-stat b span{margin-left:4px;font:600 17px/22px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-today{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0;font:400 15px/18px IBM,sans-serif;color:#273740}
#app.f-profile .f-today span{padding:3px 10px;border-radius:999px;background:#ffe59a;font:700 13px/16px IBM,sans-serif;color:#7a5b00}

/* mastery tiles */
#app.f-profile .f-chips.six.big{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
#app.f-profile .f-chips.big .f-chip.f-chip{height:72px;min-height:0;padding:0;border:0;border-radius:16px;background:var(--heat-bg);color:var(--heat-fg);box-shadow:inset 0 -3px 0 #0000001a;cursor:default;transform:none}
#app.f-profile .f-chips.big .f-chip.f-chip[style^="--heat-bg:#eceeec"]{background:#dfe3e7;color:#8a979e}
#app.f-profile .f-chips.big .f-chip.f-chip b{font:700 28px/32px IBM,sans-serif;letter-spacing:0;color:inherit}
#app.f-profile .f-chips.big .f-chip.f-chip small{font:600 12px/16px IBM,sans-serif;color:inherit;opacity:.85}
#app.f-profile .f-legend-row{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;margin:0;padding:0;border:0}
#app.f-profile .f-legend-row .heat-legend{display:flex;align-items:center;flex-wrap:wrap;gap:8px;width:auto;margin:0;font:400 13px/16px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-legend-row .heat-legend .heat-scale{display:block;flex-shrink:0;width:172px;height:12px;border:0;border-radius:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='172' height='12'%3E%3Crect width='22' height='12' rx='4' fill='%23C6392F'/%3E%3Crect x='30' width='22' height='12' rx='4' fill='%23DDA66E'/%3E%3Crect x='60' width='22' height='12' rx='4' fill='%23ECE6AC'/%3E%3Crect x='90' width='22' height='12' rx='4' fill='%23D5ECAC'/%3E%3Crect x='120' width='22' height='12' rx='4' fill='%2388DD6E'/%3E%3Crect x='150' width='22' height='12' rx='4' fill='%232FC64D'/%3E%3C/svg%3E") 0 0/172px 12px no-repeat}
#app.f-profile .f-legend-row .heat-legend .heat-none{display:block;flex-shrink:0;width:22px;height:12px;margin-left:10px;border:0;border-radius:4px;background:#dfe3e7}
#app.f-profile .f-start.f-start.small{align-self:flex-start;width:auto;height:46px;min-height:0;padding:0 22px;border-radius:16px;background:#ffc83d;box-shadow:0 4px 0 #c99516;font:700 16px/20px IBM,sans-serif;letter-spacing:0;color:#273740}
#app.f-profile .f-start.f-start.small:active{box-shadow:0 1px 0 #c99516}

/* sprint trend */
#app.f-profile .f-trend{display:block;width:100%;max-width:520px;height:auto;font:400 11px IBM,sans-serif;fill:#8a979e}
#app.f-profile .f-trend-note{margin:0;font:400 15px/18px IBM,sans-serif;color:#273740}
#app.f-profile .f-trend-note b{font-weight:700}
#app.f-profile .f-trend-note b.up{color:#1f9d55}

/* calendar */
#app.f-profile .f-calendar{display:flex;gap:4px}
#app.f-profile .f-calendar div{display:flex;flex-direction:column;gap:4px}
#app.f-profile .f-calendar i{display:block;width:16px;height:16px;border-radius:1.5px;background:#eceff1}
#app.f-profile .f-calendar i.future{background:transparent}
#app.f-profile .f-cal-legend{display:flex;align-items:center;gap:6px;font:400 13px/16px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-cal-legend span:first-child{margin-right:4px}
#app.f-profile .f-cal-legend span:last-child{margin-left:4px}
#app.f-profile .f-cal-legend i{display:block;flex-shrink:0;width:12px;height:12px;border-radius:3px;background:#eceff1}

/* per-mode stats */
#app.f-profile .f-card:has(.f-mode-stat){gap:12px}
#app.f-profile .f-mode-stat{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-radius:14px;background:#f7f8f6}
#app.f-profile .f-mode-stat>span:first-child{font:600 16px/20px IBM,sans-serif;color:#273740}
#app.f-profile .f-mode-stat>span:last-child{font:400 15px/18px IBM,sans-serif;color:#5f7179}
#app.f-profile .f-mode-stat b{font-weight:700;color:#273740}

/* ============ PHONE ============ */
@media (max-width:760px){
  /* practice page */
  #app.f-page:has(> .f-practice){padding:20px 16px 24px;gap:14px}
  #app.f-page:has(> .f-practice) .f-page-title.f-page-title{align-items:center}
  #app.f-page:has(> .f-practice) .f-page-title>div{gap:2px}
  #app.f-page:has(> .f-practice) .f-page-title h1{font-size:34px;line-height:48px;max-width:none}
  #app.f-page:has(> .f-practice) .f-page-title .f-note.hand-note{font-size:14px;line-height:18px}
  #app.f-page:has(> .f-practice) .f-page-title .f-mascot.f-mascot{display:block;width:84px;height:66px}

  #app .f-practice.f-practice{display:flex;flex-direction:column;align-items:stretch;gap:16px;position:relative}
  #app .f-practice.f-practice:has(.f-pill-btn){padding-top:56px}

  /* picker card: no title; weak shortcut becomes the yellow bar above the card; clear link sits on the first legend row */
  #app .f-practice .table-picker.f-card{position:relative;padding:18px 16px;border-radius:24px;box-shadow:0 4px 0 #dfe3e8;gap:12px}
  #app .f-practice .picker-toolbar.f-card-head,#app .f-practice .picker-toolbar .f-head-side{display:contents}
  #app .f-practice .picker-toolbar h2{display:none}
  #app .f-practice .f-pill-btn.f-pill-btn{position:absolute;top:-57px;left:-1px;right:-1px;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:18px;box-shadow:0 3px 0 #ead08a;font:700 14px/18px IBM,sans-serif;text-align:left}
  #app .f-practice .picker-toolbar .f-link.f-link{position:absolute;top:18px;right:16px;font:600 14px/18px IBM,sans-serif;color:#5f7179}
  #app .f-practice fieldset{gap:12px}
  #app .f-practice fieldset+fieldset{margin-top:4px}
  #app .f-practice fieldset legend{font:700 14px/18px IBM,sans-serif}
  #app .f-practice .f-chips.six{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
  #app .f-practice .f-chip.f-chip.table-chip{height:56px;border-radius:14px;font:700 20px/24px IBM,sans-serif}
  #app .f-practice .f-chip.f-chip.table-chip[style^="--heat-bg:#eceeec"]{box-shadow:none}
  #app .f-practice .f-chip.f-chip.table-chip[aria-pressed="true"]::after,#app .f-practice .f-chip.f-chip.table-chip.selected::after{display:none}
  #app .f-practice .f-legend-row.picker-note{display:none}

  /* summary bar */
  #app .f-practice .f-summary.f-summary{display:grid;grid-template-columns:minmax(0,1fr) 132px;column-gap:12px;row-gap:0;align-items:center;padding:12px 12px 12px 18px;border-radius:22px;box-shadow:0 4px 0 #c6d9ee}
  #app .f-practice .f-summary.f-summary>.f-summary-label{grid-column:1;grid-row:1;align-self:end;min-height:0;padding:0;background:none;font:400 13px/16px IBM,sans-serif}
  #app .f-practice .f-summary.f-summary>h2{grid-column:1;grid-row:2;align-self:start;font:700 26px/32px IBM,sans-serif}
  #app .f-practice .f-summary.f-summary>h2.empty{font-size:18px}
  #app .f-practice .f-summary.f-summary>.f-pills,#app .f-practice .f-summary.f-summary>.f-sample,#app .f-practice .f-summary.f-summary>.f-note{display:none}
  #app .f-practice .f-summary.f-summary>.f-start.f-start{grid-column:2;grid-row:1/3;width:132px;height:56px;min-height:0;border-radius:18px;box-shadow:0 5px 0 #c99516;font:700 19px/24px IBM,sans-serif}

  /* profile page */
  #app.f-page.f-profile{padding:20px 16px 32px;gap:14px}
  #app.f-profile .f-page-title.f-page-title{gap:12px}
  #app.f-profile .f-page-title .f-mascot.f-mascot{width:38px;height:45px}
  #app.f-profile .f-page-title h1{font-size:26px;line-height:34px;max-width:none}
  #app.f-profile .f-page-title .f-note.hand-note{font-size:13px;line-height:16px}
  #app.f-profile .f-card{padding:18px 16px;border-radius:22px;gap:12px}
  #app.f-profile .f-card-head{flex-direction:column;align-items:flex-start;gap:2px}
  #app.f-profile .f-card-head h2{font-size:18px;line-height:22px}
  #app.f-profile .f-card-head .f-note{font-size:13px;line-height:16px}
  #app.f-profile .f-two{gap:14px}
  #app.f-profile .f-stat-grid{grid-template-columns:repeat(2,calc(50% - 6px));gap:10px}
  #app.f-profile .f-stat{padding:12px 14px}
  #app.f-profile .f-stat b{font-size:24px;line-height:32px}
  #app.f-profile .f-chips.six.big{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
  #app.f-profile .f-chips.big .f-chip.f-chip{height:62px}
  #app.f-profile .f-chips.big .f-chip.f-chip b{font-size:22px;line-height:26px}
  #app.f-profile .f-chips.big .f-chip.f-chip small{font-size:10px;line-height:12px}
  #app.f-profile .f-start.f-start.small{align-self:stretch;width:auto}
  #app.f-profile .f-trend{max-width:322px}
  #app.f-profile .f-calendar,#app.f-profile .f-calendar div{gap:4px}
  #app.f-profile .f-calendar i{width:15px;height:15px;border-radius:1.5px}
  #app.f-profile .f-mode-stat{padding:11px 12px}
  #app.f-profile .f-mode-stat>span:first-child{font-size:15px;line-height:18px}
  #app.f-profile .f-mode-stat>span:last-child{font-size:13px;line-height:16px}
}
