:root {
  color-scheme: light;
  --ink: #333333;
  --muted: #6d6870;
  --line: #ded9df;
  --surface: #ffffff;
  --soft: #f8f5f7;
  --pink: #ed168c;
  --pink-deep: #bd086b;
  --yellow: #ffd629;
  --red: #d82332;
  --green: #187b52;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.admin-kicker {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.login-page { min-height: 100vh; background: linear-gradient(135deg, #fff 0 55%, #fff2f8 55%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(100%, 460px);
  padding: clamp(30px, 6vw, 54px);
  border: 1px solid var(--line);
  border-top: 8px solid var(--pink);
  background: var(--surface);
}
.login-card h1 { margin: 0; font-size: clamp(2rem, 7vw, 3rem); }
.login-lead { margin: 12px 0 30px; color: var(--muted); }
.login-form { display: grid; gap: 20px; }
.login-form label:not(.remember-row), .rename-form label { display: grid; gap: 8px; }
label > span { font-size: .85rem; font-weight: 800; }
input[type="text"], input[type="password"], input[type="date"] {
  width: 100%; min-height: 48px; padding: 10px 13px; color: var(--ink);
  border: 1px solid #a9a3aa; border-radius: 4px; background: #fff;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pink) 30%, transparent); outline-offset: 2px;
}
.remember-row { display: flex; align-items: center; gap: 10px; }
.remember-row input { width: 19px; height: 19px; accent-color: var(--pink); }
.security-note { margin: 20px 0 0; color: var(--muted); font-size: .78rem; }

