/* The account area: My orders, My characters, AI credits, Profile.
   Every colour is a --gk2-* token, so a shop's brand theme (theme-koala.css)
   re-colours these pages with no rule of its own. Logical properties only:
   the Persian shop lays all of it out right to left. */

.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0 0 10px;
    border-block-end: 1px solid var(--gk2-line, #e3ddd0);
}
.account-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--gk2-ink-soft, #5b6578);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.account-tabs a:hover { background: rgb(var(--gk2-ink-rgb, 34 48 74) / 0.06); color: var(--gk2-ink, #22304a); }
.account-tabs a[aria-current="page"] {
    background: var(--gk2-sun, #f7c948);
    color: var(--gk2-ink, #22304a);
}
.account-tabs__count {
    min-width: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gk2-white, #fff);
    font-size: 0.8rem;
    text-align: center;
}

.account-page { padding: 32px 0 60px; }
.account-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 18px;
}
.account-head h1 { margin: 0; font-size: 1.9rem; }
.account-lead { color: var(--gk2-ink-soft, #5b6578); margin: 0 0 20px; max-width: 60ch; }

/* ---- the character shelf ---------------------------------------------- */
.char-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}
.char-card {
    display: flex;
    flex-direction: column;
    background: var(--gk2-white, #fff);
    border: 1px solid var(--gk2-line, #e3ddd0);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--gk2-ledge, none);
}
.char-card__art {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: var(--gk2-paper, #fdfbf5);
    overflow: hidden;
}
.char-card__art img { width: 100%; height: 100%; object-fit: cover; }
.char-card__art svg { width: 86%; height: 86%; }
.char-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.char-card__name { font-weight: 700; font-size: 1.05rem; margin: 0; }
.char-card__meta { font-size: 0.85rem; color: var(--gk2-ink-soft, #5b6578); margin: 0; }
.char-card__actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.char-card--new {
    align-items: center;
    justify-content: center;
    min-height: 240px;
    border-style: dashed;
    color: var(--gk2-ink-soft, #5b6578);
    text-decoration: none;
    font-weight: 700;
    gap: 10px;
}
.char-card--new span.plus {
    width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center; font-size: 30px; line-height: 1;
    background: var(--gk2-sun, #f7c948); color: var(--gk2-ink, #22304a);
}

/* ---- the editor --------------------------------------------------------- */
.char-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 820px) { .char-editor { grid-template-columns: minmax(0, 1fr); } .char-editor__aside { order: -1; } }
.char-editor__aside {
    position: sticky;
    top: 90px;
    background: var(--gk2-white, #fff);
    border: 1px solid var(--gk2-line, #e3ddd0);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
}
@media (max-width: 820px) { .char-editor__aside { position: static; } }
.char-editor__figure { aspect-ratio: 1; display: grid; place-items: center; background: var(--gk2-paper, #fdfbf5); border-radius: 14px; overflow: hidden; }
.char-editor__figure img { width: 100%; height: 100%; object-fit: cover; }
.char-editor__figure svg { width: 92%; height: 92%; }
.char-editor fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.char-editor legend, .char-editor .field-label { font-weight: 700; margin-bottom: 8px; display: block; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pill { position: relative; }
.choice-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-pill span {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    border: 1.5px solid var(--gk2-line, #e3ddd0); background: var(--gk2-white, #fff);
    font-size: 0.95rem;
}
.choice-pill input:checked + span { border-color: var(--gk2-ink, #22304a); background: rgb(var(--gk2-sun-rgb, 247 201 72) / 0.35); font-weight: 700; }
.choice-pill input:focus-visible + span { outline: 2px solid var(--gk2-ink, #22304a); outline-offset: 2px; }
.chip-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgb(var(--gk2-ink-rgb, 34 48 74) / 0.25); display: inline-block; }
.look-fields { display: grid; gap: 14px; }
.look-field select { width: 100%; max-width: 360px; }
.look-panel[hidden], .look-field[hidden] { display: none !important; }
.char-editor .form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.char-editor .error-list { background: #fdece6; border: 1px solid #e6bfae; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }

.pictures-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.picture-tile { background: var(--gk2-white, #fff); border: 1px solid var(--gk2-line, #e3ddd0); border-radius: 14px; overflow: hidden; }
.picture-tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; background: var(--gk2-paper, #fdfbf5); display: block; }
.picture-tile__meta { padding: 8px 10px; font-size: 0.82rem; color: var(--gk2-ink-soft, #5b6578); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.picture-tile__ok { color: var(--gk2-ink, #22304a); font-weight: 700; }

/* ---- credits ----------------------------------------------------------- */
.credit-wallet {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.credit-stat {
    background: var(--gk2-white, #fff);
    border: 1px solid var(--gk2-line, #e3ddd0);
    border-radius: 18px;
    padding: 16px 18px;
}
.credit-stat strong { display: block; font-size: 2rem; line-height: 1.1; }
.credit-stat small { color: var(--gk2-ink-soft, #5b6578); }
.credit-stat--main { background: rgb(var(--gk2-sun-rgb, 247 201 72) / 0.28); border-color: var(--gk2-sun-deep, #e2ac1f); }
.credit-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.credit-pack { position: relative; }
.credit-pack input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.credit-pack__card {
    display: flex; flex-direction: column; gap: 4px; height: 100%;
    padding: 16px; border-radius: 16px;
    border: 1.5px solid var(--gk2-line, #e3ddd0); background: var(--gk2-white, #fff);
}
.credit-pack__credits { font-size: 1.4rem; font-weight: 800; }
.credit-pack__price { color: var(--gk2-ink-soft, #5b6578); }
.credit-pack input:checked + .credit-pack__card { border-color: var(--gk2-ink, #22304a); box-shadow: 0 0 0 2px var(--gk2-sun, #f7c948) inset; }
.credit-pack input:focus-visible + .credit-pack__card { outline: 2px solid var(--gk2-ink, #22304a); outline-offset: 2px; }
.credit-history { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.credit-history th, .credit-history td { text-align: start; padding: 8px 6px; border-block-end: 1px solid var(--gk2-line, #e3ddd0); }
.credit-status { padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.credit-status--pending { background: #fef3cd; color: #856404; }
.credit-status--approved { background: #d9f2e3; color: #1f6b3a; }
.credit-status--rejected { background: #fdece6; color: #9b3b22; }
.account-card {
    background: var(--gk2-white, #fff);
    border: 1px solid var(--gk2-line, #e3ddd0);
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.account-card h2 { margin-top: 0; font-size: 1.25rem; }
