/*
 * /account/help — TECH-5710
 *
 * Every colour here already exists in shop_1.2.css; nothing new is introduced.
 *   #000 #333 #5d5d5d #60605c  ink
 *   #cacaca #e5e5e5            rules
 *   #f6f6f6                    surface
 *   #ab0000                    accent, attention states only
 *
 * The shop serves three precompiled breakpoint bundles (TemplateBase.tml) with different px
 * values in each. That is a reason not to add px literals to THOSE files - it is not a reason
 * to avoid a media query HERE, because this is a separate stylesheet and a @media in it is
 * unaffected by them. Sizing is still flow, gap and relative units.
 *
 * DO NOT put class="help" on #content either. shop_1.2.css already owns a bare `.help` rule for a
 * small tooltip trigger:
 *     .help { background:url(//s.milleporte.com/webapp/images/help.png) no-repeat right 4px;
 *             padding:0 18px 0 0; display:inline-block; cursor:pointer }
 * On #content that paints a stray question-mark badge at the top right, puts cursor:pointer over the
 * whole page, and — worse — makes #content INLINE-BLOCK, i.e. shrink-to-fit. Every class in this file
 * is prefixed `help-` for that reason. A bare, generic class name in this codebase is already taken.
 *
 * DO NOT reintroduce `container-type` on #content. It was here, and it took the help page down
 * in production: .account-wrap is a Pure FLEX grid and .account-main is a flex item with no
 * explicit width in the loaded bundles, so it shrink-to-fits. `container-type: inline-size`
 * implies `contain: inline-size`, which makes this element contribute NOTHING to that
 * calculation - the column collapsed to about 40px and every line wrapped to one character.
 * A container query would need its own full-width wrapper inside the flex item; a media query
 * needs nothing.
 */

/* ---------- search ---------- */
.help-search {
    position: relative;
    margin: 0 0 8px;
}

.help-search--input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px 13px 42px;
    border: 1px solid #cacaca;
    border-radius: 2px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 15px;
}

.help-search--input::placeholder {
    color: #9a9a94;
}

.help-search--input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.help-search--icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    fill: none;
    stroke: #5d5d5d;
    stroke-width: 1.6;
    pointer-events: none;
}

.help-count {
    margin: 0 0 24px;
    min-height: 1.6em;
    color: #5d5d5d;
    font-size: 12px;
}

.help-count b {
    color: #000;
    font-weight: bold;
}

/* ---------- keyword chips ---------- */
.help-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.help-chips--label {
    align-self: center;
    margin-right: 2px;
    color: #5d5d5d;
    font-size: 11px;
    letter-spacing: 0.1em;
}

.help-chip {
    padding: 5px 14px;
    border: 1px solid #cacaca;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.help-chip:hover {
    border-color: #000;
}

