:root {
  --canvas: #f5f7fb;
  --white: #ffffff;
  --ink: #172440;
  --muted: #5e6d85;
  --line: #e0e6ef;
  --blue: #344bc3;
  --blue-soft: #ebefff;
  --navy: #142549;
  --mint: #a8eee2;
  --green: #13735e;
  --green-soft: #e5f6ef;
  --amber: #87540b;
  --amber-soft: #fff1d8;
  --red: #a92e48;
  --red-soft: #fceaf0;
  --rail: 226px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #546bdf;
  outline-offset: 3px;
}

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 30;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
  transform: translateY(-220%);
}
.skip:focus { transform: none; }

/* ---- App Shell & Rail ---- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fbfcfe;
  border-right: 1px solid var(--line);
  padding: 0 18px 20px;
}

.rail-backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0;
  z-index: 3;
  background: #17244044;
}
.rail-backdrop.open { display: block; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 73px;
  padding: 0 6px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}
.brand:hover { text-decoration: none; }

.mark {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--blue);
  position: relative;
  flex: none;
}
.mark::before,
.mark::after {
  position: absolute;
  content: "";
  width: 17px;
  height: 11px;
  left: 9px;
  background: var(--white);
  clip-path: polygon(0 39%, 50% 0, 100% 39%, 50% 81%);
}
.mark::before { top: 8px; }
.mark::after {
  top: 15px;
  background: var(--mint);
  clip-path: polygon(0 21%, 50% 65%, 100% 21%, 100% 50%, 50% 100%, 0 50%);
}

.brand b {
  display: block;
  font-size: 17px;
  letter-spacing: -.55px;
  line-height: 1.2;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.rail nav {
  display: grid;
  gap: 5px;
  margin-top: 25px;
}
.group {
  margin: 0 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.group.secondary { margin-top: 28px; }

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 620;
  text-decoration: none;
}
.nav-button:hover { background: #f0f3fa; color: var(--ink); text-decoration: none; }
.nav-button[aria-current="page"] {
  color: #263dab;
  background: #e8edff;
  font-weight: 750;
}

.rail-bottom {
  margin-top: auto;
  padding: 16px 7px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rail-bottom strong,
.rail-bottom small { display: block; }
.rail-bottom strong {
  font-size: 12px;
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-bottom small { font-size: 11px; color: var(--muted); margin-top: 2px; }

.machine {
  width: 33px;
  height: 33px;
  flex: none;
  display: grid;
  place-items: center;
  background: #edf1f8;
  border: 1px solid #e4e9f2;
  border-radius: 8px;
  color: var(--muted);
}

/* ---- Top Bar ---- */
.main-col { min-width: 0; }

