:root {
  color-scheme: dark;
  --page-orange: #d59a13;
  --page-black: #070604;
  --brand-blue: #2b2110;
  --brand-blue-dark: #0c0905;
  --brand-blue-soft: #2f2819;
  --brand-red: #e02118;
  --brand-red-dark: #980f0a;
  --brand-gold: #f4c73d;
  --brand-gold-dark: #9d6a12;
  --surface: #120f0a;
  --surface-2: #1a140c;
  --surface-3: #261e12;
  --line: #6f5520;
  --line-strong: #a77c25;
  --text: #fff4cf;
  --muted: #d8c48b;
  --danger: #ff5b50;
  --focus: #f4c73d;
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background-color: var(--page-black);
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent,
      transparent 10px,
      rgba(244, 199, 61, 0.08) 10px,
      rgba(244, 199, 61, 0.08) 16px
    );
  color: var(--text);
  font-family: Verdana, "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "Yu Gothic", Meiryo, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 184px;
  border-bottom: 10px solid var(--brand-gold-dark);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(244, 199, 61, 0.08),
      rgba(244, 199, 61, 0.08) 4px,
      transparent 4px,
      transparent 11px
    ),
    linear-gradient(135deg, #211609 0%, var(--brand-blue) 50%, var(--brand-blue-dark) 100%);
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 10px solid var(--brand-gold);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-shell {
  width: min(calc(100% - 32px), 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 28px;
}

.admin-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-shell {
  width: min(calc(100% - 32px), 880px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 28px;
}

.home-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-content {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.home-action-panel .primary-button {
  width: min(100%, 340px);
  min-height: 52px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
}

.admin-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand-gold);
  border-radius: 4px;
  background: var(--surface-2);
}

.admin-panel h2 {
  margin: 0 0 16px;
  color: var(--brand-gold);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.store-list-panel {
  grid-column: 2;
}

.release-check-panel {
  grid-column: 1 / -1;
}

.download-asset-panel {
  grid-column: 1 / -1;
}

.machine-asset-panel {
  grid-column: 1 / -1;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
}

.section-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.store-list {
  display: grid;
  gap: 8px;
}

.store-list-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #18130c;
}

.store-id {
  color: var(--brand-gold);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.store-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty-list {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.release-check-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.release-check-row {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #18130c;
}

.release-check-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.release-check-status {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.release-check-status.ok {
  color: #b8f0a8;
}

.release-check-status.warn {
  color: #ffe083;
}

.release-check-status.error {
  color: #ff9088;
}

.download-asset-list {
  display: grid;
  gap: 8px;
}

.download-asset-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #18130c;
}

.download-asset-preview {
  display: grid;
  place-items: center;
  width: 86px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.download-asset-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.download-asset-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.download-asset-main strong,
.download-asset-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.download-asset-main strong {
  color: var(--text);
  font-size: 13px;
}

.download-asset-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.download-asset-main .asset-row-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.download-asset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.panel-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.asset-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(140px, 180px);
  gap: 12px;
  margin-bottom: 12px;
}

.machine-asset-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.machine-asset-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #18130c;
}

.machine-asset-preview {
  display: grid;
  place-items: center;
  width: 52px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.machine-asset-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.machine-asset-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.machine-asset-main strong,
.machine-asset-main span,
.machine-asset-main code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.machine-asset-main strong {
  color: var(--text);
  font-size: 13px;
}

.machine-asset-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.machine-asset-main code {
  color: #f4d77a;
  font-size: 11px;
  font-weight: 800;
}

.machine-asset-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.asset-pill {
  min-width: 58px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.asset-pill.done {
  border-color: #2f7a3f;
  background: #e9f8ec;
  color: #17602a;
}

.asset-pill.pending {
  border-color: #b88900;
  background: #fff7d6;
  color: #775700;
}

.asset-pill.missing {
  border-color: #c64848;
  background: #fff0f0;
  color: #a21d1d;
}

.asset-pill.warning {
  border-color: #d08600;
  background: #fff1bf;
  color: #7a4b00;
}

.machine-asset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.asset-upload-control {
  display: inline-flex;
}

.unknown-asset-list {
  margin-bottom: 12px;
}

.unknown-asset-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d5a22b;
  border-radius: 4px;
  background: #fff7d6;
  color: #5c4300;
}

.unknown-asset-box strong {
  font-size: 12px;
}

.unknown-asset-items {
  display: grid;
  gap: 4px;
}

.unknown-asset-items span {
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.brand-mark,
.brand-badge,
.brand-logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 124px;
  height: 124px;
}

.brand-mark {
  position: relative;
}

.brand-logo {
  display: none;
  object-fit: contain;
}

.brand-mark.has-brand-logo .brand-logo {
  display: block;
}

.brand-mark.has-brand-logo .brand-badge {
  display: none;
}

.brand-badge {
  border: 6px solid #ffffff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 42%, #ffe78a 0 16%, var(--brand-gold) 17% 31%, #ef7d00 32% 54%, var(--brand-red) 55% 100%);
  box-shadow:
    0 0 0 5px #111111,
    0 8px 16px rgba(0, 0, 0, 0.26);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 0 #000000,
    2px 0 0 #000000,
    -2px 0 0 #000000,
    0 -2px 0 #000000;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 22px;
  width: min(calc(100% - 32px), 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 28px;
}

.control-surface,
.home-surface,
.preview-surface {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-surface {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 8px solid var(--brand-gold-dark);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(244, 199, 61, 0.08),
      rgba(244, 199, 61, 0.08) 3px,
      transparent 3px,
      transparent 10px
    ),
    linear-gradient(135deg, #2a1b08 0%, #151008 56%, #050403 100%);
  color: #ffffff;
}

.topbar .brand-mark,
.topbar .brand-badge,
.topbar .brand-logo {
  width: 100px;
  height: 100px;
}

.topbar .brand-badge {
  border-width: 4px;
  box-shadow:
    0 0 0 4px #ffffff,
    0 6px 12px rgba(0, 0, 0, 0.28);
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.kicker {
  margin: 0 0 7px;
  color: var(--brand-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar .kicker {
  color: #f7d96b;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.store-label {
  margin: 8px 0 0;
  color: #e5cf83;
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  color: var(--brand-gold);
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar h1 {
  color: #ffffff;
  font-size: 21px;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
  word-break: keep-all;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(0, 35, 81, 0.7);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.status-pill.busy {
  border-color: var(--brand-gold);
  color: #fff0a2;
}

.status-pill.done {
  border-color: #ffffff;
  color: #ffffff;
}

.status-pill.error {
  border-color: #ffc2c7;
  color: #ffc2c7;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.resource-panel {
  margin: 0;
}

.field-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group legend {
  margin-bottom: 10px;
  color: var(--brand-gold);
  font-size: 13px;
  font-weight: 900;
}

.field-note {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-note.error {
  color: var(--danger);
  font-weight: 800;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: end;
}

.date-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.date-layout-grid .compact-button {
  min-height: 44px;
  white-space: nowrap;
}

.machine-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.machine-layout-grid .compact-button {
  min-height: 44px;
  white-space: nowrap;
}

.field-group.is-disabled {
  opacity: 0.58;
}

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

.date-field {
  position: relative;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 286px;
  padding: 10px;
  border: 1px solid rgba(115, 78, 26, 0.42);
  border-radius: 6px;
  background: #fff8df;
  box-shadow: 0 18px 34px rgba(20, 12, 4, 0.24);
}

.date-picker-popover[hidden] {
  display: none;
}

.date-picker-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #201608;
  text-align: center;
}

.date-picker-nav,
.date-picker-day {
  min-height: 34px;
  border: 1px solid rgba(116, 75, 21, 0.35);
  border-radius: 4px;
  background: #fffdf3;
  color: #201608;
  font-weight: 800;
  cursor: pointer;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-picker-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.date-picker-day {
  padding: 0;
}

.date-picker-day.is-muted {
  color: rgba(32, 22, 8, 0.42);
}

.date-picker-day.is-today {
  border-color: #d10d18;
}

.date-picker-day.is-selected {
  background: #ffd51f;
  border-color: #8a5d12;
}

.field span,
.field-label,
.machine-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input[type="date"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff8df;
  color: #201608;
  padding: 0 12px;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 118, 215, 0.35);
  outline-offset: 2px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-gold);
}

.count-options {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.count-option {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff8df;
  color: #201608;
  font-weight: 900;
  cursor: pointer;
}

.count-option:hover {
  border-color: var(--brand-gold);
  background: #fff0af;
}

.count-option.active {
  border-color: #8d6d00;
  background: linear-gradient(180deg, #ffe176 0%, var(--brand-gold) 100%);
  color: #2d2300;
}

.count-option.pending:not(.active) {
  background: var(--surface-3);
  color: #9f8a56;
}

.machine-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.machine-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
}

.machine-row.active {
  border-color: var(--brand-gold);
  border-left-color: var(--brand-gold);
  background: #241b0e;
}

.machine-slot-button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.machine-slot-title,
.machine-slot-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.machine-slot-name {
  min-width: 0;
  color: #fff7d7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.machine-clear-button {
  align-self: start;
  min-width: 42px;
  min-height: 26px;
  border: 1px solid rgba(245, 207, 88, 0.36);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.machine-clear-button:hover {
  border-color: var(--brand-gold);
  color: #fff7d7;
}

.support-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #8a6814;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 221, 92, 0.08), rgba(255, 221, 92, 0)),
    #15120b;
  color: #f7e6ac;
}

.support-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-panel h2 {
  margin: 0;
  color: #f5cf58;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}

.support-panel .field span {
  color: #d9c17a;
}

.support-panel input {
  border-color: #8a6814;
  background: #fffaf0;
}

.small-pill {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 4px 8px;
  border: 1px solid #8a6814;
  border-radius: 999px;
  background: rgba(255, 214, 82, 0.12);
  color: #f5cf58;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.machine-catalog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.machine-catalog-button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border: 1px solid rgba(245, 207, 88, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff7d7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.machine-catalog-button:hover {
  border-color: var(--brand-gold);
  background: rgba(244, 199, 61, 0.12);
}

.machine-catalog-name,
.machine-catalog-meta {
  min-width: 0;
}

.machine-catalog-meta {
  color: #d9c17a;
  font-size: 11px;
  font-weight: 700;
}

.resource-link-list {
  display: grid;
  gap: 8px;
}

.resource-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 207, 88, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff7d7;
  font-size: 12px;
  font-weight: 800;
}

.resource-link-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.resource-link-status {
  color: #d9c17a;
  font-size: 11px;
  font-weight: 900;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(245, 207, 88, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.history-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.history-summary strong {
  color: #fff7d7;
  font-size: 13px;
  line-height: 1.35;
}

.history-summary span {
  color: #d9c17a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.history-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.history-actions .compact-button {
  min-width: 54px;
}

.guide-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #fff7d7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.password-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-tool .compact-button {
  min-width: 92px;
}

.password-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #c6a600;
  border-radius: 4px;
  background: #fff7c8;
  color: #3a3000;
}

.password-result span {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 900;
}

.password-result strong {
  font-family: Verdana, "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "Yu Gothic", Meiryo, sans-serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border-color: #ffe07a;
  background: linear-gradient(180deg, #ffe58a 0%, var(--brand-gold) 54%, #b67812 100%);
  color: #1d1305;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.34);
}

.primary-button:hover {
  background: linear-gradient(180deg, #fff0ad 0%, #ffd04a 56%, #a8650c 100%);
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.secondary-button {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #2e2415 0%, #0f0b06 100%);
  color: #ffe799;
}

.secondary-button.disabled {
  pointer-events: none;
  border-color: var(--line);
  background: var(--surface-3);
  color: #9f8a56;
}

.secondary-button.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.icon-text-button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.icon-text-button:hover {
  border-color: var(--brand-gold);
  color: #fff0a2;
}

.preview-surface {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  justify-items: center;
  padding: 18px;
  border-top: 10px solid var(--brand-gold);
}

.preview-frame {
  display: grid;
  place-items: center;
  width: min(100%, 620px);
  max-height: calc(100vh - 86px);
  aspect-ratio: 1684 / 2384;
  border: 1px solid #252a30;
  border-radius: 4px;
  background: #090a0b;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090a0b;
}

.empty-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #737b85;
  font-size: 18px;
  font-weight: 900;
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.message.error {
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 920px) {
  body::before {
    height: 148px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .store-list-panel {
    grid-column: auto;
  }

  .release-check-panel {
    grid-column: auto;
  }

  .download-asset-panel {
    grid-column: auto;
  }

  .release-check-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-asset-panel {
    grid-column: auto;
  }

  .download-asset-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .download-asset-preview {
    width: 96px;
    height: 72px;
  }

  .download-asset-actions {
    justify-content: flex-start;
  }

  .machine-asset-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .machine-asset-preview {
    width: 64px;
    height: 88px;
  }

  .machine-asset-status,
  .machine-asset-actions {
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(calc(100% - 24px), 680px);
    padding: 14px 0 22px;
  }

  .preview-frame {
    width: min(100%, 440px);
    max-height: none;
  }

  .date-layout-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-layout-grid .compact-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .login-shell {
    padding: 16px;
  }

  .admin-shell {
    width: min(calc(100% - 24px), 680px);
    padding: 14px 0 22px;
  }

  .admin-grid {
    padding: 14px;
  }

  .login-panel {
    padding: 22px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark,
  .brand-badge,
  .brand-logo {
    width: 82px;
    height: 82px;
  }

  .brand-badge {
    border-width: 4px;
    box-shadow:
      0 0 0 4px var(--brand-blue),
      0 6px 12px rgba(0, 0, 0, 0.22);
    font-size: 11px;
  }

  .topbar .brand-mark,
  .topbar .brand-badge,
  .topbar .brand-logo {
    width: 72px;
    height: 72px;
  }

  .topbar .brand-badge {
    font-size: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .inline-fields,
  .date-layout-grid,
  .machine-layout-grid,
  .asset-filter-grid,
  .actions,
  .password-tool {
    grid-template-columns: 1fr;
  }

  .password-result {
    grid-template-columns: 1fr;
  }

  .count-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .release-check-list {
    grid-template-columns: 1fr;
  }

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

  .store-list-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .topbar-actions {
    align-items: flex-start;
  }

  .status-pill {
    align-self: flex-start;
  }
}
