:root {
    --ink: #0B2A45;
    --navy: #0F3557;
    --navy-700: #17507F;
    --legacy-blue: #0098E7;
    --brand: #0A7FCB;
    --brand-600: #0668A8;
    --brand-050: #E8F5FD;
    --brand-100: #C9E7FA;
    --purple: #7A2E8C;
    --purple-050: #F6EEF9;
    --purple-100: #E7D3EE;
    --pink: #D12D6B;
    --pink-050: #FDEEF3;
    --pink-100: #F7CCDC;
    --bg: #EEF4F9;
    --surface: #FFFFFF;
    --surface-soft: #F9FAFC;
    --border: #E1E6EE;
    --border-strong: #C3CCD9;
    --text: #1A2433;
    --text-muted: #5E6B7D;
    --focus: #0A7FCB;
    --danger: #B42318;
    --danger-bg: #FEF3F2;
    --warning: #9A6B12;
    --warning-bg: #FFF8E6;
    --info: #0668A8;
    --info-bg: #E8F5FD;
    --success: #1F7A4D;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow: 0 1px 2px rgba(15, 53, 87, .06), 0 12px 32px rgba(15, 53, 87, .12);
    --header-bg: linear-gradient(90deg, #0090DC 0%, #0072BE 100%);
    --font: "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--brand-600); }
a:hover { color: var(--navy); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1, h2, p { margin: 0; }

/* Header */
.site-header { background: var(--header-bg); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }

.site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__name { font-size: 17px; font-weight: 700; letter-spacing: .02em; display: inline-flex; align-items: baseline; gap: 6px; }
.brand__sub { font-size: 13.5px; font-weight: 400; opacity: .88; letter-spacing: 0; }
.brand__main { font-weight: 700; }

.site-header__supplier {
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
    color: rgba(255, 255, 255, .92);
}

.trial-banner {
    padding: 10px 24px;
    background: var(--warning-bg);
    color: var(--text);
    text-align: center;
    border-bottom: 1px solid #F1DFB0;
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 12px 24px;
    background: var(--header-bg);
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    text-align: center;
}

/* Guest */
.guest-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 420px at 15% 0%, rgba(0, 152, 231, .14), transparent 70%),
        radial-gradient(700px 360px at 100% 100%, rgba(15, 53, 87, .08), transparent 70%),
        var(--bg);
}

/* Login: brand panel + form */
.auth-panel {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-panel__aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 36px;
    color: #fff;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(94, 200, 255, .45), transparent 70%),
        linear-gradient(160deg, #0090DC 0%, #005A9E 100%);
}

.auth-panel__eyebrow { font-size: 13px; color: rgba(255, 255, 255, .72); letter-spacing: .04em; }
.auth-panel__name { margin-top: 4px; font-size: 32px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }

.auth-panel__notices { display: grid; gap: 12px; }

.aside-notice {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .86);
}
.aside-notice p + p { margin-top: 4px; }
.aside-notice__title { margin-bottom: 2px; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .04em; }
.aside-notice--plain { padding: 0 2px; background: none; border: 0; color: rgba(255, 255, 255, .68); }
.aside-notice--warning { background: rgba(250, 204, 21, .12); border-color: rgba(250, 204, 21, .4); }

/* Login card (also used standalone by the maintenance page) */
.login {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
    display: grid;
    align-content: center;
    gap: 18px;
}
.auth-panel .login-card { border: 0; border-radius: 0; box-shadow: none; padding: 36px; }

.login-card--center { text-align: center; justify-items: center; }
.login-card__icon { color: var(--brand); }
.login-card__title { font-size: 22px; font-weight: 700; color: var(--navy); }
.login-card__lead { margin-top: 4px; color: var(--text-muted); }
.login-card__footnote { font-size: 12px; color: var(--text-muted); text-align: center; }

.maintenance-period { font-weight: 700; }

/* Stepper */
.stepper {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stepper__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.stepper__badge {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    font-size: 12px;
    background: var(--surface);
}

.stepper__item.is-current { color: var(--brand-600); }
.stepper__item.is-current .stepper__badge { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-050); }
.stepper__item.is-done { color: var(--success); }
.stepper__item.is-done .stepper__badge { background: var(--success); border-color: var(--success); color: #fff; }

.stepper__line { flex: 1; height: 1.5px; background: var(--border); }

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.alert:focus { outline: none; }
.alert--error { background: var(--danger-bg); border-color: #FBD5D1; color: var(--danger); }
.alert--info { background: var(--info-bg); border-color: var(--brand-100); color: var(--info); }
.alert--success { background: #ECF8F1; border-color: #BFE5CF; color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: #F1DFB0; color: #6B4A0C; }
.alert__list { margin: 0; padding-left: 18px; }

/* Forms */
.form { display: grid; gap: 16px; }

.form__hint { color: var(--text-muted); font-size: 13px; }

.field { display: grid; gap: 6px; }

.field__label { font-weight: 600; font-size: 13px; }

.field__control { position: relative; }

.field__input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.field__control .field__input { padding-right: 44px; }
.field__input:hover { border-color: #9AA6B6; }
.field__input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 127, 203, .2); }
.field.has-error .field__input { border-color: var(--danger); }
.field.has-error .field__input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }

.field__error { color: var(--danger); font-size: 13px; }

.field__toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.field__toggle:hover { color: var(--brand-600); background: var(--brand-050); }
.field__toggle .icon-eye-off { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye-off { display: block; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn--block { width: 100%; min-height: 44px; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(15, 53, 87, .12), 0 6px 16px rgba(10, 127, 203, .28); }
.btn--primary:hover { background: var(--brand-600); color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--navy); }
.btn--ghost:hover { background: var(--brand-050); border-color: var(--brand-100); color: var(--brand-600); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--on-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .32); color: #fff; }
.btn--on-dark:hover { background: rgba(255, 255, 255, .16); }
.btn--danger-ghost { background: var(--surface); border-color: #F3C2BC; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn[disabled][title] { cursor: not-allowed; }
.btn[hidden] { display: none; }

.link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* Company chip (login step 2) */
.company-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--brand-050);
    border: 1px solid var(--brand-100);
}
.company-chip__body { display: grid; gap: 2px; min-width: 0; }
.company-chip__label { font-size: 12px; color: var(--text-muted); }
.company-chip__name { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.company-chip__id { font-size: 12px; color: var(--text-muted); }

/* Authenticated shell */
.site-header--app { position: sticky; top: 0; z-index: 40; }
.site-header--app .site-header__inner { max-width: none; flex-wrap: nowrap; padding-block: 8px; }

.nav-toggle {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .28); }
.nav-toggle__icon--close { display: none; }
body.is-nav-open .nav-toggle__icon--open { display: none; }
body.is-nav-open .nav-toggle__icon--close { display: block; }

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    padding: 0;
    background: rgba(11, 42, 69, .45);
    cursor: pointer;
}
.nav-backdrop[hidden] { display: none; }

.account { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: 13px; }
.account__who { display: flex; align-items: center; gap: 10px; }
.account__avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB547, #F07B22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
    font-weight: 700;
}
.account__names { display: grid; line-height: 1.4; }
.account__company { font-weight: 700; }
.account__user { color: rgba(255, 255, 255, .78); }
.account__links { display: flex; align-items: center; gap: 16px; padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, .18); white-space: nowrap; }
.account__links a { color: rgba(255, 255, 255, .88); text-decoration: none; }
.account__links a:hover { color: #fff; text-decoration: underline; }

.shell {
    flex: 1;
    width: 100%;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidenav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px 20px;
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.sidenav__masthead { display: contents; }
.sidenav__bar,
.sidenav__identity,
.sidenav__quicklinks { display: none; }
.sidenav__group + .sidenav__group { margin-top: 18px; }
.sidenav__heading {
    margin: 0 12px 4px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    color: #6B7C90;
    letter-spacing: .08em;
}
.sidenav__service {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 12px;
    font-weight: 700;
    color: var(--navy);
}
.sidenav__icon { flex: none; color: var(--brand); }
.sidenav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.sidenav__link--sub { padding-left: 36px; font-size: 13px; color: #3D4A5C; }
.sidenav__link--sub::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.sidenav__link:hover { background: var(--surface-soft); color: var(--brand-600); }
.sidenav__link.is-active {
    background: var(--brand-050);
    color: var(--brand-600);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--brand);
}
.sidenav__link.is-active .sidenav__icon { color: var(--brand); }

.sidenav__support {
    margin-top: auto;
    padding: 14px 12px 0;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}
.sidenav__support-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }

.content {
    padding: 24px 28px 48px;
    min-width: 0;
    background:
        radial-gradient(800px 260px at 100% 0%, rgba(0, 152, 231, .10), transparent 70%),
        var(--bg);
}

/* Home: notices */
.notice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.notice-toolbar__title { font-size: 16px; font-weight: 700; color: var(--navy); }
.notice-toolbar__actions { display: flex; gap: 8px; }

.notice-list { display: grid; gap: 10px; }

.notice-heading {
    --tone: var(--brand);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 9px 16px;
    border-radius: var(--radius);
    background: var(--tone);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--tone) 25%, transparent);
}
.notice-list > .notice-heading:first-child { margin-top: 0; }
.notice-heading--purple { --tone: var(--purple); }
.notice-heading--blue { --tone: var(--brand); }
.notice-heading--pink { --tone: var(--pink); }