.primary-button, .small-button, .danger-button, .icon-button, .outline-danger-button, .text-button {
  border: 0; border-radius: 4px; cursor: pointer; font-weight: 900; text-decoration: none;
}
.primary-button { min-height: 50px; padding: 12px 20px; color: #fff; background: var(--pink); }
.primary-button:hover { background: var(--pink-deep); }
.small-button { display: inline-grid; place-items: center; min-height: 38px; padding: 8px 12px; color: #fff; background: var(--ink); }
.small-button:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff; }
.icon-button { width: 38px; height: 38px; color: var(--ink); background: #ece8eb; }
.danger-button { min-height: 38px; padding: 8px 12px; color: var(--red); background: #fff0f1; }
.outline-danger-button { min-height: 44px; padding: 10px 15px; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: #fff; }
.text-button { padding: 8px 0; color: #fff; background: transparent; }

.alert { margin: 0; padding: 14px 16px; border-left: 5px solid; background: #fff; }
.alert-error { color: #8d1420; border-color: var(--red); background: #fff0f1; }
.alert-info { border-color: #2468a8; background: #eef7ff; }
.alert-success { border-color: var(--green); background: #edfff6; }

.admin-header {
  position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between;
  min-height: 86px; padding: 14px clamp(18px, 4vw, 54px); color: #fff; background: var(--ink);
}
.admin-header h1 { margin: 0; font-size: 1.45rem; }
.account-actions { display: flex; align-items: center; gap: 18px; font-size: .85rem; }
.admin-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.admin-main > .alert { margin-bottom: 22px; }
.intro-panel, .session-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); background: #fff;
}
.intro-panel h2, .session-panel h2 { margin: 0 0 8px; }
.intro-panel p, .session-panel p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.8; }
.limit-badge { flex: 0 0 auto; padding: 9px 13px; color: var(--ink); font-weight: 900; background: var(--yellow); }
.store-stack { display: grid; gap: 28px; margin-top: 28px; }
.store-admin-card { scroll-margin-top: 110px; border: 1px solid var(--line); background: #fff; }
.store-card-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px clamp(20px, 4vw, 34px); border-bottom: 5px solid var(--pink);
}
.store-card-heading h2 { margin: 0; font-size: clamp(1.3rem, 4vw, 2rem); }
.store-card-heading a { color: var(--ink); font-weight: 800; }
.store-number { margin: 0 0 5px; color: var(--pink); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.upload-form { padding: clamp(20px, 4vw, 34px); background: #fff9fc; }
.drop-zone {
  min-height: 260px; display: grid; place-items: center; align-content: center; gap: 7px;
  padding: 24px; text-align: center; border: 3px dashed #d4a6bd; background: #fff; cursor: pointer;
}
.drop-zone.is-dragging, .drop-zone:focus-visible { border-color: var(--pink); background: #fff0f7; outline: none; }
.drop-zone.has-file { border-style: solid; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-icon { display: grid; place-items: center; width: 50px; height: 50px; color: #fff; border-radius: 50%; font-size: 2rem; background: var(--pink); }
.drop-zone small { color: var(--muted); }
.file-picker-button { margin-top: 6px; padding: 9px 14px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.file-picker-button:hover { background: var(--ink); color: #fff; }
.local-preview { max-width: min(100%, 320px); max-height: 260px; margin-top: 12px; object-fit: contain; }
.selected-file { color: var(--pink-deep); font-weight: 800; word-break: break-all; }
.automatic-name { margin: 20px 0 0; padding: 14px 16px; border-left: 4px solid var(--pink); background: #fff; color: var(--muted); }
.automatic-name strong { display: block; margin-top: 4px; color: var(--ink); font-size: 1.05rem; word-break: break-all; }
.publish-button { width: 100%; margin-top: 20px; }
.published-section { padding: clamp(20px, 4vw, 34px); }
.published-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.published-heading h3 { margin: 0; }
.published-heading span { color: var(--muted); font-weight: 800; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.asset-card { min-width: 0; border: 1px solid var(--line); background: #fff; }
.asset-image-wrap { position: relative; display: grid; place-items: center; min-height: 250px; padding: 12px; background: #f5f2f4; }
.asset-image-wrap img { display: block; max-width: 100%; max-height: 330px; object-fit: contain; }
.asset-order { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 32px; height: 32px; color: #fff; font-weight: 900; background: var(--pink); }
.rename-form { display: grid; gap: 12px; padding: 18px 18px 16px; }
.rename-form input { min-height: 42px; }
.asset-meta { margin: 12px 15px; color: var(--muted); font-size: .8rem; }
.asset-actions {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 12px;
  margin-top: 4px; padding: 12px 18px 20px;
}
.asset-actions > .small-button { flex: 1 1 150px; }
.asset-actions form { margin: 0; }
.empty-state { margin: 0; padding: 34px; text-align: center; color: var(--muted); background: var(--soft); }
.session-panel { margin-top: 28px; }
.password-panel { align-items: flex-start; border-top: 5px solid var(--pink); }
.password-change-form { display: grid; flex: 0 1 460px; gap: 14px; width: min(100%, 460px); }
.password-change-form label { display: grid; gap: 8px; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { padding-right: 54px; }
.password-visibility-button {
  position: absolute; top: 50%; right: 7px; display: grid; place-items: center;
  width: 40px; height: 40px; padding: 8px; transform: translateY(-50%);
  color: var(--muted); border: 0; border-radius: 4px; background: transparent; cursor: pointer;
}
.password-visibility-button:hover { color: var(--ink); background: var(--soft); }
.password-visibility-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-visibility-button.is-password-visible [data-eye-slash] { display: none; }
.password-generator { display: grid; gap: 9px; }
.password-generator-actions { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.password-generator-actions .small-button { min-height: 44px; }
.copy-password-button:disabled { cursor: not-allowed; opacity: .45; }
.password-generator-status { min-height: 1.5em; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

@media (max-width: 820px) {
  .asset-grid { grid-template-columns: 1fr; }
  .asset-image-wrap { min-height: 200px; }
}

@media (max-width: 600px) {
  .admin-header, .intro-panel, .session-panel, .store-card-heading { align-items: flex-start; flex-direction: column; }
  .admin-header { position: static; }
  .account-actions { width: 100%; justify-content: space-between; }
  .admin-main { width: min(100% - 20px, 1180px); padding-top: 10px; }
  .drop-zone { min-height: 220px; }
  .session-panel form, .outline-danger-button { width: 100%; }
  .password-generator-actions { grid-template-columns: 1fr; }
}