.top {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 36px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}
.crumb strong {
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb a.crumb-home {
  color: #52617b;
  text-decoration: none;
}
.crumb a.crumb-home:hover { text-decoration: underline; }

.top-tools {
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}
.worker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: #455572;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.dot-mint { color: var(--mint); }
.worker .dot { color: #239779; }

.mobile-toggle { display: none; }

/* ---- Content & Page Header ---- */
.content {
  padding: 31px 36px 48px;
  max-width: 1430px;
  margin: auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 24px;
}
.page-head h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -1.6px;
  font-weight: 780;
}
.page-head p {
  color: var(--muted);
  margin-top: 7px;
  font-size: 14px;
}

/* ---- Icons & Buttons ---- */
.icon {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  vertical-align: middle;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid #d6dfee;
  border-radius: 7px;
  background: var(--white);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: #edf1fb; text-decoration: none; }
.button.primary {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}
.button.primary:hover:not(:disabled) { background: #283baa; }
.button.mint {
  color: #143b3b;
  background: var(--mint);
  border-color: var(--mint);
}
.button.mint:hover:not(:disabled) { background: #c0faef; }
.button.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f3cdd8;
}
.button.danger:hover:not(:disabled) { background: #f9d8e3; }
.button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 5px 0;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.text-button:hover { text-decoration: underline; }

/* ---- Hero ---- */
.hero {
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(225px, .82fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 24px;
  min-height: 260px;
  background: var(--navy);
  color: var(--white);
  padding: 27px 30px;
  margin-bottom: 25px;
  isolation: isolate;
  overflow: hidden;
}
.hero.hero-empty {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
}
.hero-main { position: relative; z-index: 1; }
.hero-context {
  font-weight: 690;
  font-size: 12px;
  color: #c8d5f6;
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-app { display: flex; align-items: center; gap: 13px; }
.hero-app h2 {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -1.55px;
  font-weight: 760;
}
.hero-app .version {
  color: #b6c4e8;
  font: 700 12px/1.4 var(--mono);
  display: block;
  margin-top: 5px;
}
.hero-copy { margin: 14px 0 19px; color: #e0e8fa; font-size: 13px; }

.app-icon {
  height: 35px;
  width: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex: none;
  color: var(--white);
  background: #324dce;
}
.app-icon .icon { width: 19px; height: 19px; }
.app-icon.silent { background: #dff8f3; color: #155b58; }
.app-icon.lotto { background: #e9edff; color: #4246b1; }
.app-icon.run { background: #ffeadd; color: #a74632; }
.app-icon.has-img { padding: 0; object-fit: cover; background: #eef2f8; border: 1px solid rgba(20, 37, 73, .08); box-sizing: border-box; }

.hero .app-icon {
  height: 49px;
  width: 49px;
  border-radius: 13px;
  background: var(--mint);
  color: #174b48;
}
.hero .app-icon .icon { width: 26px; height: 26px; }

.release-map {
  position: relative;
  padding: 16px 0 16px 53px;
  display: grid;
  gap: 10px;
}
.release-map::before {
  content: "";
  position: absolute;
  inset: -70px -30px -70px -38px;
  z-index: -1;
  background-image: radial-gradient(circle, #6683be32 1px, transparent 1.2px);
  background-size: 15px 15px;
  mask-image: linear-gradient(90deg, transparent, #000 28%);
}
.map-route {
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 22px;
  width: 32px;
  border: 1px solid #7089bd;
  border-right: 0;
  border-radius: 10px 0 0 10px;
}
.map-route::before {
  content: "";
  width: 20px;
  height: 1px;
  background: #7089bd;
  position: absolute;
  top: 50%;
  right: 100%;
}
.map-route::after {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid var(--mint);
  border-radius: 50%;
  background: var(--navy);
  position: absolute;
  right: calc(100% + 15px);
  top: calc(50% - 4px);
}

.lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  position: relative;
  min-height: 69px;
  padding: 11px 13px;
  border: 1px solid #4a5d85;
  border-radius: 9px;
  background: #20345a;
}
.lane::before {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  top: calc(50% - 3px);
  left: -5px;
  border: 1px solid #afc3f0;
  border-radius: 50%;
  background: #2a416b;
}
.lane-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lane strong, .lane small { display: block; font-size: 13px; }
.lane small { font-size: 11px; color: #c1d0ed; margin-top: 2px; }
.lane-state { display: grid; justify-items: end; gap: 4px; }
.lane-state .lane-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.lane-state .lane-badge.ok { color: var(--mint); }
.lane-state .lane-badge.info { color: #b9cbff; }
.lane-state .lane-badge.warn { color: #ffd48a; }
.lane-state .lane-badge.muted { color: #9ab0d6; }
.lane-state .mono { color: #c6d4ee; font-size: 11px; }

.platform-icon {
  width: 31px;
  height: 31px;
  flex: none;
  display: grid;
  place-items: center;
  background: #ecf0ff;
  color: #4156ae;
  border-radius: 7px;
}
.platform-icon.android { background: #e2f4ed; color: #25765e; }
.hero .platform-icon { background: #314770; color: #e0eaff; }
.hero .platform-icon.android { background: #2a4a58; color: #abebd4; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- Panels & Grids ---- */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.73fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  align-items: start;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 0;
}
.panel + .panel { margin-top: 18px; }
/* 그리드 안에서는 칸 간격(gap)이 간격을 맡는다. 세로 쌓기용 여백이 두 번째 칸에만 붙으면
   좌우 카드(iOS/Android)의 위쪽 좌표가 어긋난다. */
:is(.overview-grid, .platform-grid, .editor-grid, .stats-grid, .kpi-grid, .folder-grid) > .panel { margin-top: 0; }
/* 나란히 놓인 플랫폼 카드는 같은 높이로 맞춘다(내용이 짧은 쪽도 아래 경계가 맞게). */
.platform-grid { align-items: stretch; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: 16px;
  letter-spacing: -.35px;
  line-height: 1.3;
}
.section-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.panel-body { padding: 19px 20px; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 20px; }

.platform-panel .panel-body { display: grid; gap: 13px; }
.build-panel { margin-top: 18px; }
.build-panel tbody td { font-size: 13px; }
.store-title { display: flex; gap: 9px; align-items: center; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th {
  font-weight: 650;
  color: #5d6b83;
  background: #f8faff;
  font-size: 12px;
  white-space: nowrap;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf6;
}
thead th:first-child, tbody td:first-child { padding-left: 20px; }
thead th:last-child, tbody td:last-child { padding-right: 20px; }
tbody td {
  padding: 12px;
  border-bottom: 1px solid #e9edf5;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; word-break: break-word; }

.app-ref {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
}
.app-ref strong, .app-ref small { display: block; line-height: 1.35; }
.app-ref strong { font-size: 13px; }
.app-ref small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.app-ref:hover strong { color: var(--blue); text-decoration: underline; }

.store-cell { white-space: nowrap; min-width: 118px; }
.store-cell small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

/* ---- Status Badges ---- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.42;
  font-weight: 750;
  padding: 3px 7px;
  white-space: nowrap;
  color: #485875;
  background: #edf0f6;
}
.status .dot { height: 5px; width: 5px; }
.status.good { color: var(--green); background: var(--green-soft); }
.status.warn { color: var(--amber); background: var(--amber-soft); }
.status.info { color: #314cbc; background: var(--blue-soft); }
.status.bad { color: var(--red); background: var(--red-soft); }

/* ---- Queue List (Dashboard Recent Jobs) ---- */
.queue-list { list-style: none; margin: 0; padding: 0 16px; }
.queue-list li + li { border-top: 1px solid #e9edf5; }
.queue-item {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 12px 3px;
}
.queue-item:hover strong { text-decoration: underline; color: var(--blue); }
.queue-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
}
.queue-icon.warn { background: var(--amber-soft); color: var(--amber); }
.queue-icon.info { background: var(--blue-soft); color: var(--blue); }
.queue-icon .icon { width: 14px; height: 14px; }
.queue-label { min-width: 0; }
.queue-label strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-label small, .queue-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.queue-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Tabs & Toolbars & Segments ---- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 19px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 2px;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  background: #e9edf6;
  border: 1px solid #e0e6f1;
  padding: 3px;
  border-radius: 8px;
}
.segment a,
.segment button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  border-radius: 5px;
  padding: 5px 10px;
  color: #485978;
  font-size: 12px;
  font-weight: 680;
  text-decoration: none;
}
.segment a:hover,
.segment button:hover { color: var(--ink); text-decoration: none; }
.segment a[aria-current="page"],
.segment button[aria-pressed="true"] {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 1px 2px #20355c1c;
}
.seg-count {
  font-family: var(--mono);
  font-size: 11px;
  opacity: .75;
}

/* ---- App Heading & Picker ---- */
.app-heading { display: flex; gap: 13px; align-items: center; }
.app-heading .app-icon { width: 50px; height: 50px; border-radius: 13px; }
.app-heading .app-icon .icon { width: 25px; height: 25px; }

.app-picker {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

/* ---- Forms & Pairs ---- */
.field-select,
.input,
.textarea {
  width: 100%;
  border: 1px solid #ccd7e8;
  background: var(--white);
  border-radius: 6px;
  min-height: 39px;
  padding: 7px 10px;
  color: var(--ink);
}
.field-select { width: auto; max-width: 100%; min-height: 36px; }
.textarea { min-height: 92px; resize: vertical; }
.input-file {
  display: block;
  width: 100%;
  font-size: 13px;
  color: var(--muted);
}
.input-file::file-selector-button {
  margin-right: 10px;
  padding: 6px 11px;
  border: 1px solid #d6dfee;
  border-radius: 6px;
  background: #f5f7fb;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}
.input-file::file-selector-button:hover { background: #e9eef9; }

label.field {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
  font-weight: 680;
}
.field + .field { margin-top: 13px; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field .hint { font-weight: 400; }
.hint { font-size: 12px; color: var(--muted); }
.counter { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.counter.over { color: var(--red); font-weight: 700; }

label.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.form-actions {
  padding-top: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #eef2f8;
}
.inline-form .field { flex: 1; margin: 0; }

form.upload {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #eef2f8;
}
form.upload progress {
  width: 100%;
  height: 7px;
  accent-color: var(--blue);
}
.upload-status { font-size: 12px; color: var(--muted); }

form.deploy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
form.deploy select {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 12px;
}

.pair {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 13px;
}
.pair dt { color: var(--muted); white-space: nowrap; }
.pair dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }

.release-summary { display: grid; gap: 10px; }
.release-summary .pair { padding-bottom: 9px; border-bottom: 1px solid #eef2f8; }
.release-summary .pair:last-of-type { border-bottom: 0; padding-bottom: 0; }

/* ---- Notices & Flash ---- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d7e0fe;
  border-radius: 8px;
  background: #edf2ff;
  color: #36477d;
  margin-bottom: 18px;
  font-size: 13px;
}
.notice .icon { margin-top: 2px; }
.notice.good {
  background: var(--green-soft);
  border-color: #bfe8da;
  color: var(--green);
}
.notice.warn {
  background: #fff6e8;
  border-color: #efdfbd;
  color: var(--amber);
}
.notice.bad {
  background: var(--red-soft);
  border-color: #f3cdd8;
  color: var(--red);
}
.err-text {
  color: var(--red);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty { padding: 24px 20px; color: var(--muted); font-size: 13px; }
.empty a { font-weight: 700; }

/* ---- Listing Screenshots ---- */
.slot-group + .slot-group {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eef2f8;
}
.slot-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.slot-title h3 { font-size: 13px; font-weight: 720; color: var(--ink); }

/* 스크린샷: 같은 높이에 원본 비율대로 놓는다(가로형·iPad·그래픽 이미지도 잘리지 않음).
   img의 width/height 속성으로 비율을 잡고, 크기를 모르면 9:16로 둔다. */
.shots {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: shot;
  --shot-h: 300px;
}
.shots.wide { --shot-h: 220px; }
.shots.icon { --shot-h: 128px; }
.shots.icon .shot-thumb { border-radius: 22%; }
.shots.icon .shot-thumb::before { display: none; }
.shots.small { --shot-h: 140px; gap: 8px; }
.shot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  counter-increment: shot;
}
.shot-thumb {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f0f3fa;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 37, 73, .06);
}
.shot-thumb::before {
  content: counter(shot);
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(20, 37, 73, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.shot-thumb img {
  display: block;
  height: var(--shot-h);
  width: auto;
  max-width: 100%;
  object-position: center;
  object-fit: contain;
  background: #eef2f8;
}
/* Play에서 가져온 이미지는 크기 정보가 없다. 불러온 이미지의 비율을 그대로 쓰고, 불러오기 전에만 최소 폭을 둔다. */
.shot-thumb img:not([width]) { min-width: calc(var(--shot-h) * .45); }
.shots.icon .shot-thumb img:not([width]) { min-width: var(--shot-h); }
.shot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.shot-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.shot-actions button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  min-height: 26px;
  padding: 2px;
  color: var(--muted);
  font-weight: 700;
}
.shot-actions button:hover:not(:disabled) {
  background: #edf1fb;
  color: var(--ink);
}
.shot-actions button.del:hover:not(:disabled) {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f3cdd8;
}

.listing-stack { display: grid; gap: 18px; }
.listing-stack > .panel { margin-top: 0; }
.upload-images {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px 16px;
  margin-top: 22px;
  padding: 16px;
  border: 1px dashed #cfd8e6;
  border-radius: 10px;
  background: #fbfcfe;
}
.upload-images .upload-title { grid-column: 1 / -1; font-size: 13px; font-weight: 720; }
.upload-images .field + .field { margin-top: 0; }
@media (max-width: 760px) {
  .upload-images { grid-template-columns: minmax(0, 1fr); }
  .shots { --shot-h: 220px; }
  .shots.wide { --shot-h: 150px; }
}

/* ---- Listing Preview Diff ---- */
.change-list { display: grid; gap: 10px; }
.change {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
  background: #fbfcfe;
}
.change strong { display: block; margin-bottom: 6px; font-size: 13px; }
.change del, .change ins {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  white-space: pre-wrap;
  font-size: 13px;
}
.change del { background: var(--red-soft); color: var(--red); margin-bottom: 4px; }
.change ins { background: var(--green-soft); color: var(--green); text-decoration: none; }

.slot-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.slot-diff-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.slot-diff-box .hint { margin-bottom: 10px; font-weight: 650; }

/* ---- Collapsible Panel (Folder Import) ---- */
details.fold > summary {
  list-style: none;
  cursor: pointer;
}
details.fold > summary::-webkit-details-marker { display: none; }
.fold-chevron { transition: transform .18s ease; color: var(--muted); }
details.fold[open] .fold-chevron { transform: rotate(90deg); }
.fold-inline {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef2f8;
}
.fold-inline > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.fold-inline > summary:hover { color: var(--ink); }
.policy-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.policy-form .check { margin-top: 0; }
.policy-form .field { margin-top: 4px; }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.folder-grid .field { margin-top: 0; }

/* ---- Timeline (Job Detail) ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.timeline li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.timeline .dot { margin-top: 7px; color: var(--blue); }
.timeline li.ev-error .dot { color: var(--red); }
.timeline li.ev-warn .dot { color: var(--amber); }
.timeline li.ev-error strong { color: var(--red); }
.timeline li.ev-warn strong { color: var(--amber); }
.timeline strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.timeline small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---- Locale Picker Row ---- */
.locale-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 1130px) {
  :root { --rail: 194px; }
  .top { padding-inline: 23px; }
  .content { padding-inline: 23px; }
  .rail { padding-inline: 13px; }
  .hero { padding-inline: 22px; gap: 14px; }
  .release-map { padding-left: 39px; }
  .map-route { left: 13px; width: 27px; }
  .map-route::before { width: 10px; }
  .map-route::after { right: calc(100% + 7px); }
}

@media (max-width: 960px) {
  .overview-grid,
  .editor-grid,
  .slot-diff,
  .folder-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .rail {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: min(245px, 85vw);
    height: calc(100dvh - 56px);
    z-index: 4;
    box-shadow: 8px 10px 35px #17244033;
  }
  .rail.open { display: flex; }
  .mobile-toggle {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #edf1fb;
    padding: 7px;
    color: var(--ink);
  }
  .top { height: 56px; padding-inline: 14px; }
  .crumb { gap: 7px; }
  .crumb .crumb-home,
  .crumb .chevron { display: none; }
  .top-tools { gap: 7px; }
  .worker { display: none; }
  .content { padding: 24px 14px 36px; }
  .page-head { margin-bottom: 18px; flex-wrap: wrap; align-items: flex-start; }
  .page-head h1 { font-size: 28px; }
  .page-head p { font-size: 13px; }
  .platform-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 510px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 19px 15px 15px;
  }
  .hero-main { padding: 3px 2px; }
  .hero-app h2 { font-size: 30px; }
  .hero-copy { margin-bottom: 12px; }
  .release-map { padding-block: 4px 6px; padding-left: 21px; }
  .map-route { top: 33px; bottom: 35px; left: 2px; width: 20px; }
  .map-route::before, .map-route::after { display: none; }
  .hero .lane { padding: 9px; min-height: 59px; gap: 5px; }
  .lane-main { gap: 6px; }
  .lane strong { font-size: 12px; }
  .lane small, .lane-state .mono { font-size: 10px; }
  .lane-state .lane-badge { font-size: 11px; }
  .section-head, .panel-body, .panel-foot { padding-inline: 14px; }
  thead th:first-child, tbody td:first-child { padding-left: 12px; }
  thead th:last-child, tbody td:last-child { padding-right: 12px; }
  thead th, tbody td { padding-inline: 8px; }
  .store-cell { min-width: 90px; }
  .app-ref { gap: 6px; }
  .app-ref .app-icon { width: 28px; height: 28px; border-radius: 7px; }
  .app-ref .app-icon .icon { width: 15px; height: 15px; }
  .status { padding-inline: 5px; font-size: 10px; }
  .status .dot { display: none; }
  .app-heading .app-icon { display: none; }
  .tabs { gap: 15px; }
}

/* ---- 설치 통계 ---- */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.stat-body { display: grid; gap: 13px; }
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat-total { font: 750 26px/1.3 var(--mono); margin: 4px 0 0; }
.stat-chart { width: 100%; height: auto; display: block; }
.stat-chart .grid { stroke: #e6ebf4; stroke-width: 1; }
.stat-chart .grid:first-of-type { stroke: #c0cbe2; }
.stat-chart .axis { fill: var(--muted); font: 11px var(--mono); }
.stat-chart .bar { fill: #5570d5; }
.stat-chart.android .bar { fill: #329884; }
.stat-chart .bar:hover { fill: #283e99; }
.stat-chart.android .bar:hover { fill: #17665b; }
.stat-chart .pending { fill: #f1f4fa; }
.stat-chart .deploy-mark line { stroke: #c27a12; stroke-width: 1; stroke-dasharray: 3 3; }
.stat-chart .deploy-mark path { fill: #c27a12; }
.deploy-list ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.deploy-list .mono { color: var(--muted); font-size: 12px; margin-right: 6px; }
.stats-note { margin-top: 16px; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}
.bucket-form { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid #eef2f8; }
.bucket-form .field { margin: 0; }
.bucket-form .action-row .hint { flex: 1; min-width: 180px; }

/* ---- 앱 일괄 연결 ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pick-table td { vertical-align: middle; }
.pick-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
.compact-input { min-width: 180px; padding: 6px 9px; font-size: 13px; }
.badge-new { display: inline-block; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 750; color: var(--blue); background: var(--blue-soft); vertical-align: middle; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 -4px 16px #20355c14; }
.hidden-list { list-style: none; margin: 0; padding: 4px 20px 16px; display: grid; gap: 6px; font-size: 13px; }
.hidden-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---- 계정 대시보드 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: #c9d3ea; text-decoration: none; }
.kpi strong { font: 750 24px/1.3 var(--mono); }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi-sep { color: #b4bfd4; font-weight: 400; }
.tone-bad { color: var(--red); font-weight: 700; }
.tone-warn { display: flex; align-items: center; gap: 4px; color: var(--amber); font-size: 12px; margin-top: 4px; }
.tone-warn .icon { width: 13px; height: 13px; }
.status-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; text-decoration: none; }
.install-cell { display: grid; gap: 3px; color: var(--ink); font-size: 13px; text-decoration: none; }
.install-cell:hover { text-decoration: none; color: var(--blue); }
.install-cell .hint { margin-right: 4px; }
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.overview-grid.stacked { grid-template-columns: minmax(0, 1fr); }

/* ---- MCP 연결 ---- */
.token-once { border-color: #efdfbd; margin-bottom: 18px; }
.token-once textarea { resize: vertical; }
.scope-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.scope-pick legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.scope-pick .check { font-size: 13px; align-items: flex-start; }
.tool-list h3 { font-size: 14px; margin: 14px 0 6px; }
.tool-list h3:first-child { margin-top: 0; }
.tool-list dl { margin: 0; display: grid; grid-template-columns: minmax(160px, max-content) 1fr; gap: 6px 14px; font-size: 13px; }
.tool-list dd { margin: 0; color: var(--muted); }

/* 로그인(서버 모드) */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-wrap { width: 100%; max-width: 380px; }
.login-brand { margin-bottom: 18px; }
.login-title { font-size: 18px; margin: 0 0 16px; }
.login-wrap .notice { margin-bottom: 14px; }
.login-submit { width: 100%; justify-content: center; margin-top: 16px; }
.rail-bottom form { margin-left: auto; }

/* ---- Store listing media ---- */
.listing-assets { margin-bottom: 18px; }
.listing-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.listing-asset-grid[data-play-assets] { grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); }
.listing-asset {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  overflow: hidden;
  background: var(--white);
}
.asset-art {
  display: grid;
  place-items: center;
  margin: 0;
  height: clamp(130px, 21vw, 228px);
  border-bottom: 1px solid var(--line);
  background: #eef2f8;
  color: var(--muted);
}
.asset-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.asset-art[data-slot="icon"] img { width: auto; height: 65%; border-radius: 14%; max-width: 90%; }
.asset-art span { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px; }
.asset-info, .listing-asset-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-info { padding: 13px 14px; flex: 1; }
.asset-info h3 { font-size: 14px; }
.asset-info .status { margin-top: 4px; }
.asset-info button { flex: none; }
.listing-text-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.listing-text-form .field + .field { margin-top: 0; }
.listing-text-form :is(.listing-wide-field, .form-actions) { grid-column: 1 / -1; }
.shot-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shot-actions .shot-replace { grid-area: 2 / 1 / 3 / -1; color: var(--blue); }

.listing-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 80px #14254942;
}
.listing-dialog::backdrop { background: #14254991; }
.listing-dialog .section-head { margin: 0; }
.image-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 14px; margin-bottom: 16px; }
.image-compare figure { margin: 0; min-width: 0; }
.image-compare figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.image-compare img, .candidate-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 155px;
  object-fit: contain;
  border-radius: 9px;
  background: #eef2f8;
}
.candidate-image { color: var(--muted); padding: 0 10px; text-align: center; }
.candidate-image:has(img:not([hidden])) { padding: 0; }

.device-dialog { width: min(970px, calc(100% - 24px)); }
.device-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.device-controls { padding: 16px; border-right: 1px solid var(--line); }
.device-controls > .hint { margin-top: 14px; }
.header-preview-info { width: min(100%, 340px); }
.header-preview-info > .hint { text-align: center; }
.header-crop {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}
.header-crop summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.header-crop-art { position: relative; overflow: hidden; margin: 8px 0 0; border-radius: 5px; }
.header-crop-art img { display: block; width: 100%; height: auto; }
.header-crop-art span { position: absolute; }
.header-crop-visible { border: 1px solid #fff; box-shadow: 0 0 0 100vmax #101b30a6; }
.header-crop-safe { border: 2px dashed #a5f3c4; filter: drop-shadow(0 0 1px #15321f); }
.header-crop-legend { list-style: none; margin: 6px 0; padding: 0; font-size: 11px; }
.header-crop-legend li { color: var(--muted); }
.device-stage {
  display: grid;
  place-content: center stretch;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  background: #e9eef7;
  min-width: 0;
}
.device-frame {
  --device-ratio: .46;
  --device-max-width: 290px;
  width: min(100%, var(--device-max-width), calc(65dvh * var(--device-ratio)));
  aspect-ratio: var(--device-ratio);
  padding: 6px;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  background: #25314b;
  border-radius: 26px;
  box-shadow: 0 10px 25px #263b6440;
  overflow: hidden;
}
.device-frame[data-family="IPAD"] { --device-max-width: 420px; }
.device-frame[data-orientation="landscape"] { --device-max-width: 640px; }
.device-screen {
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 20px;
  background: var(--white);
}
.device-page-top { position: relative; }
.device-screen-bar {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 750;
  border-bottom: 1px solid var(--line);
}
.device-page-top:has(.device-hero:not([hidden])) .device-screen-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  border-bottom: 0;
  color: #fff;
  background: linear-gradient(#1119, transparent);
}
.device-hero, .device-search-art { overflow: hidden; background: #eef2f8; }
.device-hero { position: relative; aspect-ratio: var(--header-ratio, 3 / 2); }
.device-hero img {
  display: block;
  position: absolute;
  left: var(--header-image-left, 0%);
  top: var(--header-image-top, 0%);
  width: var(--header-image-width, 100%);
  height: var(--header-image-height, 100%);
  object-fit: cover;
}
.device-search-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.device-search-art { margin: 0 14px 14px; border-radius: 8px; aspect-ratio: 3 / 2; }
.device-frame[data-orientation="landscape"] .device-search-art { max-width: 62%; }
.device-app { display: flex; align-items: center; gap: 10px; padding: 14px; }
.device-icon { flex: none; width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }
.device-icon-empty { display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 750; }
.device-app-title { display: grid; gap: 2px; flex: 1; min-width: 0; }
.device-app-title :is(strong, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-app-title small { color: var(--muted); }
.device-get { border-radius: 99px; padding: 4px 10px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; }
.device-media { margin: 0 14px 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.device-media h3 { font-size: 12px; margin-bottom: 8px; }
.device-shots { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; }
.device-shots img {
  width: calc((100% - 12px) / 3);
  height: auto;
  flex: none;
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-snap-align: start;
}
.device-shots.wide-shots img { width: 83%; }
.device-description { margin: 14px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.device-media-empty { font-size: 12px; color: var(--muted); }

@media (max-width: 650px) {
  .listing-asset-grid, .listing-asset-grid[data-play-assets], .listing-text-form { grid-template-columns: minmax(0, 1fr); }
  .device-layout { grid-template-columns: minmax(0, 1fr); }
  .device-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .device-controls .field + .field { margin-top: 0; }
  .device-controls > .hint { grid-column: 1 / -1; margin-top: 0; }
  .device-stage { padding: 14px; }
}