.notice-item {
    --tone: var(--brand);
    --tone-050: var(--brand-050);
    --tone-100: var(--brand-100);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--tone);
    border-radius: var(--radius-lg);
    transition: box-shadow .15s, border-color .15s;
}
.notice-item--purple { --tone: var(--purple); --tone-050: var(--purple-050); --tone-100: var(--purple-100); }
.notice-item--pink { --tone: var(--pink); --tone-050: var(--pink-050); --tone-100: var(--pink-100); }
.notice-item:hover { border-color: var(--tone-100); border-left-color: var(--tone); box-shadow: 0 4px 14px rgba(15, 53, 87, .08); }

.notice-item__summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    cursor: pointer;
    list-style: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.notice-item__summary::-webkit-details-marker { display: none; }
.notice-item[open] .notice-item__summary { background: var(--tone-050); border-radius: 0 var(--radius-lg) 0 0; }

.notice-item__title { flex: 1; min-width: 0; font-weight: 600; color: var(--tone); }
.notice-item__title.is-bold { font-weight: 700; }
.notice-item__date {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--tone-050);
    color: var(--tone);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.notice-item[open] .notice-item__date { background: var(--surface); }
.notice-item__chevron { flex: none; color: var(--tone); transition: transform .2s; }
.notice-item[open] .notice-item__chevron { transform: rotate(180deg); }

.notice-item__body {
    padding: 14px 18px 16px;
    border-top: 1px solid var(--tone-100);
    color: var(--text);
    line-height: 1.8;
    overflow-x: auto;
}
.notice-item__body img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 4px rgba(15, 53, 87, .15); }
.notice-item__body a { color: var(--brand-600); }

/* スクロールアンカーが効くと、追加読み込みのたびに画面が下へ送られて連続で読み込んでしまう。 */
html:has(.notice-more) { overflow-anchor: none; }
.notice-more { display: grid; justify-items: center; gap: 6px; margin-top: 16px; }
.notice-more__status { font-size: 13px; color: var(--text-muted); min-height: 1.5em; }

.inquiry {
    margin-top: 28px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--purple-100);
    overflow: hidden;
}
.inquiry__title { padding: 9px 16px; background: var(--purple); color: #fff; font-size: 14px; font-weight: 700; }
.inquiry__body { display: grid; gap: 4px; padding: 14px 18px 18px; }
.inquiry__contact {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--purple-050);
    font-weight: 600;
}

/* Page building blocks */
.page-head { margin-bottom: 16px; }
.page-head__eyebrow { margin: 0; font-size: 12px; font-weight: 600; color: var(--brand-600); letter-spacing: .04em; }
.page-head__title { margin: 2px 0 0; font-size: 20px; font-weight: 700; color: var(--navy); }
.page-head__lead { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.page-messages { display: grid; gap: 8px; margin-bottom: 16px; }
.page-messages:empty { display: none; }

.panel {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.panel + .panel { margin-top: 12px; }
.panel__title { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--navy); }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--border); }
.segmented__item {
    padding: 6px 16px;
    border-radius: 7px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.segmented__item:hover { background: var(--purple-050); color: var(--purple); }
.segmented__item.is-active { background: var(--purple); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--purple) 30%, transparent); }

.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; cursor: pointer; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 600;
    transition: background-color .15s, border-color .15s, color .15s;
}
.choice-chip:hover span { border-color: var(--purple); color: var(--purple); }
.choice-chip input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.choice-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    padding: 10px 12px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table__check { width: 44px; text-align: center; }
.data-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--purple); cursor: pointer; }
.data-table .is-muted { color: var(--text-muted); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 8px; font-size: 13px; }
.pager__summary { margin: 0; color: var(--text-muted); }
.pager__links { display: flex; flex-wrap: wrap; gap: 4px; }
.pager__link {
    min-width: 32px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    text-align: center;
    text-decoration: none;
}
.pager__link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 40px 16px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
}
.empty-state svg { color: var(--border-strong); }

.dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(11, 42, 69, .45); }
.dialog__body { display: grid; gap: 12px; padding: 18px 20px 20px; }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.dialog__close {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.dialog__close:hover { background: var(--surface-soft); color: var(--navy); }
.dialog__hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; }
.dialog[open] { animation: dialog-in .18s ease-out; }
.dialog[open]::backdrop { animation: backdrop-in .18s ease-out; }