.help-chip[aria-pressed="true"] {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* ---------- groups ---------- */
.help-group--title {
    margin: 22px 0 10px;
    padding: 0;
    color: #60605c;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.help-group--count {
    margin-left: 8px;
    color: #cacaca;
    font-weight: normal;
    letter-spacing: 0;
}

.help-group[hidden] {
    display: none;
}

/*
 * Both anchor targets get room above them. Without this the browser puts the element's top edge at
 * the very top of the viewport, so a section lands with its heading flush against the chrome and the
 * first question reads as the thing you jumped to. Clicking 返品 should show 返品について.
 */
.help-group,
.help-qa {
    scroll-margin-top: 24px;
}

/* ---------- question / answer ---------- */
.help-qa {
    border-top: 1px solid #e5e5e5;
}

.help-qa:last-child {
    border-bottom: 1px solid #e5e5e5;
}

.help-qa[hidden] {
    display: none;
}

.help-qa--q {
    display: flex;
    list-style: none;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 15px 2px;
    border: 0;
    background: none;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
    cursor: pointer;
}

/* Both are needed to drop the native disclosure triangle; we draw our own caret. */
.help-qa--q::-webkit-details-marker {
    display: none;
}

.help-qa--q::marker {
    content: "";
}

.help-qa--q:hover {
    color: #000;
}

.help-qa--q:focus-visible {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.help-qa--mark {
    flex: none;
    width: 1em;
    color: #cacaca;
    font-size: 12px;
}

.help-qa[open] .help-qa--mark {
    color: #ab0000;
}

.help-qa--text {
    flex: 1;
}

.help-qa--caret {
    flex: none;
    align-self: center;
    width: 9px;
    height: 9px;
    border-right: 1.4px solid #5d5d5d;
    border-bottom: 1.4px solid #5d5d5d;
    transform: rotate(45deg) translate(-2px, -2px);
}

.help-qa[open] .help-qa--caret {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* No display rule here on purpose: showing and hiding the answer is <details>' job. The previous
   version used a class the JS toggled, so with JavaScript off the page showed 83 questions and not
   one answer — and the per-question pages were the only way to read anything (TECH-5720). */
.help-qa--a {
    padding: 0 2px 20px 27px;
    color: #5d5d5d;
    font-size: 13.5px;
    line-height: 1.9;
}

.help-qa--a p {
    margin: 0 0 0.9em;
}

.help-qa--a a {
    color: #000;
}

.help-qa--a ul {
    list-style: disc;
}

.help-qa--a ol {
    list-style: decimal;
}

.help-qa--a li {
    margin: 0 0 0.5em 1em;
    padding-left: 1em;
}

/* Answers carry authored tables; they must scroll inside the answer, never widen the page. */
.help-qa--a table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}



.help-empty {
    padding: 30px 2px;
    color: #5d5d5d;
    font-size: 13.5px;
}

.help-empty[hidden] {
    display: none;
}

/* ---------- contact card ---------- */
.help-desk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 34px 0 0;
    padding: 20px 22px;
    border: 1px solid #cacaca;
}

.help-desk--text {
    margin: 0;
    color: #333;
    font-size: 13.5px;
}

.help-desk--text b {
    display: block;
    margin-bottom: 2px;
    color: #000;
}

.help-desk--btn {
    margin-left: auto;
    padding: 10px 22px;
    border-radius: 2px;
    background: #000;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.help-desk--btn:hover {
    background: #2a2a2a;
}

/* ---------- deep-link topic list, unchanged in substance ---------- */
.help-topic ul {
    list-style: disc;
}

.help-topic li {
    margin: 0 0 0.5em 1em;
    padding-left: 1em;
}

.help-topic a.active {
    color: #000;
}

/* ---------- narrow column ---------- */
@media (max-width: 520px) {
    /* 16px exactly: iOS Safari zooms the page when a focused input is below 16px. */
    .help-search--input {
        padding: 12px 14px 12px 40px;
        font-size: 16px;
    }

    .help-chips--label {
        width: 100%;
        margin-bottom: 2px;
    }

    .help-chip {
        padding: 7px 14px;
    }

    .help-qa--q {
        gap: 10px;
        min-height: 44px;
        padding: 14px 2px;
    }

    .help-qa--a {
        padding-left: 22px;
        font-size: 14px;
    }

    .help-desk {
        flex-direction: column;
        align-items: stretch;
    }

    .help-desk--btn {
        margin-left: 0;
        padding: 13px 22px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-qa--caret {
        transition: none;
    }
}

/* ---------- layout: this page owns its wrapper ---------- */
/*
 * Deliberately NOT Account/Wrap. That component exists to put the shared account menu beside a
 * content column, and the shop styles its items as a stack of grey CENTRED buttons
 * (.account-nav li { text-align:center; background-color:#f6f6f6 }). A table of contents is not a
 * row of buttons, so using it meant overriding the shared component's own styling from here —
 * and touching a component every other account page renders. Owning ~15 lines of grid instead
 * leaves AccountWrap completely untouched.
 *
 * Reproduces what AccountWrap actually provided: a 980px centred container with 1em side padding.
 */
.help-wrap {
    box-sizing: border-box;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1em;
}

.help-main {
    min-width: 0; /* a grid item defaults to min-content; without this a wide answer table stretches the page */
}

/* ---------- table of contents ---------- */
/*
 * Hidden below the two-column breakpoint rather than stacked. On a phone a nine-item list above 83
 * questions is just more to scroll past, and the back-to-top below is the affordance that actually
 * helps there.
 */
.help-nav {
    display: none;
}

@media (min-width: 1024px) {
    .help-wrap {
        display: grid;
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 40px;
        align-items: start;
    }

    /* Follows the reader down a 5,500px page, which is what makes the scroll-spy worth having. */
    .help-nav {
        display: block;
        position: sticky;
        top: 20px;
        /* Lines the list up with the page title rather than the top of the column. */
        padding-top: 74px;
    }
}

/* ---------- page title lines up with the shop's left menu ---------- */
/*
 * The first item of the global left menu (SALES :) sits this far below the top of #main:
 *     aside#desktop-side-menu {padding-top}  +  aside#desktop-side-menu nav ul li {margin-top}
 * and BOTH are precompiled px that differ per breakpoint bundle. TemplateBase.tml serves
 * smallScreen.css / mediumScreen.css / shop_1.2.css at max-width:1328 / 1329-1490 / min-width:1491,
 * and the sum is 31.1 / 38.6 / 42.1px respectively.
 *
 * There is no em basis to borrow. What changes per band is the ASIDE's font-size (10.56 / 13.10 /
 * 14.29px) while this column stays 14px at every width, so an em value here would not track. Hence
 * the offset is restated once per band against the shop's OWN breakpoints - change one and the
 * other must change with it.
 *
 * The extra ~2-3px over the raw sum aligns the two text boxes rather than the two border boxes:
 * the h1 is 22px/28px and the menu item 10-13.5px, so their half-leading differs.
 *
 * Below 1151px the menu is off-canvas (position:fixed, left:-186px) - there is nothing to line up
 * with, so no padding is added there.
 */
@media (min-width: 1151px) {
    .help-wrap {
        padding-top: 33px;
    }
}

@media (min-width: 1329px) {
    .help-wrap {
        padding-top: 41px;
    }
}

@media (min-width: 1491px) {
    .help-wrap {
        padding-top: 45px;
    }
}

.help-toc--title {
    margin: 0 0 10px;
    color: #60605c;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.help-toc {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid #e5e5e5;
}

.help-toc li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-toc a {
    display: block;
    padding: 7px 0 7px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: #5d5d5d;
    font-size: 12.5px;
    line-height: 1.5;
    text-decoration: none;
}

.help-toc a:hover {
    color: #000;
}

/* Set by the scroll-spy in help.js; no :has() or :target trick survives the search filtering. */
.help-toc a[aria-current="true"] {
    border-left-color: #ab0000;
    color: #000;
    font-weight: bold;
}

.help-toc--contact {
    margin-top: 10px;
}

/* ---------- back to top ---------- */
.help-totop {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 10px 12px;
    border: 1px solid #cacaca;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.96);
    color: #333;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.help-totop[hidden] {
    display: none;
}

.help-totop:hover {
    border-color: #000;
    color: #000;
}

.help-totop:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.help-totop--arrow {
    width: 8px;
    height: 8px;
    border-top: 1.4px solid currentColor;
    border-right: 1.4px solid currentColor;
    transform: rotate(-45deg);
}

@media (max-width: 520px) {
    .help-totop {
        right: 12px;
        bottom: 14px;
        padding: 12px 13px;
    }
}
