.upgrade-panel { --up-success: #245c43; --up-warning: #873e20; width: min(100% - 32px, 1040px); max-width: none; height: min(900px, 100dvh - 32px); max-height: none; padding: 0; border: 1px solid #a5aa9b; border-radius: 12px; background: var(--paper,#faf8f1); color: var(--ink,#232d28); font: 15px/1.5 system-ui,sans-serif; }
.upgrade-panel::backdrop { background: #17271f99; }
.upgrade-panel[open] { display:grid; grid-template-rows:minmax(0,1fr) auto; overflow:hidden; }
.up-scroll { overflow-y: auto; min-height: 0; padding: 24px; }
.up-header { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.up-heading { display: flex; align-items: center; gap: 14px; }
.up-heading h2,.up-heading p { margin: 0; }
.up-heading button { margin-left: auto; width: 44px; background: transparent; color: inherit; text-align: center; padding: 0; }
.up-avatar { display: grid; place-items: center; width: 52px; height: 52px; background: #e3e8dc; border-radius: 50%; font-size: 24px; color: var(--up-success); }
.upgrade-panel progress { width: 100%; height: 12px; accent-color: var(--up-success); margin-top: 16px; }
.up-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.up-badges span { background: #e5eddf; color: #21482f; padding: 6px 12px; border-radius: 6px; }
.up-badges span+span { background: #f2e3c8; color: #70401b; }
.up-count { float: right; border: 1px solid currentColor; padding: 0 8px; border-radius: 12px; }
.up-columns { display: grid; grid-template-columns: 46fr 54fr; gap: 24px; padding-top: 12px; }
.up-columns>* { min-width: 0; }
.up-reference { font-size: 14px; color: var(--muted); }
.up-reference select { margin-top: 4px; }
.up-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.up-row.is-selected { background: #e9eddf; border-radius: 6px; box-shadow: inset 3px 0 #356447; }
.up-row-label { flex: 1; background: transparent; color: inherit; border: 0; padding: 4px; width: auto; text-align: left; }
.up-row small { display: block; color: #535d50; font-size: 12px; font-weight: 400; }
.up-stepper { display: flex; gap: 4px; align-items: center; }
.up-stepper button { width: 44px; padding: 0; text-align: center; background: transparent; color: var(--ink); }
.up-stepper strong { min-width: 36px; text-align: center; font-size: 15px; }
.up-pending { color: var(--up-success); }
.up-inline-detail { display:none; width:100%; }
.up-detail h3 { font-size: 21px; margin-top: 8px; }
.up-detail h4 { font-size: 14px; margin: 20px 0 8px; }
.up-description { color:#535d50; }
.up-delta { display: flex; flex-wrap:wrap; justify-content:space-between; gap:8px; border-bottom:1px solid #dddcd1; padding:8px 0; }
.up-delta strong { color:var(--up-success); }
.up-track { list-style:none; padding:0; display:flex; justify-content:space-between; gap:8px; }
.up-track li { width:36px; height:36px; display:grid; place-items:center; padding:0; border-radius:50%; background:#e7e6df; color:#555d50; }
.up-track .reached { background:var(--up-success); color:white; }
.up-track .next { outline:2px solid #356447; outline-offset:3px; }
.up-nodes { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.up-node { border:1px solid #c9cdbf; padding:10px; border-radius:6px; min-width:0; background:#f0efe8; }
.up-node strong,.up-node-state,.up-node small { display:block; }
.up-node-state { font-size:12px; font-weight:650; margin:4px 0; }
.up-node small { font-size:12px; }
.up-node p { font-size:14px; }
.up-node.ready { border:2px solid #356447; background:#f4f7ee; }
.up-node.learned { background:#e3ecdb; border-color:#78966a; }
.up-node.needsPractice { background:#f5e9d1; border-color:#b59b67; }
.up-node.locked { color:#5b6257; }
.up-pools { font-size:14px; margin-top:18px; }
.up-footer { padding:12px 24px 8px; border-top:1px solid #a5aa9b; background:#f6f4eb; box-shadow:0 -4px 12px #17271f0a; }
.up-summary { margin:0 0 10px; font-size:14px; }
.up-footer-actions { display:flex; gap:10px; }
.up-footer-actions button { text-align:center; flex:1; }
.up-footer-actions .up-secondary { background:transparent; color:var(--ink); }
.up-footer-actions button:first-child { margin-right:auto; flex:0 1 auto; width:auto; font-weight:400; border-color:transparent; text-decoration:underline; }
.up-message { min-height:21px; font-size:14px; color:var(--up-warning); margin:6px 0 0; }
@media(max-width:600px) and (orientation:portrait){.up-footer{padding:10px 16px 8px}.up-footer-actions{gap:6px}.up-footer-actions button{padding:8px}.up-footer-actions button:first-child{font-size:14px}}
@media(orientation:landscape) and (max-height:500px){
  .up-scroll{padding:12px 20px}
  .up-header{display:grid;grid-template-columns:180px 1fr;gap:4px 16px;padding-bottom:12px}
  .up-heading{grid-row:1/4;gap:8px}.up-avatar{width:40px;height:40px;font-size:20px;flex-shrink:0}
  .up-header progress{margin-top:0}.up-header>p{margin:0;font-size:14px}
  .up-badges span{padding:3px 8px;font-size:14px}
  .up-footer{padding:8px 20px 4px}.up-summary{margin-bottom:6px}.up-message{margin-top:2px}
}
@media(max-width:600px) and (orientation:portrait){.up-inline-detail{display:block}.up-detail{padding:12px 2px}.up-detail h3{font-size:19px}}
@media(max-width:600px) and (orientation:portrait){.up-columns{display:block}.up-detail-slot{display:none}.up-row-label{min-width:140px}}
.upgrade-panel button,.upgrade-panel select { min-height: 44px; min-width: 44px; font-size: 15px; }
.upgrade-panel :focus-visible { outline: 3px solid #a25520; outline-offset: 2px; }
@media(max-width:600px) and (orientation:portrait){.upgrade-panel{width:100%;height:100dvh;margin:0;border-radius:0}.up-scroll{padding:16px}}

.up-muted, .up-stop-summary { color:#626a5e; }