.dialog--picker { width: min(480px, calc(100vw - 32px)); }
.dialog--picker .dialog__body { gap: 14px; padding: 0 0 18px; }
.dialog--picker .dialog__head {
    align-items: center;
    padding: 16px 16px 14px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--purple-050) 0%, var(--surface) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dialog--picker .dialog__body > :not(.dialog__head) { margin-inline: 20px; }
.dialog__icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--purple);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--purple) 30%, transparent);
}
.dialog__heading { flex: 1; min-width: 0; display: grid; gap: 4px; }
.dialog__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--text-muted); }
.dialog__meta b { color: var(--navy); font-variant-numeric: tabular-nums; }
.dialog__tag { padding: 1px 8px; border: 1px solid var(--purple-100); border-radius: 999px; background: var(--surface); color: var(--purple); font-weight: 700; }
.dialog__notice {
    margin: 0;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--warning-bg);
    color: var(--warning);
    font-size: 12px;
}
.dialog__error { margin: 0; font-size: 12px; font-weight: 600; color: var(--danger); }
.dialog--picker .dialog__foot { padding-top: 14px; border-top: 1px solid var(--border); margin-inline: 0; padding-inline: 20px; }

.month-picker { display: grid; gap: 12px; max-height: min(52vh, 360px); overflow-y: auto; overscroll-behavior: contain; }
.month-picker__year { display: grid; grid-template-columns: 52px 1fr; align-items: start; gap: 10px; }
.month-picker__year-label {
    position: sticky;
    top: 0;
    margin: 0;
    padding-top: 9px;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}
.month-picker__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}
.month-picker__counter {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--purple-050);
    color: var(--purple);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.month-picker__counter.is-full { background: var(--purple); color: #fff; }
.month-picker__counter.is-shaking { animation: shake .36s ease-in-out; }
.month-picker__chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.month-picker__placeholder { font-size: 12px; color: var(--text-muted); }
.month-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 10px;
    border: 1px solid var(--purple-100);
    border-radius: 999px;
    background: var(--surface);
    color: var(--purple);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.month-picker__chip button {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.month-picker__chip button:hover { background: var(--purple-050); }

.month-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.month-grid__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, transform .12s;
}
.month-grid__item:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-050); }
.month-grid__item:active { transform: scale(.97); }
.month-grid__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.month-grid__item[aria-pressed="true"] {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--purple) 30%, transparent);
}
.month-grid__item:disabled { background: #EEF0F3; border-color: #EEF0F3; color: #A3ABB6; cursor: not-allowed; transform: none; }

.sb-modal {
    width: min(400px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    --tone: var(--brand);
    --tone-bg: var(--info-bg);
}
.sb-modal[open] { animation: dialog-in .18s ease-out; }
.sb-modal::backdrop { background: rgba(11, 42, 69, .45); }
.sb-modal[open]::backdrop { animation: backdrop-in .18s ease-out; }
.sb-modal--warning { --tone: var(--warning); --tone-bg: var(--warning-bg); }
.sb-modal--danger { --tone: var(--danger); --tone-bg: var(--danger-bg); }
.sb-modal__body { display: flex; gap: 14px; padding: 22px 22px 6px; }
.sb-modal__icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--tone-bg);
    color: var(--tone);
}
.sb-modal__text { display: grid; gap: 6px; min-width: 0; padding-top: 2px; }
.sb-modal__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.sb-modal__message { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.sb-modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.sb-modal__foot .btn { min-width: 88px; }

@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
    .dialog[open], .dialog[open]::backdrop, .sb-modal[open], .sb-modal[open]::backdrop, .month-picker__counter.is-shaking { animation: none; }
}

/* 分析レポート作成指示 */
.rms-filter { display: grid; gap: 12px; margin-bottom: 12px; }
.rms-filter__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.rms-filter__label { flex: none; width: 56px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.rms-filter__input { flex: 1 1 260px; max-width: 420px; height: 36px; }
.rms-filter__actions { display: flex; gap: 8px; }
.rms-filter__extra { margin-left: auto; }

.rms-pattern { margin-bottom: 12px; }

.rms-actionbar {
    position: sticky;
    top: var(--app-header-offset, 56px);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 18px rgba(15, 53, 87, .08);
    backdrop-filter: blur(6px);
}
.rms-actionbar__lead { margin: 0; font-size: 13px; font-weight: 700; color: var(--navy); }
.rms-actionbar__count { margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--purple-050); color: var(--purple); font-weight: 600; }
.rms-actionbar__buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.rms-actionbar__buttons--end { margin-left: auto; }

.rms-table tbody tr { cursor: pointer; }
.rms-table tbody tr.is-selected { background: var(--purple-050); box-shadow: inset 3px 0 0 var(--purple); }
.rms-table__name { font-weight: 600; color: var(--navy); }

