/* ace-loop.css : Today, Repair and Progress (2026-11-16), from the "Ace Labs: the best version"
   phone screens. Loaded after ace-ui.css; uses its tokens. One column on a phone, two on a desk. */
.loop { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.loop-head { display: flex; flex-direction: column; gap: 6px; }
.loop-head .aui-h1 { font-size: 36px; line-height: 1.1; font-weight: 700; }
.loop-head .aui-lede { font-size: 15px; line-height: 1.5; }
.loop-date { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: #6f5a26; text-transform: uppercase; margin: 0; }
.loop-go { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 22px; border-radius: 16px; background: #C9A84C; color: #0d2018 !important; text-decoration: none; font-size: 18px; font-weight: 700; box-shadow: 0 6px 18px rgba(140,114,53,.28); border: 0; cursor: pointer; font-family: inherit; }
.loop-go:hover { background: #d4b45c; }
.loop-go svg { flex-shrink: 0; }
.loop-h2 { margin: 4px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: #5c6a63; text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline; }
.loop-h2 span { letter-spacing: 0; text-transform: none; font-weight: 400; }
.loop-forest { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 20px; background: #1B3A2D; color: #fffdf7; text-decoration: none; }
.loop-forest .k { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: #E2C97A; text-transform: uppercase; }
.loop-forest h2, .loop-forest h3 { margin: 0; font-family: var(--aui-display); font-size: 24px; font-weight: 700; color: #fffdf7; }
.loop-forest p { margin: 0; font-size: 14px; line-height: 1.5; color: #e9e4d8; }
.loop-forest .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.loop-forest .chips span { padding: 5px 10px; border-radius: 999px; background: #2A5240; font-size: 12px; font-weight: 500; }
.loop-forest .t { font-size: 13px; color: #E2C97A; font-weight: 500; }
a.loop-forest:hover { background: #224634; }
.loop-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: #fffdf7; border: 1px solid #e6dccb; text-decoration: none; color: #0d2018 !important; }
a.loop-card:hover { border-color: #C9A84C; }
.loop-card .ic { flex-shrink: 0; width: 64px; height: 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.loop-card .ic img { width: 100%; height: 100%; object-fit: cover; }
.loop-card .tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.loop-card .k { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.loop-card .t1 { font-size: 17px; font-weight: 700; }
.loop-card .t2 { font-size: 13px; line-height: 1.45; color: #3a4a42; }
.loop-panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px; background: #fffdf7; border: 1px solid #e6dccb; }
.loop-panel h2 { margin: 0; font-family: var(--aui-display); font-size: 21px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.loop-panel h2 a { font-family: var(--aui-font); font-size: 14px; font-weight: 700; }
/* section bands: Building, Close, Test-ready */
.band-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 12px; align-items: center; font-size: 14px; }
.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; min-width: 90px; }
.band span { height: 8px; border-radius: 4px; background: #e6dccb; }
.band[data-band="1"] span:nth-child(-n+1), .band[data-band="2"] span:nth-child(-n+2), .band[data-band="3"] span { background: #1B3A2D; }
.band[data-band="3"] span { background: #007a59; }
.band[data-band="0"] span { background: #efe7d6; }
.band-name { font-weight: 700; }
.band-word { font-size: 13px; color: #3a4a42; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: #3a4a42; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 22px; height: 8px; border-radius: 4px; }
.sec-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid #efe5d3; }
.sec-row:first-child { border-top: 0; padding-top: 0; }
.sec-row .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec-row .top b { font-size: 16px; }
.sec-row .top span { font-size: 13px; font-weight: 700; color: #1B3A2D; }
.sec-row .band { min-width: 0; }
.sec-row .band span { height: 10px; }
.sec-row .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: #3a4a42; }
.coach { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 20px; background: #efe7d6; }
.coach .av { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #1B3A2D; color: #E2C97A; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.coach .who { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #6f5a26; text-transform: uppercase; }
.coach p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
/* repair */
.loop-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.loop-count { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: #fffdf7; border: 1px solid #e6dccb; }
.loop-count b { font-family: var(--aui-display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.loop-count b.ok { color: #007a59; }
.loop-count span { font-size: 13px; color: #3a4a42; }
.loop-stack { display: flex; flex-direction: column; gap: 12px; }
.loop-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #1B3A2D; color: #fffdf7; font-size: 13px; font-weight: 700; }
.tag-trap { padding: 6px 12px; border-radius: 999px; background: #fbefe4; color: #9b4500; font-size: 13px; font-weight: 700; }
.tag-plain { padding: 6px 12px; border-radius: 999px; background: #efe7d6; color: #3a4a42; font-size: 13px; font-weight: 700; }
.loop-from { font-size: 12px; color: #5c6a63; margin: 0; }
.loop-rule { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 20px; background: #1B3A2D; color: #fffdf7; }
.loop-rule h2 { margin: 0; font-family: var(--aui-display); font-size: 21px; font-weight: 700; color: #fffdf7; }
.loop-rule p { margin: 0; font-size: 13px; color: #e9e4d8; line-height: 1.5; }
.loop-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.loop-track > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.loop-track .node { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.loop-track .node.miss { background: #D55E00; }
.loop-track .node.win { background: #C9A84C; animation: loop-pop .45s ease-out both; }
.loop-track .node.next { border: 2.5px dashed #E2C97A; }
.loop-track .node.later { border: 2.5px dashed #5d7f6c; }
.loop-track b { font-size: 12px; }
.loop-track span { font-size: 12px; color: #e9e4d8; }
@keyframes loop-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.loop-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.loop-queue li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fffdf7; border: 1px solid #e6dccb; font-size: 14px; }
.loop-queue li b { display: block; }
.loop-queue li small { color: #5c6a63; }
.loop-queue .wins { display: flex; gap: 4px; flex-shrink: 0; }
.loop-queue .wins i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #C9A84C; box-sizing: border-box; }
.loop-queue .wins i.on { background: #C9A84C; }
.loop-side { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: #efe7d6; text-decoration: none; color: #0d2018 !important; }
.loop-side > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: #3a4a42; }
.loop-side b { font-size: 14px; color: #0d2018; }
.loop-empty { padding: 18px; border-radius: 20px; background: #fffdf7; border: 1px dashed #d9cdb6; font-size: 15px; line-height: 1.5; }
.loop-lesson { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; background: #fdf7e8; border: 1px solid #e8d7a8; }
.loop-lesson h3 { margin: 0; font-family: var(--aui-display); font-size: 20px; }
.loop-lesson p { margin: 0; font-size: 14px; line-height: 1.5; color: #3a4a42; }
.loop-btns { display: flex; flex-wrap: wrap; gap: 10px; }
/* answer changes */
.chg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chg div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: #F5F0E8; }
.chg b { font-family: var(--aui-display); font-size: 30px; line-height: 1.1; }
.chg .up b { color: #007a59; }
.chg .down b { color: #9b4500; }
.chg span { font-size: 13px; color: #3a4a42; }
.loop-foot { font-size: 13px; color: #5c6a63; margin: 0; }
@media (min-width: 900px) {
  .loop.loop--wide { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .loop.loop--wide > .span2 { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .loop-track .node.win { animation: none; } }
a.loop-forest, a.loop-forest:hover { color: #fffdf7 !important; }
.loop-forest .chips span { color: #fffdf7; }
