/* Useful rules live beside the choice, with readable full explanations one click away. */
.detail-layout{display:grid;gap:13px}.detail-section{padding:16px 18px;background:#251b2d99;border:1px solid #9d83aa38;border-radius:7px}
.detail-section h3{font-size:18px;line-height:1.3;color:#efd4aa;margin:0 0 10px}.detail-section p{font-size:15px!important;line-height:1.65!important;margin:0 0 10px!important}.detail-section p:last-child{margin-bottom:0!important}.detail-section ul{margin:0;padding-left:20px}.detail-section li{padding:4px 0;font-size:15px;line-height:1.55;color:#e0d4e6}.detail-source{font-size:12px!important;margin-top:17px!important;color:#bfaed0}.detail-source a{color:#ecd1a6}
.choice-stage .fitted-choices .roomy-card>.choice{padding:17px 15px;justify-content:flex-start;align-items:stretch;display:flex;flex-direction:column}
.choice-stage .fitted-choices .roomy-card.has-detail .choice-label{padding-right:52px;flex-shrink:0;line-height:1.2}
.choice-stage .fitted-choices .roomy-card .choice-description{display:block;flex:1;min-height:0;max-width:none;overflow:hidden;-webkit-line-clamp:unset;font-size:13px;line-height:1.5;margin-top:13px;white-space:normal}
.card-section{display:block;margin-bottom:13px}.card-section>strong{display:block;color:#e8cc9f;font-size:13px;line-height:1.3;margin-bottom:5px}.card-section>span{display:block}.card-bullet{position:relative;padding-left:12px;margin:5px 0}.card-bullet:before{content:'•';position:absolute;left:0;color:#d4b789}
.choice-stage .origin-choices .choice-description{white-space:pre-line;-webkit-line-clamp:unset;line-height:1.3}
.class-stage .class-grid .choice-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.class-stage .class-grid .choice-info{left:10px;right:auto;font-size:10px;padding:4px 6px;min-height:24px}
@media(max-width:600px){.class-stage .class-grid .choice-info{left:4px}}
.multi-choice-wrap{position:relative;min-width:0;min-height:0}.multi-choice-wrap .multi-option{width:100%;height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:35px}.multi-info{position:absolute;right:7px;top:8px;width:23px;height:23px;min-height:23px;border:1px solid #d1b58d99;border-radius:50%;padding:0;background:#17121d99;color:#e9d0aa;font:italic 15px/1 Georgia,serif}.multi-info:hover{background:#e6c89a;color:#241b16}
.currency-inputs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:4px 0 15px}.currency-field{display:flex;flex-direction:column;gap:9px;padding:16px 12px;background:#201726df;border:1px solid #a58bbb66;border-top:3px solid var(--coin-color,#d8b06c);border-radius:6px;min-width:0}.currency-field>span{font-size:16px;font-weight:600}.currency-field>span small{display:block;margin-top:5px;color:var(--coin-color);font-size:11px}.currency-field input{width:100%;min-width:0;padding:12px 6px;font-size:23px;text-align:center;background:#110e19cc;border:1px solid #9d83aa66;color:#f4eadf;border-radius:4px}.currency-field>small{font-size:10px;line-height:1.4;color:#bfb1ca}.currency-cp{--coin-color:#d7986c}.currency-sp{--coin-color:#b9c7db}.currency-ep{--coin-color:#d4cba2}.currency-gp{--coin-color:#f1cd78}.currency-pp{--coin-color:#dce1ed}.currency-total{font-size:13px;color:#cfc1d7;line-height:1.5}.currency-total strong{color:#efd4aa}.currency-error{font-size:13px;color:#f0b391}.currency-error:empty{display:none}.wealth-guide p{font-size:14px;line-height:1.65}
.reference-choice{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;margin:17px 0;background:#241b2bd9;border:1px solid #a58bbb66;border-radius:6px;max-width:700px}.reference-choice input{accent-color:#dfbc86;width:20px;height:20px;flex:0 0 20px;margin:2px 0 0;cursor:pointer}.reference-choice>span{font-size:16px;line-height:1.4}.reference-choice small{display:block;font-size:12px;color:#c8b9d1;margin-top:5px;line-height:1.45}
.shop-stage #stage{width:min(1100px,100%);justify-content:flex-start;min-height:0}.shop-stage #content{display:flex;flex-direction:column;flex:1;min-height:0;max-height:none}.shop-stage #content>*{flex-shrink:0}.shop-stage .step-title{font-size:clamp(36px,4.4vw,60px);line-height:1.04;margin-bottom:12px}.shop-stage .step-description{font-size:13px;margin-bottom:12px}.shop-stage .chapter{margin-bottom:13px}.shop-stage .hero-caption{display:none}
.shop-toolbar{display:flex;gap:12px;align-items:center;margin:12px 0}.shop-toolbar .search-field{max-width:none;min-width:0}.shop-toolbar .search-field input{min-height:43px;padding:10px 12px}.shop-bag{display:flex;align-items:center;gap:9px;border:1px solid #ae8f6555;background:#2a1c20e8;border-radius:4px;font-size:13px;padding:10px 12px;min-height:43px;white-space:nowrap}.shop-bag strong{color:#efd09b;font-size:16px}
.shop-grid{display:grid;grid-template-columns:repeat(var(--shop-columns),minmax(0,1fr));gap:8px;min-height:0}.shop-stock{height:var(--shop-card-height);min-width:0;background:linear-gradient(145deg,#37272cd9,#15101ce8);border:1px solid #b3997355;border-radius:5px;padding:10px 11px;display:flex;flex-direction:column;box-shadow:inset 0 1px #ebd6b411}.shop-stock-details{display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:0;flex:1;overflow:hidden;padding:0;border:0;background:none;text-align:left}.shop-stock-details strong{font-size:16px;line-height:1.2;flex-shrink:0}.shop-stock-details>span{font-size:11px;line-height:1.35;color:#bfb0c8;margin-top:5px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.shop-stock-details small{font-size:10px;color:#e8cb9d;margin-top:auto;padding-top:3px}.shop-stock-buy{display:flex;justify-content:space-between;align-items:center;gap:7px;flex-shrink:0;margin-top:6px}.shop-stock-buy>span{font-size:12px;color:#ecd09f}.shop-stock-buy>button{background:#d4b17c;color:#241b16;border:1px solid #e5c89a;border-radius:3px;font-size:12px;min-height:28px;padding:4px 10px}.shop-stock-buy>button:disabled{opacity:.35}.shop-pages{margin-top:12px}.shop-continue{margin-top:12px;min-height:46px;padding:11px 19px}.bag-balance{color:#edcea0}.bag-list{display:grid;gap:10px}.bag-row{display:flex;align-items:center;justify-content:space-between;gap:15px;background:#24192c;padding:13px;border-radius:5px}.bag-row strong{font-size:15px}.bag-row small{display:block;color:#d8bc91;font-size:12px;margin-top:5px}.bag-row button{border:1px solid #8f789b;background:#35263e;padding:9px;border-radius:4px;white-space:nowrap;font-size:12px}
@media(max-width:1100px){.shop-stage #stage{width:100%}}
@media(max-width:600px){.detail-section{padding:13px}.detail-section h3{font-size:17px}.detail-section p,.detail-section li{font-size:14px!important}.choice-stage .fitted-choices .roomy-card>.choice{padding:13px 11px}.choice-stage .fitted-choices .roomy-card .choice-description{font-size:12px;line-height:1.45}.choice-stage .fitted-choices .roomy-card.has-detail .choice-label{padding-right:43px;font-size:17px}.multi-choice-wrap .multi-option{padding-right:31px;gap:7px}.currency-inputs{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.currency-field{padding:12px 9px}.currency-field>span{font-size:14px}.currency-field input{font-size:20px;padding:8px 4px}.reference-choice{padding:12px}.reference-choice>span{font-size:15px}.reference-choice small{font-size:11px}.shop-stage .step-title{font-size:34px}.shop-stage .step-description{font-size:12px;margin-bottom:9px}.shop-stage #stage{padding-top:12px}.shop-stage .chapter{margin-bottom:10px}.shop-toolbar{gap:8px;margin:9px 0}.shop-bag{font-size:11px;padding:8px}.shop-stock{padding:8px}.shop-stock-details strong{font-size:14px}.shop-stock-details>span{font-size:10px;-webkit-line-clamp:2}.shop-stock-buy>span{font-size:11px}.shop-stock-buy>button{font-size:11px;min-height:26px;padding:3px 8px}.shop-continue{font-size:13px}.bag-row{gap:9px;padding:10px}.bag-row strong{font-size:13px}}
/* Keep funds and the shop's action visible while making room for more stock. */
#forge[data-step="campaign-wealth"] #content{display:flex;flex-direction:column;flex:1;min-height:0;max-height:none;overflow:hidden}
#forge[data-step="campaign-wealth"] #content>.step-heading,#forge[data-step="campaign-wealth"] #content>.step-description,.wealth-continue{flex-shrink:0}
#forge[data-step="campaign-wealth"] #stage{justify-content:flex-start;min-height:0}
#forge[data-step="campaign-wealth"] .step-description{font-size:13px;margin-bottom:12px}
.wealth-fields{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#8c719d transparent}.wealth-continue{margin-top:10px;min-height:45px;padding:11px 20px}
.shop-stage .step-description{display:none}.shop-stage .step-title{font-size:clamp(34px,4.1vw,55px)}
.shop-stage .market-counter{min-height:62px;margin-bottom:0;padding:5px 12px 5px 5px;gap:11px}.shop-stage .market-keeper{flex-basis:70px;width:70px;height:50px;margin-bottom:-5px}.shop-stage .market-keeper .shopkeeper-avatar{width:57px;height:57px;left:4px;bottom:6px}.shop-stage .market-purse strong{font-size:20px}.shop-stage .market-purse>span{font-size:11px}.shop-stage .counter-top{bottom:18px}.shop-stage .counter-front{height:19px}.shop-stage .counter-front span{font-size:8px;padding:1px 4px}.shop-stage .shop-toolbar{margin:8px 0}
.compact-stock{padding:7px 8px}.compact-stock .shop-stock-details>span{display:none}.compact-stock .shop-stock-details strong{font-size:14px;line-height:1.18}.compact-stock .shop-stock-details small{padding-top:0;margin-top:auto}
@media(max-width:600px){#forge[data-step="campaign-wealth"] .step-title{font-size:34px;line-height:1.05;margin-bottom:12px}#forge[data-step="campaign-wealth"] .step-description{font-size:12px;line-height:1.35;margin-bottom:10px}.currency-field{padding:9px 8px;gap:6px}.currency-field>span small{display:inline;margin:0 0 0 4px;font-size:9px}.currency-field>span{font-size:12px}.currency-field input{font-size:18px;padding:7px 3px;height:36px}.currency-field>small{font-size:9px;line-height:1.2}.currency-inputs{margin:0 0 10px}.currency-total{margin:8px 0;font-size:12px}.wealth-guide{padding:4px 0;margin-bottom:7px}.wealth-guide summary{min-height:28px;font-size:12px}.shop-stage .market-purse strong{font-size:18px}.shop-stage .market-purse>span{font-size:10px}.shop-stage .market-counter{gap:8px}.shop-stage .compact-stock .shop-stock-details strong{font-size:13px}}
.shop-stock-buy>.shop-price{min-height:26px;padding:0;border:0;background:none;color:#ecd09f;text-align:left;max-width:calc(100% - 42px);font-size:12px;line-height:1.1}.shop-price small{display:none;color:#c7b7cd;font-size:9px;margin-top:3px}.compact-stock .shop-stock-details small{display:none}.compact-stock .shop-price small{display:block}.compact-stock .shop-stock-details strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.shop-stock-buy>.shop-price:hover{color:#fff0c7}
/* Balance each visible row and make clipped rules an explicit reading action. */
#forge .choices.balanced-choices{display:flex;flex-direction:column;gap:var(--choice-gap)}
.choice-stage .hero-caption{display:none}
.choice-row{display:grid;grid-template-columns:repeat(var(--row-size),minmax(0,1fr));gap:var(--choice-gap);min-width:0;align-self:flex-start;width:calc((100% - (var(--row-columns) - 1)*var(--choice-gap))/var(--row-columns)*var(--row-size) + (var(--row-size) - 1)*var(--choice-gap))}
.choice-view-all{position:absolute;z-index:3;left:13px;bottom:9px;padding:2px 0;border:0;background:transparent;color:#edd0a0;font-size:12px;font-style:italic;line-height:1.2;text-align:left;min-height:20px}
.choice-view-all[hidden]{display:none!important}.choice-view-all:hover{text-decoration:underline;color:#fff0d6}
#forge .has-clipped-content>.choice{padding-bottom:36px}
.unavailable-choice>.choice{opacity:.44;filter:grayscale(.8);cursor:not-allowed}.choice-unavailable{display:block;font-size:11px;line-height:1.3;color:#eee0cf;margin-top:6px;flex-shrink:0}
.choice-ability-score{display:flex;align-items:center;gap:12px;margin:12px 0 0;flex-shrink:0;color:#efd1a2;text-align:left}.choice-ability-score>strong{font-size:34px;line-height:1;font-weight:500}.choice-ability-score>span{font-size:12px;line-height:1.5;color:#d5c8df}.choice-ability-score b{font-weight:600;color:#f1d7ac}
#forge .ability-choice>.choice{justify-content:flex-start}.choice-stage .fitted-choices .ability-choice:not(.roomy-card)>.choice{padding-top:40px}.choice-stage .ability-choice .choice-description{flex:1;min-height:0;overflow:hidden}
.spell-references{margin-top:24px;padding-top:20px;border-top:1px solid #ac8e6a66}.spell-references>h3{color:#e9d1aa;font-size:14px;letter-spacing:.06em;margin:0 0 15px}.spell-reference{margin:0 0 19px;padding:17px;border:1px solid #a58bbb55;border-left:3px solid #b89a68;border-radius:6px;background:#19131fcc}.spell-reference>h4{font-size:21px;color:#f1dbb4;margin:0 0 13px;line-height:1.25}.spell-reference>h4>span{display:block;font-size:11px;font-weight:400;margin-top:5px;color:#c5b2cd}.spell-reference .detail-section{border:0;background:transparent;padding:0;margin:0 0 13px}.spell-reference .detail-section:last-child{margin-bottom:0}.spell-reference .detail-section h3{font-size:14px;margin-bottom:5px}
@media(max-width:600px){.choice-view-all{left:11px;font-size:11px}.choice-ability-score{gap:8px;margin-top:9px}.choice-ability-score>strong{font-size:29px}.choice-ability-score>span{font-size:10px}.choice-unavailable{font-size:10px}.spell-reference{padding:13px}.spell-reference>h4{font-size:19px}}
@media(max-width:600px){.choice-stage .fitted-choices .roomy-card>.choice{padding-top:40px}.choice-stage .fitted-choices .roomy-card .choice-label{padding-right:0;overflow-wrap:normal}}

/* Keep short decisions compact and preserve the same card width on partial rows. */
#forge .step-heading{display:block;flex-shrink:0}
#forge .step-heading .step-title{max-width:none}
#forge .step-title .heading-ending{display:inline-flex;align-items:baseline;gap:10px;vertical-align:baseline;white-space:nowrap;color:inherit;font:inherit;letter-spacing:inherit}
#forge .heading-ending .goblin-help{align-self:center;flex:0 0 108px;margin:0;vertical-align:middle;letter-spacing:normal;transform:none;animation:none}
#forge .heading-ending .goblin-speech{font-style:normal;font-weight:500;letter-spacing:normal;line-height:1.15}
#forward{border:1px solid #ad906d66;border-radius:4px;background:#201724c7;color:#efd6b1;padding:9px 13px;display:flex;align-items:center;gap:10px;font-size:13px;min-height:42px;margin-right:auto}
#forward[hidden]{display:none}#forward span{font-size:20px}#forward:disabled{opacity:.4}#forward:hover{background:#3a2b38}
.navigation-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;max-width:100%;margin-right:auto}
.navigation-actions #forward{margin-right:0}
#start-again{border:1px solid #ad906d66;border-radius:4px;background:#201724c7;color:#efd6b1;padding:9px 13px;font:inherit;font-size:13px;min-height:42px;white-space:nowrap;margin-left:auto}
#start-again:hover{background:#3a2b38}
@media(max-width:600px){#start-again{order:1;padding:8px 10px;font-size:12px;min-height:40px}.footer-row>.rules-link{order:2;flex-basis:100%;text-align:right}}
#forge .summary-card .choice-description{display:block;line-height:1.35}
.card-feature-heading{display:block;color:#e6cba4;font-size:13px;line-height:1.4;margin:0 0 12px}
#forge .compact-choice-stage .choice-description{line-height:1.5}
#forge.compact-choice-stage .fitted-choices .choice{justify-content:flex-end;padding-bottom:24px}
#forge.compact-choice-stage .fitted-choices .choice-description{flex:0 1 auto;line-height:1.5;display:block;-webkit-line-clamp:unset}
#forge.compact-choice-stage .fitted-choices{max-width:850px;align-self:center;width:100%}
#forge.compact-choice-stage .choice-ability-score{margin-top:10px}
#forge[data-step="level"] .level-choices .choice-description{display:block;white-space:normal;font-size:11px;line-height:1.3}

@media(max-width:600px){#forge .step-title .heading-ending{gap:6px}#forge .heading-ending .goblin-help{flex-basis:88px}#forward{padding:8px 10px;font-size:12px;min-height:40px}.card-feature-heading{font-size:12px;margin-bottom:10px}#forge.compact-choice-stage .fitted-choices .choice{padding-bottom:16px}#forge[data-step="level"] .level-choices .choice-description{font-size:9px;margin-top:5px}}
@media(max-width:360px){#forge .heading-ending .goblin-help{flex-basis:82px}}

/* Size the content, then center the complete step only when every control fits. */
#forge .step-heading,#forge .step-heading .step-title,#forge .step-description{text-align:left}
#forge.compact-choice-stage .fitted-choices{max-width:none;align-self:flex-start}
#forge.measure-step-content #content,#forge.content-centered #content{flex:0 0 auto!important;height:auto;max-height:none!important;overflow:visible!important;min-height:0}
#forge.measure-step-content .wealth-fields,#forge.content-centered .wealth-fields{flex:0 0 auto;overflow:visible}
#forge.measure-step-content .multi-grid,#forge.content-centered .multi-grid{flex:0 0 auto;grid-auto-rows:minmax(70px,auto)}
#forge.content-centered #stage{justify-content:center}
@media(max-width:600px){#forge #stage{justify-content:flex-start}}
#forge .choice-label,#forge .multi-option>span,#forge .shop-stock-details strong{overflow-wrap:normal;word-break:normal;hyphens:none}
#forge .choice-wrap.has-detail:not(:has(.origin-info))>.choice{padding-top:42px}
#forge .choice-wrap.has-detail .choice-label{padding-right:0;width:100%;max-width:none}
#forge .choice-description:empty{display:none}
#forge .benefit-card>.choice{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}
#forge .benefit-card .choice-description{display:block;flex:1;min-height:0;overflow:hidden;-webkit-line-clamp:unset;margin-top:12px;font-size:13px;line-height:1.5;white-space:normal}
#forge .benefit-card .card-section{margin-bottom:0}
#forge .spell-choice .choice-description{display:block;-webkit-line-clamp:unset;min-height:0;overflow:hidden;line-height:1.4}
.spell-card-level,.spell-card-casting,.spell-card-effect{display:block}
.spell-card-level{color:#e9cca0;font-size:12px;line-height:1.35;margin-bottom:5px}
.spell-card-casting{font-size:12px;line-height:1.4;color:#d5c7dd}
.spell-card-effect{margin-top:12px;font-size:13px;line-height:1.5}
#forge .chosen-here .choice-unavailable{color:#ead7b9}
@media(max-width:600px){.spell-card-level,.spell-card-casting{font-size:11px}#forge .multi-option{padding-top:30px;padding-right:11px}.spell-card-effect{font-size:12px}#forge.measure-step-content .multi-grid,#forge.content-centered .multi-grid{grid-auto-rows:minmax(70px,auto)}}

#forge .spell-card-compact .choice-description{flex:0 0 auto;max-height:none}

/* Weapon mastery previews always retain their damage and mastery; the link opens all rules. */
#forge .choice-wrap.mastery-card>.choice{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:15px 13px 36px}
#forge .mastery-card .choice-description{display:block;flex:0 0 auto;min-height:0;max-height:none;overflow:visible;-webkit-line-clamp:unset;margin-top:12px;font-size:13px;line-height:1.4;white-space:normal}
#forge .mastery-card .card-section{margin-bottom:12px}
#forge .mastery-card .card-section:last-child{margin-bottom:0}
@media(max-width:600px){#forge .choice-wrap.mastery-card>.choice{padding:13px 11px 36px}#forge .mastery-card .choice-description{font-size:12px;margin-top:10px}}

/* Carrying is an advisory: owned belongings stay on the character sheet. */
.name-field #name-limit{display:flex;justify-content:space-between;gap:12px;margin-top:9px;color:#cabbce;font-size:12px;line-height:1.4}
#forge .step-title.long-character-name{font-size:clamp(32px,3.4vw,49px);line-height:1.08;letter-spacing:-.6px;overflow-wrap:anywhere}
.carrying-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-shrink:0;padding:12px 14px;margin:0 0 15px;border:1px solid #ad906d66;border-radius:5px;background:#1d1722d9;color:#e7dae9;font-size:13px;line-height:1.4}
.carrying-summary>div{min-width:0}.carrying-summary strong{display:block;color:#f0d3a7;font-size:14px}.carrying-summary small{display:block;margin-top:4px;color:#cdbdd4;font-size:12px}.carrying-summary button{flex-shrink:0;min-height:40px;border:1px solid #9a7c5b;border-radius:4px;background:#34283a;color:#f1dab9;padding:8px 12px;font:inherit;font-size:12px}.carrying-summary button:hover{background:#48364c}.carrying-summary.carrying-over{border-color:#d29d60;background:#302018e8}.carrying-summary.carrying-over p,#forge-dialog .carrying-summary p{margin:6px 0 0;font-size:12px;color:#f0c995}
.carrying-list{display:flex;flex-direction:column;margin:14px 0 20px}.carrying-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0;border-bottom:1px solid #785e894d}.carrying-row>span:first-child{min-width:0}.carrying-row strong{display:block;line-height:1.3;font-size:15px}.carrying-row small{display:block;color:#c2b4cd;font-size:12px;line-height:1.5;margin-top:4px}.carrying-quantity{display:flex;align-items:center;gap:10px;flex-shrink:0;font-size:12px;color:#d1bfdc}.carrying-quantity input{width:76px;min-height:40px;border:1px solid #886b9b;border-radius:4px;background:#241b2e;color:#f5e9fa;padding:7px 8px;font:inherit;font-size:16px}.carrying-quantity input[aria-invalid="true"]{border-color:#e8a66a}.carrying-coins{display:flex;align-items:flex-start;gap:12px;color:#efdab8}.carrying-coins input{margin-top:5px;accent-color:#e6c48d;width:18px;height:18px;flex-shrink:0}.carrying-coins small{display:block;color:#c8b8d3;font-size:12px}.carrying-coins+#carrying-coins-status{font-size:12px;margin:9px 0 0 30px;color:#c8b8d3}
@media(max-width:600px){.carrying-summary{flex-wrap:wrap;gap:10px;padding:11px 12px}.carrying-summary button{margin-left:auto}.carrying-row{gap:10px}.carrying-quantity{flex-direction:column;align-items:flex-start;gap:3px}.carrying-quantity input{width:66px}#forge-dialog .carrying-row strong{font-size:13px}.carrying-row small{font-size:11px}.carrying-coins+#carrying-coins-status{margin-left:0}}