.mall-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--brand-050); color: var(--brand-600); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mall-badge--001 { background: #FDECEC; color: #BF1E2D; }
.mall-badge--002 { background: #FFF1E6; color: #C2410C; }
.mall-badge--013 { background: #ECF8F1; color: var(--success); }

.rms-filter__label--wide { width: 84px; }
.rms-filter--download {
    padding: 16px 20px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(16, 42, 76, .04);
}
.rms-filter--download .panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.rms-filter--download .panel__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
}
.rms-filter--download form {
    display: grid;
    gap: 12px;
}
.rms-filter--download .rms-filter__row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.rms-filter--download .rms-filter__label {
    flex: 0 0 88px;
    width: 88px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.3;
    white-space: nowrap;
}
.rms-filter--download .rms-filter__input {
    flex: 0 0 auto;
    width: 100%;
    max-width: 380px;
    height: 36px;
}
.rms-filter--download .field__input {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.rms-filter--download .field__input:hover {
    border-color: #9AA6B6;
}
.rms-filter--download .field__input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.rms-filter--download .rms-download__period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.rms-filter--download .rms-download__select-year {
    width: 110px;
}
.rms-filter--download .rms-download__select-month {
    width: 84px;
}
.rms-filter--download .rms-download__unit {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.rms-filter--download .rms-download__period--range {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.rms-filter--download .rms-download__period--range input[type="date"],
.rms-filter--download .rms-download__period--range .rms-download__date {
    width: 175px;
    height: 36px;
    font-variant-numeric: tabular-nums;
}
.rms-filter--download .rms-download__sep {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.rms-filter--download .rms-filter__actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.rms-filter--download .rms-filter__actions-row .btn {
    min-width: 96px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
}
.rms-download__when { display: grid; font-variant-numeric: tabular-nums; }
.rms-download__when span { color: var(--text-muted); font-size: 12px; }
.rms-download__span { display: block; color: var(--text-muted); font-size: 12px; }
.rms-status { font-weight: 700; }
.rms-status--done { color: var(--success); }
.rms-status--running { color: var(--warning); }
.rms-download-table td form { margin: 0; }

.rms-notes { display: grid; gap: 10px; margin-top: 20px; }
.rms-note {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.7;
}
.rms-note p { margin: 0; }
.rms-note--warning { background: var(--warning-bg); border-color: #F1DFB0; border-left-color: #D4A017; }
.rms-note__title { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--navy); }
.rms-note__list { margin: 4px 0 0; padding-left: 20px; }
.rms-note__foot { margin-top: 6px !important; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

@media (min-width: 961px) {
    .sidenav {
        position: sticky;
        top: var(--app-header-offset, 56px);
        align-self: start;
        max-height: calc(100dvh - var(--app-header-offset, 56px));
        overflow: auto;
    }
}

@media (max-width: 960px) {
    .app { --app-footer-h: 52px; padding-bottom: var(--app-footer-h); }
    .site-header--app {
        position: sticky;
        top: 0;
        z-index: 50;
        background: var(--header-bg);
        box-shadow: 0 2px 8px rgba(11, 42, 69, .18);
    }
    .nav-toggle { display: inline-flex; }
    .site-header--app .site-header__inner { gap: 8px; padding: 6px 12px; }
    .site-header--app .brand { min-width: 0; flex: 1; }
    .site-header--app .brand__name {
        display: flex;
        align-items: baseline;
        gap: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
    }
    .account { flex: none; gap: 8px; margin-left: 0; }
    .account__links { gap: 8px; padding-left: 8px; }
    .account__links a { display: none; }

    .shell { display: block; }
    .nav-backdrop { z-index: 60; }
    .app .sidenav {
        position: fixed;
        z-index: 70;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(300px, 86vw);
        padding-top: 0;
        border-right: 1px solid var(--border);
        transform: translateX(-105%);
        visibility: hidden;
        overflow: auto;
        transition: transform .2s ease;
    }
    .sidenav__masthead {
        display: block;
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 -12px 14px;
        padding: 10px 12px 14px;
        color: #fff;
        background:
            radial-gradient(180px 90px at 100% 0%, rgba(255, 255, 255, .28), transparent 70%),
            linear-gradient(120deg, #0098E7 0%, #0A7FCB 100%);
    }
    .sidenav__bar {
        display: flex;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        background: transparent;
    }
    .sidenav__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, .18);
        color: #fff;
        cursor: pointer;
    }
    .sidenav__close:hover { background: rgba(255, 255, 255, .32); }
    body.is-nav-open .sidenav {
        transform: none;
        visibility: visible;
        box-shadow: 8px 0 24px rgba(15, 53, 87, .18);
    }
    .sidenav__identity {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 8px 0 0;
        padding: 0;
        border-bottom: 0;
    }
    .sidenav__identity-names { display: grid; min-width: 0; line-height: 1.4; }
    .sidenav__identity-company { font-weight: 700; color: #fff; }
    .sidenav__identity-user { color: rgba(255, 255, 255, .86); font-size: 12px; }
    .sidenav__quicklinks { display: grid; gap: 2px; margin-bottom: 14px; }

    .content { padding: 16px 16px 28px; }
    .app .site-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: center;
        height: var(--app-footer-h, 52px);
        padding: 6px 16px;
        line-height: 1.35;
    }

    .notice-toolbar { flex-wrap: wrap; }
    .notice-item__summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title chevron" "date chevron";
        align-items: center;
        column-gap: 12px;
        row-gap: 6px;
    }
    .notice-item__title { grid-area: title; }
    .notice-item__date { grid-area: date; justify-self: start; }
    .notice-item__chevron { grid-area: chevron; }
}

@media (max-width: 640px) {
    .site-header--app .brand__sub { display: none; }
    .site-header--app .brand__main { font-size: 16px; font-weight: 800; }
    .account__names { display: none; }
    .account__links { border-left: 0; padding-left: 0; }
    .notice-item__summary { padding: 12px 14px; }
    .notice-heading { font-size: 13px; }

    .panel { padding: 14px; }
    .rms-filter__label { width: auto; }
    .rms-filter__input { flex-basis: 100%; max-width: none; }
    .rms-filter__extra { margin-left: 0; }
    .rms-actionbar { padding: 10px; }
    .rms-actionbar__buttons, .rms-actionbar__buttons--end { width: 100%; margin-left: 0; }
    .rms-actionbar__buttons .btn { flex: 1 1 calc(50% - 6px); padding: 0 8px; font-size: 12px; white-space: nowrap; }

    .pager {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin: 10px 0;
    }
    .pager__summary {
        font-size: 12px;
        text-align: center;
    }
    .pager__links {
        justify-content: center;
    }
    .pager__link {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        font-size: 12.5px;
    }

    .table-wrap { background: none; border: 0; border-radius: 0; overflow: visible; }
    .rms-table thead tr { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; }
    .rms-table thead th { padding: 0; background: none; border: 0; }
    .rms-table thead th:not(.data-table__check) { display: none; }
    .rms-table thead .data-table__check::after { content: "このページをすべて選択"; margin-left: 8px; font-weight: 600; color: var(--text); }
    .rms-table thead .data-table__check { display: flex; align-items: center; width: auto; }
    .rms-table tbody { display: grid; gap: 8px; }
    .rms-table tbody tr {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        padding: 10px 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
    }
    .rms-table tbody td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; grid-column: 2; padding: 3px 0; border: 0; }
    .rms-table tbody td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; }
    .rms-table tbody td > .mall-badge { justify-self: start; }
    .rms-table tbody td.data-table__check { grid-column: 1; grid-row: 1 / span 6; display: block; width: auto; padding-top: 4px; text-align: left; }
    .rms-table tbody td.data-table__check::before { content: none; }
    .rms-table tbody tr.is-selected { border-color: var(--purple-100); }

    .rms-filter--download { padding: 14px 16px; }
    .rms-filter--download form { gap: 12px; }
    .rms-filter--download .rms-filter__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .rms-filter--download .rms-filter__label {
        flex: none;
        width: auto;
        font-size: 12.5px;
    }
    .rms-filter--download .rms-filter__input {
        width: 100%;
        max-width: none;
        height: 36px;
    }
    .rms-filter--download .rms-download__period {
        display: flex;
        width: 100%;
        gap: 6px;
    }
    .rms-filter--download .rms-download__select-year {
        flex: 1 1 0;
        width: auto;
    }
    .rms-filter--download .rms-download__select-month {
        flex: 1 1 0;
        width: auto;
    }
    .rms-filter--download .rms-download__period--range {
        display: flex;
        flex: 1 1 100%;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 6px;
    }
    .rms-filter--download .rms-download__period--range > span,
    .rms-filter--download .rms-download__sep {
        flex: none;
    }
    .rms-filter--download .rms-download__period--range input[type="date"],
    .rms-filter--download .rms-download__period--range .rms-download__date {
        flex: 1 1 0;
        width: 1%;
        min-width: 0;
        padding: 0 6px 0 8px;
        font-size: 12px;
    }
    .rms-filter--download .rms-filter__actions-row {
        justify-content: stretch;
    }
    .rms-filter--download .rms-filter__actions-row .btn {
        flex: 1 1 0;
    }

    .rms-download-table thead { display: none; }
    .rms-download-table tbody { display: grid; gap: 10px; }
    .rms-download-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name mall"
            "report report"
            "period period"
            "when status"
            "action action";
        gap: 4px 10px;
        padding: 12px 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: 0 1px 2px rgba(15, 53, 87, .04);
    }
    .rms-download-table tbody td {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
    }
    .rms-download-table tbody td::before { content: none; }
    .rms-download-table tbody td[data-label="店舗名"] { grid-area: name; align-self: center; font-size: 15px; }
    .rms-download-table tbody td[data-label="種別"] { grid-area: mall; justify-self: end; align-self: center; }
    .rms-download-table tbody td[data-label="レポート"] { grid-area: report; color: var(--text); font-size: 13px; }
    .rms-download-table tbody td[data-label="対象年月"] { grid-area: period; color: var(--text-muted); font-size: 12px; }
    .rms-download-table tbody td[data-label="対象年月"] .rms-download__span { display: inline; margin-left: 4px; }
    .rms-download-table tbody td[data-label="処理開始日時"] { grid-area: when; align-self: center; }
    .rms-download-table tbody td[data-label="処理開始日時"] .rms-download__when {
        display: flex;
        gap: 6px;
        align-items: baseline;
        color: var(--text-muted);
        font-size: 12px;
    }
    .rms-download-table tbody td[data-label="処理開始日時"] .rms-download__when span { color: inherit; font-size: inherit; }
    .rms-download-table tbody td[data-label="ステータス"] { grid-area: status; justify-self: end; align-self: center; font-size: 12px; text-align: right; }
    .rms-download-table tbody td[data-label="ダウンロード"] {
        grid-area: action;
        display: flex;
        justify-content: flex-end;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
    }
    .rms-download-table tbody td[data-label="ダウンロード"]:not(:has(.btn)) { display: none; }
    .rms-download-table tbody td[data-label="ダウンロード"] .btn {
        width: auto;
        min-height: 30px;
        padding: 0 12px;
        font-size: 12px;
        box-shadow: none;
    }
}

@media (max-height: 760px) and (min-width: 861px) {
    .guest .site-footer { padding: 8px 24px; }
    .guest-main { padding: 8px 24px; }
    .auth-panel__aside { padding: 24px 28px; }
    .auth-panel .login-card { padding: 20px 32px; gap: 12px; }
    .login-card .form { gap: 10px; }
    .login-card__title { font-size: 20px; }
    .login-card .alert { padding: 8px 12px; }
    .company-chip { padding: 8px 12px; }
    .field { gap: 4px; }
    .field__input { height: 38px; }
    .btn--block { min-height: 40px; }
}

@media (max-width: 860px) {
    .auth-panel {
        grid-template-columns: 1fr;
        max-width: 440px;
        background: transparent;
        box-shadow: none;
        gap: 16px;
    }
    .auth-panel__aside {
        order: 2;
        padding: 0;
        gap: 12px;
        color: var(--text);
        background: none;
    }
    .auth-panel__brand { display: none; }
    .auth-panel .login-card { border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
    .aside-notice {
        background: var(--surface);
        border: 1px solid var(--border);
        color: var(--text);
    }
    .aside-notice__title { color: var(--brand-600); }
    .aside-notice--plain { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
    .aside-notice--warning { background: var(--warning-bg); border-color: #F1DFB0; color: var(--text); }
}

@media (max-width: 720px) {
    .site-header__inner { flex-wrap: wrap; padding: 10px 16px; }
    .site-header__supplier { text-align: left; }
    .guest-main { padding: 16px; }
    .auth-panel .login-card, .login-card { padding: 24px 20px; }
}

.shop-page { width: 100%; max-width: 1680px; }
.shop-form { display: grid; gap: 14px; }
.shop-common {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 28px;
}
.shop-common .panel__title { grid-column: 1 / -1; margin-bottom: 0; }
.shop-mall__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 28px;
    align-items: start;
}
.shop-rms:not([hidden]) { display: contents; }
.shop-field {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) 5.5rem;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
}
.shop-field > span, .shop-services__title, .shop-periods__title { font-size: 13px; font-weight: 700; color: var(--navy); }
.shop-field small, .shop-services small { display: block; margin-top: 2px; font-weight: 500; color: var(--text-muted); }
.shop-field abbr, .shop-periods abbr { color: #BF1E2D; text-decoration: none; }
.shop-field .field__input { width: 100%; height: 36px; }
.shop-mall { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: visible; }
.shop-mall__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; overflow: hidden; border-left: 6px solid var(--mall, var(--brand)); border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; background: var(--mall-bg, var(--surface-soft)); }
.shop-mall__head h2 { margin: 0; font-size: 16px; }
.shop-mall__head h2 span { margin-left: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.shop-mall__head .btn { margin-left: auto; }
.shop-mall__body { padding: 16px 18px 18px; }
.shop-mall--001 { --mall: #BF1E2D; --mall-bg: #FDECEC; }
.shop-mall--002 { --mall: #C2410C; --mall-bg: #FFF1E6; }
.shop-mall--003 { --mall: #232F3E; --mall-bg: #F3F4F6; }
.shop-mall--010 { --mall: #1A73E8; --mall-bg: #E8F1FD; }
.shop-mall--013 { --mall: var(--success); --mall-bg: #ECF8F1; }
.shop-mall.is-disabled {
    --mall: #6B6B6B;
    --mall-bg: #D0D0D0;
    background: #E4E4E4;
    border-color: #B0B0B0;
}
.shop-mall.is-disabled .shop-mall__head { background: #C8C8C8; color: #3F3F3F; }
.shop-mall.is-disabled .shop-mall__head h2,
.shop-mall.is-disabled .shop-mall__head h2 span { color: #3F3F3F; }
.shop-mall.is-disabled .shop-mall__body { background: #ECECEC; opacity: 1; }
.shop-mall.is-disabled .shop-field > span,
.shop-mall.is-disabled .shop-services__title,
.shop-mall.is-disabled .shop-periods__title,
.shop-mall.is-disabled .shop-field__hint { color: #5C5C5C; }
.shop-mall.is-disabled .field__input { background: #DEDEDE; border-color: #BDBDBD; color: #4F4F4F; }
.shop-mall.is-disabled .shop-services,
.shop-mall.is-disabled .shop-periods,
.shop-mall.is-disabled .shop-google { background: #E0E0E0; }
.shop-mall.is-disabled .shop-emphasis { color: #7A3E3E; }
.shop-span, .shop-google { grid-column: 1 / -1; min-width: 0; }
.shop-google { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.shop-google__list { display: grid; gap: 8px; }
.shop-google__list[hidden] { display: none !important; }
.shop-google__list--types, .shop-google__list--accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shop-google__list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.shop-google__list label:has(input:checked) {
    border-color: var(--brand);
    background: #E8F4FC;
    box-shadow: inset 0 0 0 1px var(--brand);
}
.shop-google__list input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
.shop-mall.is-disabled .shop-google__list label { background: #DEDEDE; border-color: #BDBDBD; box-shadow: none; }
.shop-pair { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 14px 28px; align-items: start; }
.shop-field--nowrap { grid-template-columns: max-content minmax(120px, 1fr) 5.5rem; }
.shop-field--order { grid-column: 1 / -1; grid-template-columns: 168px 7rem max-content; }
.shop-field--nowrap > span { flex-wrap: nowrap; white-space: nowrap; }
.shop-services, .shop-periods, .shop-note { grid-column: 1 / -1; min-width: 0; overflow: visible; }
.shop-services, .shop-periods { margin: 0; padding: 12px 14px; border: 0; border-radius: 10px; background: var(--surface-soft); }
.shop-services__row, .shop-periods__row { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 8px 16px; align-items: start; }
.shop-services__list { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.shop-periods__list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.shop-services label {
    display: flex;
    flex: 1 1 260px;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
}
.shop-services label:hover { border-color: var(--brand-100); }
.shop-services label:has(input:checked) {
    border-color: var(--brand);
    background: #E8F4FC;
    box-shadow: inset 0 0 0 1px var(--brand);
}
.shop-periods label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; }
.shop-services input, .shop-periods input { margin-top: 2px; flex: none; }
.shop-services input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid #8AA0B4;
    border-radius: 5px;
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.shop-services input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
.shop-services input[type="checkbox"]:checked::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}
.shop-services input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shop-mall.is-disabled .shop-services label { background: #DEDEDE; border-color: #BDBDBD; box-shadow: none; }
.shop-mall.is-disabled .shop-services input[type="checkbox"] { background: #C8C8C8; border-color: #A0A0A0; }
.shop-mall.is-disabled .shop-services input[type="checkbox"]:checked { background: #8A8A8A; border-color: #8A8A8A; }
.shop-note { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.shop-form__actions, .shop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-table__ops .shop-actions { justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.shop-table__ops .shop-actions .btn--sm { padding: 0 10px; gap: 4px; font-size: 12.5px; }
.shop-actions form { margin: 0; }
.shop-actions__icon { flex-shrink: 0; }
.shop-form__actions { justify-content: flex-end; padding-top: 2px; }
.shop-form__actions--top {
    position: sticky;
    top: 56px;
    z-index: 25;
    margin: 0;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 22px rgba(15, 53, 87, .08);
    backdrop-filter: blur(8px);
}
.shop-field > span { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shop-field--nowrap > span { flex-wrap: nowrap; white-space: nowrap; }
.shop-field > .shop-field__control { display: contents; }
.shop-field__hint { color: var(--text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.shop-emphasis { display: block; margin: 0; color: #BF1E2D; font-style: normal; font-weight: 800; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.shop-services label span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.shop-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8B97A8;
    cursor: help;
    vertical-align: middle;
    transition: color .15s ease, background-color .15s ease;
}
.shop-help:hover, .shop-help:focus-visible, .shop-help.is-open {
    color: var(--brand);
    background: var(--brand-050);
    z-index: 36;
}
.shop-help__bubble {
    display: none;
    position: absolute;
    z-index: 35;
    top: calc(100% + 8px);
    left: 0;
    width: max-content;
    max-width: min(320px, 70vw);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(15, 53, 87, .14);
}
.shop-help:hover .shop-help__bubble,
.shop-help:focus .shop-help__bubble,
.shop-help:focus-visible .shop-help__bubble,
.shop-help.is-open .shop-help__bubble { display: block; }
.shop-help__bubble.is-above { top: auto; bottom: calc(100% + 8px); }
.shop-periods__title { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shop-table th { font-size: 12px; letter-spacing: .02em; }
.shop-table td { overflow-wrap: break-word; vertical-align: middle; line-height: 1.45; }
.shop-table__no { width: 52px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.shop-table__name { width: 22%; min-width: 160px; color: var(--navy); font-weight: 700; }
.shop-table__ops { width: 144px; text-align: right; white-space: nowrap; }
.shop-table__mall { min-width: 148px; }
.shop-mall-cell { display: grid; gap: 2px; }
.shop-mall-cell__name { color: var(--text); font-weight: 600; }
.shop-mall-cell__name::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: 1px;
}
.shop-table tbody td[data-label="楽天"] .shop-mall-cell__name::before { background: #F97316; }
.shop-table tbody td[data-label="Yahoo!"] .shop-mall-cell__name::before { background: #7C3AED; }
.shop-table tbody td[data-label="独自ドメイン"] .shop-mall-cell__name::before { background: #0A7FCB; }
.shop-mall-cell__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text-muted); font-size: 12px; }
.shop-table tbody td.shop-table__mall:not(:has(.shop-mall-cell))::after { content: "—"; color: var(--border-strong); }
.shop-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.shop-state--off { color: #9A3412; background: #FFF1E6; }

@media (max-width: 960px) {
    .table-wrap:has(.shop-table) { background: none; border: 0; border-radius: 0; overflow: visible; }
    .shop-table thead { display: none; }
    .shop-table tbody { display: grid; gap: 12px; }
    .shop-table tbody tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 10px 10px;
        padding: 16px;
        overflow: hidden;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 4px 12px -2px rgba(15, 23, 42, .04);
        transition: border-color .15s, box-shadow .15s;
    }
    .shop-table tbody tr:hover {
        background: var(--surface);
        border-color: #CBD5E1;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .07), 0 8px 18px -2px rgba(15, 23, 42, .05);
    }
    .shop-table tbody td { padding: 0; border: 0; }
    .shop-table__no {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 28px;
        height: 22px;
        padding: 0 6px;
        border-radius: 6px;
        background: #EFF6FF;
        border: 1px solid #BFDBFE;
        color: #1D4ED8;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .02em;
        margin-top: 1px;
    }
    .shop-table__no::before {
        content: "#";
        font-size: 10px;
        font-weight: 600;
        color: #3B82F6;
        margin-right: 1px;
        opacity: .75;
    }
    .shop-table__name {
        width: auto;
        min-width: 0;
        padding: 0;
        font-size: 15.5px;
        font-weight: 700;
        color: #0F172A;
        line-height: 1.35;
        word-break: break-word;
    }
    .shop-table__mall {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 0;
        padding: 10px 12px;
        border: 1px solid #EDF2F7;
        border-radius: 10px;
        background: #FAFAFC;
        min-width: 0;
    }
    .shop-table__mall:not(:has(.shop-mall-cell)) { display: none; }
    .shop-table tbody .shop-mall-cell { display: flex; flex-direction: column; gap: 4px; }
    .shop-table tbody .shop-mall-cell__name::before { display: none; }
    .shop-table__mall::before {
        content: attr(data-label);
        display: inline-flex;
        align-items: center;
        width: fit-content;
        height: 20px;
        padding: 0 8px;
        border-radius: 5px;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: .02em;
        text-align: left;
    }
    .shop-table__mall[data-label="楽天"]::before {
        background: #FEF2F2;
        color: #BE123C;
        border: 1px solid #FECDD3;
    }
    .shop-table__mall[data-label="Yahoo!"]::before {
        background: #FAF5FF;
        color: #7E22CE;
        border: 1px solid #E9D5FF;
    }
    .shop-table__mall[data-label="独自ドメイン"]::before {
        background: #F0F9FF;
        color: #0369A1;
        border: 1px solid #BAE6FD;
    }
    .shop-table tbody .shop-mall-cell__name {
        color: #1E293B;
        font-size: 13.5px;
        font-weight: 600;
        line-height: 1.4;
        word-break: break-word;
    }
    .shop-table tbody .shop-mall-cell__meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        color: #64748B;
    }
    .shop-table tbody .shop-mall-cell__meta span:not(.shop-state) {
        display: inline-flex;
        align-items: center;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        font-size: 11px;
        color: #475569;
        background: #FFFFFF;
        border: 1px solid #E2E8F0;
        padding: 1px 7px;
        border-radius: 4px;
    }
    .shop-table tbody .shop-mall-cell__meta span:not(.shop-state)::before {
        content: "コード: ";
        color: #94A3B8;
        font-size: 10px;
        margin-right: 3px;
    }
    .shop-table tbody .shop-state--off {
        display: inline-flex;
        align-items: center;
        min-height: 18px;
        padding: 0 6px;
        border-radius: 4px;
        font-size: 10.5px;
        font-weight: 700;
        color: #C2410C;
        background: #FFF7ED;
        border: 1px solid #FED7AA;
    }
    .shop-table__ops {
        grid-column: 1 / -1;
        width: 100%;
        display: block;
        margin: 4px 0 0;
        padding: 10px 0 0;
        border: 0;
        border-top: 1px solid #F1F5F9;
        background: transparent;
        text-align: left;
    }
    .shop-table__ops::before { content: none; }
    .shop-table__ops .shop-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .shop-table__ops .shop-actions form {
        display: inline-flex;
        margin: 0;
    }
    .shop-table__ops .shop-actions .btn {
        width: auto;
        min-height: 32px;
        padding: 0 12px;
        font-size: 12.5px;
        font-weight: 600;
        border-radius: 8px;
        gap: 5px;
    }
    .shop-table__ops .shop-actions .btn--ghost {
        background: #F0F9FF;
        border: 1px solid #BAE6FD;
        color: #0284C7;
    }
    .shop-table__ops .shop-actions .btn--ghost:hover,
    .shop-table__ops .shop-actions .btn--ghost:active {
        background: #E0F2FE;
        border-color: #7DD3FC;
        color: #0369A1;
    }
    .shop-table__ops .shop-actions .btn--danger-ghost {
        background: #FFFFFF;
        border: 1px solid #E2E8F0;
        color: #64748B;
        font-weight: 500;
    }
    .shop-table__ops .shop-actions .btn--danger-ghost:hover,
    .shop-table__ops .shop-actions .btn--danger-ghost:active {
        background: #FEF2F2;
        border-color: #FECDD3;
        color: #DC2626;
    }
}

@media (max-width: 720px) {
    .shop-common, .shop-mall__body, .shop-pair { grid-template-columns: 1fr; }
    .shop-field, .shop-field--nowrap, .shop-field--order, .shop-services__row, .shop-periods__row { grid-template-columns: 1fr; gap: 6px; }
    .shop-field--nowrap > span { white-space: normal; flex-wrap: wrap; }
    .shop-google__list--types, .shop-google__list--accounts { grid-template-columns: 1fr; }
    .shop-services__list { flex-direction: column; align-items: stretch; gap: 8px; }
    .shop-services label { flex: none; width: 100%; align-items: flex-start; padding: 12px 14px; }
    .shop-services input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; }
    .shop-mall__head { align-items: flex-start; flex-wrap: wrap; }
    .shop-mall__head .btn { margin-left: 0; }
    .shop-form__actions .btn { flex: 1; }
    .shop-periods__list { gap: 8px 12px; }
}

.manual-table th,
.manual-table td { text-align: center; vertical-align: middle; }
.manual-table tbody td { padding-top: 16px; padding-bottom: 16px; }
.manual-table a { font-weight: 700; white-space: nowrap; }

.user-table__no { width: 56px; text-align: center; }
.user-table th.user-table__ops,
.user-table__ops { width: 230px; text-align: center; white-space: nowrap; }
.user-table__ops .btn + .btn { margin-left: 6px; }
.user-list__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.user-list__foot .pager { margin: 0; flex: 1 1 100%; min-width: 0; }
.user-list__create { margin-left: auto; }
.user-state { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.user-state--on { color: #166534; background: #ECFDF3; }
.user-state--off { color: #9A3412; background: #FFF1E6; }

.user-form { display: grid; gap: 14px; margin-top: 28px; padding-top: 8px; }
.user-form__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); }
.user-form__note { margin: 0; color: var(--text-muted); font-size: 12px; }
.user-form__note abbr,
.user-field abbr { color: var(--danger); text-decoration: none; margin-left: 2px; }
.user-fields { display: grid; gap: 12px; max-width: 760px; }
.user-field { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 16px; align-items: center; margin: 0; padding: 0; border: 0; }
.user-field__label { font-weight: 700; color: var(--navy); }
.user-field .field__input { width: 100%; max-width: 420px; height: 36px; }
.user-field .field__input.is-readonly { background: var(--surface-soft); color: var(--text); }
.user-choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.user-choices label,
.user-shops label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-field--shops { align-items: start; }
.user-field--shops[hidden] { display: none !important; }
.user-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.user-shops label { min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.user-shops input { width: 16px; height: 16px; accent-color: var(--purple); }
.user-shops__empty { margin: 0; color: var(--text-muted); }
.user-form__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 720px) {
    .user-field { grid-template-columns: 1fr; gap: 6px; }
    .user-field .field__input { max-width: none; }
    .user-table__ops .btn { margin-left: 0; }
    .user-table__ops .btn + .btn { margin-left: 6px; }
}

.history-filter { display: grid; gap: 14px; margin-bottom: 16px; }
.history-filter__service { display: grid; grid-template-columns: 7.5em minmax(0, 320px); gap: 8px 12px; align-items: center; font-weight: 700; }
.history-filter__service .field__input { width: 100%; height: 36px; }
.history-months { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.history-months__label { font-weight: 700; margin-right: 4px; }
.history-months__link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
}
.history-months__link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.history-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-weight: 700; }
.history-totals p { margin: 0; }
.history-summary { display: grid; gap: 6px; margin-bottom: 12px; }
.history-summary p { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0; }
.history-summary span { min-width: 6em; color: var(--text-muted); font-weight: 700; }
.history-back { margin: 8px 0 12px; }

html:has(dialog.sheet[open]) { overflow: hidden; }
.sheet {
    width: min(760px, calc(100vw - 32px));
    max-height: min(880px, calc(100dvh - 32px));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.sheet[open] { animation: dialog-in .18s ease-out; }
.sheet::backdrop { background: rgba(11, 42, 69, .45); }
.sheet[open]::backdrop { animation: backdrop-in .18s ease-out; }
.sheet__form { display: flex; flex-direction: column; max-height: min(880px, calc(100dvh - 32px)); }
.sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 8px 22px; }
.sheet__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.sheet__close {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border-radius: 8px;
    color: var(--text-muted);
}
.sheet__close:hover { background: var(--surface-soft); color: var(--navy); }
.sheet__body { display: grid; gap: 12px; flex: 1; align-content: start; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 22px 18px; }
.sheet__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }
.sheet .user-fields { max-width: none; }
.sheet .user-field .field__input { max-width: none; }
.sheet .alert { margin: 0; }

@media (max-width: 960px) {
    .sheet {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    .sheet__form { height: 100%; max-height: none; overflow: hidden; }
    .sheet__foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .sheet__foot .btn { flex: 1; }
}

@media (max-width: 720px) {
    .history-filter__service { grid-template-columns: 1fr; }

    .table-wrap:has(.manual-table),
    .table-wrap:has(.user-table),
    .table-wrap:has(.history-table) {
        background: none;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }
    .manual-table thead,
    .user-table thead,
    .history-table thead { display: none; }
    .manual-table,
    .user-table,
    .history-table { font-size: 14px; }
    .manual-table tbody,
    .user-table tbody,
    .history-table tbody { display: grid; gap: 10px; }
    .manual-table tbody { gap: 8px; }
    .manual-table tbody tr,
    .user-table tbody tr,
    .history-table tbody tr {
        display: grid;
        gap: 8px;
        padding: 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
    }
    .manual-table tbody tr {
        grid-template-columns: 1fr 1fr;
        gap: 8px 16px;
        padding: 12px 14px;
    }
    .manual-table tbody tr:hover,
    .user-table tbody tr:hover,
    .history-table tbody tr:hover { background: var(--surface); }
    .manual-table td,
    .user-table td,
    .history-table td {
        display: grid;
        grid-template-columns: 7.4em minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 0;
        border: 0;
        text-align: left;
    }
    .manual-table td::before,
    .user-table td::before,
    .history-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
    }
    .manual-table tbody td {
        grid-template-columns: 1fr;
        gap: 2px;
        align-items: start;
        padding: 0;
    }
    .manual-table td[data-label="機能"],
    .manual-table td[data-label="マニュアルダウンロード"] { grid-column: 1 / -1; }
    .manual-table td[data-label="機能"] { color: var(--navy); font-weight: 700; }
    .manual-table tbody td::before { font-size: 11px; line-height: 1.3; }
    .manual-table a { white-space: normal; }
    .user-table__no,
    .user-table__ops { width: auto; white-space: normal; text-align: left; }
    .user-table__actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .user-table__actions .btn { margin: 0; }
    .user-table .user-state { justify-self: start; }
}

.shop-toolbar {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.shop-toolbar form { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.shop-toolbar__fields { display: flex; flex: 1 1 640px; flex-wrap: wrap; gap: 12px 16px; }
.shop-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 0;
    flex: 1 1 180px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.shop-toolbar .field__input { height: 36px; }
.shop-toolbar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-table__actions { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.company-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; max-width: 920px; }
.company-fields .user-field { min-width: 0; }
.company-field--period { grid-column: 1 / -1; }
.company-password { max-width: 640px; }
.company-form__actions { margin-top: 28px; margin-bottom: 20px; }
.company-period { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.user-field.company-field--period .company-period .field__input { width: 168px; max-width: 168px; flex: 0 0 168px; }
.permit-groups { display: grid; }
.permit-group { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 10px 18px; align-items: start; margin: 0 14px; padding: 14px 2px; border-top: 1px solid var(--border); }
.permit-group:first-child { border-top: 0; }
.permit-group__name { margin: 8px 0 0; color: var(--navy); font-size: 13px; font-weight: 800; line-height: 1.45; }
.permit-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.permit-checks label { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 8px 12px; border: 1px solid #D5DEE8; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.permit-checks label:hover { border-color: var(--brand-100); background: #F8FBFE; }
.permit-checks label:has(input:checked) { border-color: var(--brand); background: #E8F4FC; box-shadow: inset 0 0 0 1px var(--brand); color: var(--navy); }
.permit-checks input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
.permit-malls { display: grid; gap: 12px; }
.permit-mall { border: 1px solid color-mix(in srgb, var(--mall, var(--border)) 28%, var(--border)); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15, 53, 87, .04); }
.permit-mall summary { position: sticky; top: 124px; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-left: 6px solid var(--mall, var(--brand)); border-radius: 12px; background: var(--mall-bg, #F3F8FC); cursor: pointer; list-style: none; }
.permit-mall summary::-webkit-details-marker { display: none; }
.permit-mall__lead { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.permit-mall__mark { width: 8px; height: 8px; border-right: 2px solid var(--mall, var(--navy)); border-bottom: 2px solid var(--mall, var(--navy)); transform: rotate(-45deg); flex: none; }
.permit-mall[open] .permit-mall__mark { transform: rotate(45deg) translateY(-2px); }
.permit-mall__name { color: var(--mall, var(--navy)); font-size: 15px; font-weight: 800; }
.permit-mall__count { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #fff; color: var(--mall, var(--brand-600)); font-size: 12px; font-weight: 800; white-space: nowrap; }
.permit-mall__count.is-empty { background: rgba(255, 255, 255, .72); color: var(--text-muted); }
.permit-mall[open] summary { border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--border); }
.permit-mall .permit-checks label:has(input:checked) { border-color: var(--mall, var(--brand)); background: var(--mall-bg, #E8F4FC); box-shadow: inset 0 0 0 1px var(--mall, var(--brand)); }
.permit-mall .permit-checks input { accent-color: var(--mall, var(--brand)); }
.permit-mall .permit-groups { padding: 4px 0 10px; }
.permit-mall--001 { --mall: #BF1E2D; --mall-bg: #FDECEC; }
.permit-mall--002 { --mall: #C2410C; --mall-bg: #FFF1E6; }
.permit-mall--003 { --mall: #232F3E; --mall-bg: #F3F4F6; }
.permit-mall--004 { --mall: #DB2777; --mall-bg: #FDE8F3; }
.permit-mall--005,
.permit-mall--006,
.permit-mall--007,
.permit-mall--008,
.permit-mall--011,
.permit-mall--012 { --mall: #0E7490; --mall-bg: #E7F6FA; }
.permit-mall--009 { --mall: #64748B; --mall-bg: #F1F5F9; }
.permit-mall--010 { --mall: #1A73E8; --mall-bg: #E8F1FD; }
.permit-mall--013 { --mall: var(--success); --mall-bg: #ECF8F1; }
@media (max-width: 720px) {
    .company-fields, .permit-group { grid-template-columns: 1fr; }
    .company-period { flex-wrap: wrap; }
    .user-field.company-field--period .company-period .field__input { width: 100%; max-width: none; flex: 1 1 160px; }
}
