/* Original skill cards. All expanded rules stay in flow: no hand/equipment overlays. */
.hero-skills { min-width: 0; margin-top: 0.8rem; border-top: 1px solid #d2bd752e; padding-top: 0.65rem; }
.hero-skills__heading { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.45rem; }
.hero-skills__heading h3 { margin: 0; color: #e5cd87; font-size: 0.78rem; font-weight: 600; }
.hero-skills__heading > span { color: #c2cbbb; font-size: 0.65rem; }
.hero-skills__cards { display: grid; gap: 0.45rem; min-width: 0; }
.hero-skill-card { min-width: 0; border: 1px solid #b8b28a4a; border-radius: 0.45rem; background: #0a211b9c; overflow-wrap: anywhere; }
.hero-skill-card > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.55rem; list-style: none; cursor: pointer; border-radius: inherit; }
.hero-skill-card > summary::-webkit-details-marker, .opponent-skill-inspector > summary::-webkit-details-marker { display: none; }
.hero-skill-card > summary:hover, .opponent-skill-inspector > summary:hover { background: #d5ca7d12; }
.hero-skill-card > summary:focus-visible, .opponent-skill-inspector > summary:focus-visible, .active-skill-control button:focus-visible { outline: 3px solid #f4d986; outline-offset: 3px; }
.skill-icon { width: 1.8rem; height: 1.8rem; flex: 0 0 1.8rem; color: #ebd28c; }
.hero-skill-card__heading { flex: 1; display: grid; gap: 0.3rem; min-width: 0; }
.hero-skill-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.hero-skill-card .hero-skill-card__title strong { margin: 0; font-size: 0.78rem; line-height: 1.3; color: #f2e4bc; font-weight: 600; }
.skill-type { display: inline-block; padding: 0.13rem 0.3rem; border: 1px solid #b8c5b16b; border-radius: 0.2rem; color: #d3e3cc; font-size: 0.6rem; line-height: 1.2; white-space: nowrap; }
.skill-type.type-active, .skill-type.type-active_response { color: #f5ce9b; border-color: #dba5677a; background: #754a2629; }
.skill-type.type-choice, .skill-type.type-optional { color: #e1c7f4; border-color: #c9a3e477; background: #5c35732b; }
.skill-type.type-response, .skill-type.type-conversion { color: #b5e5e9; border-color: #76c3d478; background: #29617b30; }
.hero-skill-card__summary { color: #c8d4c2; font-size: 0.68rem; line-height: 1.5; }
.skill-chevron { flex: 0 0 auto; color: #ddca8b; font: 1.2rem/1 sans-serif; transition: transform 120ms; }
.hero-skill-card[open] > summary .skill-chevron { transform: rotate(180deg); }
.hero-skill-card[open] > summary { border-bottom: 1px solid #d0c18a30; border-radius: 0.45rem 0.45rem 0 0; }
.hero-skill-card__details { padding: 0.6rem; color: #dee3d0; font-size: 0.72rem; line-height: 1.65; }
.hero-skill-card__details p { margin: 0 0 0.5rem; }
.hero-skill-card__details .skill-type-help { color: #e5ce9d; }
.hero-skill-card__details dl { display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 0.4rem 0.6rem; margin: 0; }
.hero-skill-card__details dt { color: #b5c5ae; }
.hero-skill-card__details dd { margin: 0; }
.hero-skill-card__details ul { margin: 0.65rem 0 0; padding-left: 1.15rem; }
.hero-skill-card__details li + li { margin-top: 0.35rem; }
.hero-skill-card__details .skill-rule-source { margin: 0.65rem 0 0; color: #a9bca6; font-size: 0.62rem; }
.skill-target-hints { margin-top: 0.65rem; padding-top: 0.5rem; border-top: 1px dashed #d3bc7154; }
.skill-target-hints p { margin: 0.25rem 0 0; }
.hero-skill-card__details .skill-target-hints strong { font-size: 0.7rem; color: #e2d09e; }
.skill-card-status { font-size: 0.62rem; line-height: 1.5; color: #d4d3c2; }
.skill-card-status > span { font-weight: 600; color: #e8c785; }
.skill-card-status.is-ready > span { color: #b9e7b0; }
.skill-card-status.is-condition > span, .skill-card-status.is-used > span { color: #efbd9f; }
.opponent-skill-inspector { margin-top: 0.5rem; min-width: 0; }
.opponent-skill-inspector > summary { min-height: 44px; padding: 0.45rem 0.5rem; border: 1px solid #bbad765c; border-radius: 0.35rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem; list-style: none; cursor: pointer; color: #ecd79b; font-size: 0.72rem; }
.opponent-skill-inspector > summary::after { content: '+'; }
.opponent-skill-inspector[open] > summary::after { content: '−'; }
.opponent-skill-inspector > summary > span { font-size: 0.58rem; color: #bdcdb7; }
.opponent-skill-inspector > .hero-skills__cards { margin-top: 0.4rem; }
.home-hero-preview { align-items: start; }
.home-hero-meta .skill-block { padding: 0; background: transparent; border: 0; }
.home-hero-meta .hero-skills { margin-top: 0.4rem; padding-top: 0.5rem; }
.home-hero-meta .hero-skills__cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); align-items: start; }
/* Put costs and disabled reasons beside the actual action, readable without hover. */
.sgs-table .dock-main { grid-template-columns: 8rem minmax(0, 1fr); }
.sgs-table .skill-rail { width: auto; min-width: 0; max-width: none; padding: 0.4rem; justify-content: flex-start; }
.idle-skill-actions { margin-top: 0.5rem; }
.idle-skill-actions .active-skill-control { grid-template-columns: 5.4rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.active-skill-control { min-width: 0; display: grid; gap: 0.4rem; }
.active-skill-control .skill-seal { display: flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 44px; width: 100%; }
.active-skill-control .skill-seal .skill-icon { width: 1.4rem; height: 1.4rem; flex-basis: 1.4rem; }
.active-skill-control .skill-seal:disabled { cursor: not-allowed; filter: saturate(0.35); opacity: 0.65; }
.skill-status { display: grid; gap: 0.2rem; color: #e6d8bd; font-size: 0.64rem; line-height: 1.55; overflow-wrap: anywhere; }
.skill-status__label { font-weight: 600; color: #e5c57a; }
.skill-status.is-ready .skill-status__label { color: #b7e7ac; }
.skill-status.is-condition .skill-status__label, .skill-status.is-used .skill-status__label { color: #efba97; }
.skill-status__reason { color: #d1d6c3; }
@media (max-width: 640px) {
  .hero-skill-card > summary { padding: 0.5rem; }
  .hero-skills { margin-top: 0.6rem; padding-top: 0.5rem; }
  .hero-skill-card__details { font-size: 0.75rem; }
  .sgs-table .dock-main { grid-template-columns: minmax(0, 1fr); }
  .sgs-table .skill-rail { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.4rem; }
  .skill-rail-title { display: none; }
  .active-skill-control { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); flex: 1 1 100%; gap: 0.7rem; align-items: center; }
  .skill-rail > .skill-seal { width: auto; min-width: 4.5rem; }
  .skill-status { font-size: 0.68rem; }
  .opponent-skill-inspector > summary { font-size: 0.68rem; }
  .opponent-skill-inspector .hero-skill-card > summary { gap: 0.3rem; padding-inline: 0.35rem; }
  .opponent-skill-inspector .skill-icon { width: 1.35rem; height: 1.35rem; flex-basis: 1.35rem; }
  .opponent-skill-inspector .hero-skill-card__title strong { font-size: 0.7rem; }
}
@media (prefers-reduced-motion: reduce) { .skill-chevron { transition: none; } }

/* Adapted heroes retain source context beside their rules, in normal flow. */
.hero-provenance { margin-top: 0.6rem; border: 1px solid #bdb17555; border-radius: 0.35rem; color: #dce2cb; font-size: 0.7rem; overflow-wrap: anywhere; }
.hero-provenance > summary { min-height: 44px; padding: 0.65rem; cursor: pointer; color: #ead49e; }
.hero-provenance > summary:focus-visible { outline: 3px solid #f4d986; outline-offset: 2px; }
.hero-provenance__details { padding: 0 0.65rem 0.65rem; line-height: 1.65; }
.hero-provenance__details p { margin: 0.45rem 0 0; }
.hero-provenance__details a { color: #bddde5; text-decoration: underline; text-underline-offset: 0.15rem; }
.hero-source-links { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.hero-source-variant { color: #bacab2; font-size: 0.63rem; }
.ai-hero-preview { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.75rem; }
.ai-hero-preview img { width: 2.4rem; height: 3rem; object-fit: cover; border: 1px solid #9b783a; border-radius: 0.2rem; }
.hero-gallery .hero-chip { flex-shrink: 0; }
@media (max-width: 640px) {
  .hero-provenance { font-size: 0.72rem; }
  .hero-provenance > summary { padding: 0.55rem; }
  .hero-source-links { flex-direction: column; align-items: flex-start; }
  .ai-hero-preview img { width: 2rem; height: 2.5rem; }
}

.hero-provenance { background: #0a211be6; }

/* Guanxing is an ordered two-zone private prompt, never a hand/deck reveal. */
.guanxing-dialog { max-width: min(46rem, calc(100vw - 2rem)); }
.guanxing-hint { color: #d0d7be; font-size: 0.78rem; line-height: 1.6; }
.guanxing-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-block: 1rem; }
.guanxing-zone { min-width: 0; padding: 0.7rem; border: 1px solid #ad9d6477; border-radius: 0.35rem; background: #0a211b99; }
.guanxing-zone h3 { margin: 0; color: #e8cf91; font-size: 0.88rem; }
.guanxing-zone h3 span { display: block; color: #bdcdb7; font-size: 0.65rem; margin-top: 0.3rem; font-weight: 400; }
.guanxing-zone p { color: #9eb19a; font-size: 0.75rem; }
.guanxing-zone ol { padding-left: 1.4rem; margin-bottom: 0; line-height: 1.8; font-size: 0.8rem; }
.guanxing-remaining { display: grid; gap: 0.55rem; margin-bottom: 0.8rem; }
.guanxing-card { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem; border: 1px solid #afac8255; border-radius: 0.35rem; background: #173c30; }
.guanxing-card > strong { color: #f0e3bf; font-size: 0.8rem; }
.guanxing-card .dialog-actions { margin: 0; }
.guanxing-card button { min-height: 44px; font-size: 0.7rem; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .guanxing-zones { gap: 0.45rem; }
  .guanxing-zone { padding: 0.5rem; }
  .guanxing-card { display: grid; }
  .guanxing-card .dialog-actions { display: flex; flex-wrap: wrap; }
  .guanxing-card button { flex: 1 1 8rem; }
}

/* V28 original source guides: long provenance IDs wrap inside narrow seats. */
.sgs-fuli-projection { margin: .5rem 0; padding: .6rem; border: 1px solid #b8bba455; border-radius: .35rem; overflow-wrap: anywhere; line-height: 1.55; }
.sgs-fuli-projection ul { padding-left: 1.15rem; margin: .45rem 0; }
.sgs-fuli-projection li { margin: .35rem 0; }
.sgs-yijiang-next-context, .sgs-yijiang-next-status, .sgs-handang-status { overflow-wrap: anywhere; }
.sgs-yijiang-next-options > section { max-width: 100%; }
.sgs-yijiang-next-options button { min-height: 44px; overflow-wrap: anywhere; }
.wine-turn-rules > p { margin: .4rem .65rem .65rem; line-height: 1.55; }

/* V29 public reveal/ordered choices: contained in the existing responsive dialog. */
.sgs-yijiang-later-options > .dialog-actions { align-items: stretch; }
.sgs-yijiang-later-options > .dialog-actions > section { display: flex; flex-direction: column; gap: .4rem; min-width: 0; max-width: 100%; }
.sgs-yijiang-later-options .is-selected { border-radius: .6rem; outline: 2px solid #d1ba79; outline-offset: 3px; }
.sgs-yijiang-later-options .btn { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.sgs-yijiang-later-options small,.sgs-yijiang-later-context small { display: block; overflow-wrap: anywhere; }
.sgs-later-point-budget,.sgs-later-top-order { border: 1px solid #a08c5d; border-radius: .5rem; padding: .65rem; background: #20323c; }
.sgs-later-top-order ol { padding-left: 1.6rem; }
.sgs-yijiang-later-status p { overflow-wrap: anywhere; }
@media (max-width: 600px) { .sgs-yijiang-later-options > .dialog-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; } }

/* V30 private ordering, exact increasing payment, and blind-card choice. */
.sgs-yijiang-more-choices .dialog-actions { gap: .65rem; align-items: stretch; }
.sgs-yijiang-more-choices .dialog-actions > section { display: flex; flex-direction: column; gap: .35rem; min-width: 0; max-width: 100%; }
.sgs-yijiang-more-choices .btn { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.sgs-more-order-trays { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.sgs-more-order-trays > section { border: 1px solid #bba16a; border-radius: .6rem; padding: .65rem; min-width: 0; overflow-wrap: anywhere; }
.sgs-more-private-order { padding: .5rem 0; }
.sgs-more-hidden-card { display: grid; place-content: center; min-height: 64px; border: 1px solid #97855d; border-radius: .45rem; background: repeating-linear-gradient(45deg,#26383d,#26383d 6px,#344a50 6px,#344a50 8px); color: #f3e4bc; }
.sgs-yijiang-more-context, .sgs-yijiang-more-status { overflow-wrap: anywhere; }
@media (max-width: 520px) { .sgs-more-order-trays { grid-template-columns: minmax(0,1fr); } .sgs-yijiang-more-choices .dialog-actions > section { flex: 1 1 130px; } }
/* V31 compact, touch-safe source guides and private choices. */
.sgs-yijiang-further-choices .dialog-actions>section{display:flex;flex-direction:column;align-items:center;gap:.35rem;max-width:100%}
.sgs-yijiang-further-choices button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
.sgs-yijiang-further-choices button[aria-pressed=true]{outline:2px solid #dfbb76;background:#3b473b}
.sgs-further-hidden-card{display:grid;place-items:center;min-height:58px;min-width:64px;border:1px solid #81745c;border-radius:5px;background:repeating-linear-gradient(45deg,#28343e,#28343e 5px,#34434d 5px,#34434d 7px);font-size:.75rem}
.sgs-further-public-reveal{max-width:100%;font-size:.78rem;overflow-wrap:anywhere}.sgs-further-public-reveal summary{cursor:pointer;min-height:32px}.sgs-further-public-reveal ul{padding-left:1.3em}
.sgs-further-prevented{border-left:2px solid #c3b47d;padding-left:.45rem;animation:further-prevented .4s ease-out}
@keyframes further-prevented{from{opacity:.45}to{opacity:1}}@media(prefers-reduced-motion:reduce){.sgs-further-prevented{animation:none}}
/* Selected identity packet: owner-only materials, readable host boundary, no hover-only detail. */
.sgs-identity-next-context { overflow-wrap:anywhere; }
.sgs-identity-next-context p, .sgs-identity-next-policy li, .sgs-identity-next-status p { line-height:1.65; }
.sgs-identity-next-choices .dialog-actions { align-items:stretch; gap:12px; }
.sgs-identity-next-choices section { display:flex; flex-direction:column; gap:7px; max-width:100%; }
.sgs-identity-next-choices button { min-height:44px; white-space:normal; overflow-wrap:anywhere; }
.sgs-identity-next-choices button[aria-pressed="true"] { outline:2px solid #e6c184; outline-offset:2px; }
.sgs-identity-next-material { min-width:130px; flex:1 1 145px; }
.sgs-identity-next-public-card { display:inline-block; border:1px solid #9e8965; border-radius:6px; padding:4px 8px; color:#edd6aa; }
.sgs-identity-next-fire-threshold { padding:10px 12px; border-left:3px solid #d38b59; background:rgba(172,82,40,.13); }
.sgs-identity-next-h8 { font-size:.87rem; border-top:1px solid rgba(210,176,123,.28); padding-top:8px; color:#d4c4ab; }
.sgs-identity-next-limited { border-left:3px solid #d7a669; padding-left:8px; }
.sgs-identity-next-policy summary, .sgs-identity-next-status summary { cursor:pointer; min-height:36px; line-height:1.6; }
.sgs-identity-next-policy a { text-decoration:underline; text-underline-offset:3px; }
.sgs-identity-next-status details { max-width:100%; overflow-wrap:anywhere; }
.sgs-identity-next-choices button:focus-visible, .sgs-identity-next-policy summary:focus-visible, .sgs-identity-next-status summary:focus-visible { outline:3px solid #f4dba5; outline-offset:3px; }
@media(max-width:540px){.sgs-identity-next-material { flex-basis:125px; min-width:0; }.sgs-identity-next-context p{font-size:.92rem;}.sgs-identity-next-choices .dialog-actions{gap:9px;}}
/* Future classic identity: readable provenance and private, touch-safe response materials. */
.sgs-future-identity-context, .sgs-future-identity-policy, .sgs-future-identity-status { overflow-wrap:anywhere; }
.sgs-future-identity-context p, .sgs-future-identity-policy li, .sgs-future-identity-status p { line-height:1.65; }
.sgs-future-identity-choices .dialog-actions { align-items:stretch; gap:12px; }
.sgs-future-identity-choices section { display:flex; flex-direction:column; gap:7px; min-width:0; max-width:100%; }
.sgs-future-identity-choices button { min-height:44px; white-space:normal; overflow-wrap:anywhere; }
.sgs-future-identity-material { min-width:130px; flex:1 1 145px; }
.sgs-future-identity-policy summary { cursor:pointer; min-height:44px; line-height:1.6; }
.sgs-future-identity-policy a { text-decoration:underline; text-underline-offset:3px; }
.sgs-future-identity-context small, .sgs-future-identity-status small { display:block; margin-top:7px; line-height:1.6; }
.sgs-future-identity-choices button:focus-visible, .sgs-future-identity-policy summary:focus-visible, .sgs-future-identity-policy a:focus-visible { outline:3px solid #f4dba5; outline-offset:3px; }
@media(max-width:540px){.sgs-future-identity-material { flex-basis:125px; min-width:0; }.sgs-future-identity-context p{font-size:.92rem;}.sgs-future-identity-choices .dialog-actions{gap:9px;}}
