:root {
  --gold: #C9A84C;
  --gold-light: #E8C96A;
  --dark: #0D1B2A;
  --dark2: #1A2A3A;
  --text: #F0EAD6;
  --text-muted: #A09880;
  --dot-new: #00E5A0;
  --danger: #E05A5A;
  --on-accent: #0D1B2A;
  --header-grad-end: #0a1520;
  --shadow-focus: rgba(201,168,76,.15);
  --success-text: #00E5A0;
}

[data-theme="light"] {
  --gold: #8B6F2A;
  --gold-light: #A3852F;
  --dark: #FFFFFF;
  --dark2: #FFFFFF;
  --text: #2B2418;
  --text-muted: #7A6F5C;
  --on-accent: #FFFFFF;
  --header-grad-end: #FFFFFF;
  --shadow-focus: rgba(139,111,42,.2);
  --success-text: #0AA37A;
}

.theme-toggle {
  width: 32px; height: 32px; padding: 0; background: transparent;
  border: 1px solid rgba(201,168,76,.4); border-radius: 4px; color: var(--gold);
  cursor: pointer; font-size: 1rem; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; transition: all .2s; margin-right: 8px;
}
.theme-toggle:hover { border-color: var(--gold); background: rgba(201,168,76,.1); }
.header-right { display: flex; align-items: center; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--dark); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; min-height: 100vh; }

.login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { width: 380px; padding: 48px 36px; text-align: center; }
.logo { color: var(--gold); font-size: 2rem; letter-spacing: .15em; font-weight: 700; }
.logo-sm { color: var(--gold); font-size: 1.2rem; letter-spacing: .12em; font-weight: 700; }
.logo-img { display: block; max-width: 240px; max-height: 90px; width: auto; height: auto; margin: 0 auto 10px; object-fit: contain; }
.logo-sm-img { display: block; height: 30px; width: auto; max-width: 180px; object-fit: contain; }
.login-subtitle { color: var(--text-muted); font-size: .95rem; margin-top: 6px; margin-bottom: 20px; }
.divider { width: 60px; height: 1px; background: var(--gold); margin: 0 auto 28px; }
label { display: block; color: var(--text-muted); font-size: .8rem; text-align: left; margin-bottom: 6px; letter-spacing: .05em; text-transform: uppercase; }
input, select, textarea {
  width: 100%; padding: 10px 14px; background: var(--dark2); border: 1px solid rgba(201,168,76,.3);
  color: var(--text); font-size: .95rem; border-radius: 5px; outline: none; transition: border-color .2s; margin-bottom: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--shadow-focus); }
textarea { resize: vertical; min-height: 60px; }

.btn {
  padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: .9rem;
  font-weight: 600; transition: all .2s; letter-spacing: .03em;
}
.btn-gold { background: var(--gold); color: var(--on-accent); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid rgba(201,168,76,.4); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(224,90,90,.4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-green { background: var(--dot-new); color: var(--on-accent); }
.btn-green:hover { background: #33ebb5; }
.error { color: var(--danger); font-size: .85rem; margin-top: 8px; min-height: 18px; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: linear-gradient(135deg, var(--dark2), var(--header-grad-end));
  border-bottom: 1px solid rgba(201,168,76,.3);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-sep { color: var(--text-muted); }
.header-title { color: var(--text-muted); font-size: .95rem; }

.main { max-width: 900px; margin: 0 auto; padding: 28px 24px; }
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.section-title { color: var(--text-muted); font-size: .8rem; letter-spacing: .1em; margin-bottom: 16px; }

.ship-list { display: flex; flex-direction: column; gap: 14px; }
.ship-card {
  background: var(--dark2); border: 1px solid rgba(201,168,76,.15); border-radius: 8px; padding: 20px 24px;
  transition: border-color .2s;
}
.ship-card:hover { border-color: rgba(201,168,76,.4); }
.ship-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ship-name { color: var(--gold); font-size: 1.15rem; font-weight: 600; }
.ship-card-actions { display: flex; gap: 8px; }
.ship-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .85rem; }
.ship-meta-label { color: var(--text-muted); }
.ship-meta-value { color: var(--text); }
.ship-meta-value a { color: var(--gold); text-decoration: none; cursor: pointer; }
.ship-meta-value a:hover { text-decoration: underline; }
.copy-feedback { color: var(--dot-new); font-size: .75rem; margin-left: 8px; opacity: 0; transition: opacity .3s; }
.copy-feedback.show { opacity: 1; }
.password-toggle { background: none; border: none; color: var(--gold); cursor: pointer; font-size: .8rem; margin-left: 8px; }
.no-ships { text-align: center; color: var(--text-muted); padding: 60px 0; font-size: 1rem; }

.wizard-screen { min-height: 100vh; display: flex; flex-direction: column; }
.wizard-progress { padding: 20px 24px 0; max-width: 900px; margin: 0 auto; width: 100%; }
.progress-bar { height: 4px; background: rgba(201,168,76,.15); border-radius: 2px; overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; background: var(--gold); transition: width .3s; }
.steps-indicator { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .2s;
  background: var(--dark2); border: 2px solid rgba(201,168,76,.3); color: var(--text-muted);
}
.step-dot.active { background: var(--gold); color: var(--on-accent); border-color: var(--gold); }
.step-dot.completed { background: transparent; border-color: var(--gold); color: var(--gold); }

.wizard-main { flex: 1; max-width: 900px; margin: 0 auto; width: 100%; padding: 24px; overflow-y: auto; }
.wizard-footer {
  display: flex; justify-content: space-between; padding: 16px 24px;
  border-top: 1px solid rgba(201,168,76,.15); max-width: 900px; margin: 0 auto; width: 100%;
}
.wizard-section-title { color: var(--gold); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.wizard-section-desc { color: var(--text-muted); font-size: .85rem; margin-bottom: 20px; line-height: 1.5; }
.field-group { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slug-preview { color: var(--text-muted); font-size: .8rem; margin-top: -10px; margin-bottom: 14px; }

.deck-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.deck-item {
  background: rgba(201,168,76,.05); border: 1px solid rgba(201,168,76,.15); border-radius: 6px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
}
.deck-item-info { flex: 1; }
.deck-item-label { color: var(--text); font-weight: 600; font-size: .95rem; }
.deck-item-desc { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.deck-item-badge {
  display: inline-block; padding: 2px 8px; background: rgba(201,168,76,.15); color: var(--gold);
  border-radius: 10px; font-size: .75rem; margin-left: 8px;
}
.deck-item-actions { display: flex; gap: 6px; }

.upload-zone {
  border: 2px dashed rgba(201,168,76,.3); border-radius: 8px; padding: 24px; text-align: center;
  cursor: pointer; transition: all .2s; margin-bottom: 10px; background: rgba(201,168,76,.02);
}
.upload-zone:hover { border-color: var(--gold); background: rgba(201,168,76,.05); }
.upload-zone.has-image { border-style: solid; }
.upload-zone-text { color: var(--text-muted); font-size: .85rem; }
.upload-thumbnail { max-height: 120px; border-radius: 4px; margin-top: 8px; }
.upload-info { color: var(--text-muted); font-size: .8rem; margin-top: 6px; }
.upload-row { margin-bottom: 18px; }
.upload-row-label { color: var(--text); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }

.placement-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.placement-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0;
}
.placement-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--dark2); border: 1px solid rgba(201,168,76,.2);
  border-radius: 18px; color: var(--text-muted); font-size: .82rem; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.placement-tab:hover { border-color: rgba(201,168,76,.5); color: var(--text); }
.placement-tab.active {
  background: rgba(201,168,76,.12); border-color: var(--gold); color: var(--gold);
}
.placement-tab.disabled { opacity: .5; cursor: not-allowed; }
.placement-tab-deck { font-weight: 600; color: inherit; }
.placement-tab-sec { color: var(--text-muted); }
.placement-tab.active .placement-tab-sec { color: var(--gold); }
.placement-tab-badge {
  background: var(--gold); color: var(--on-accent); font-size: .68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; min-width: 18px; text-align: center;
}
.placement-tab-warn {
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
}
.placement-actions { display: flex; align-items: center; gap: 10px; }
.placement-hint { color: var(--text-muted); font-size: .8rem; }

.placement-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px;
  align-items: start;
}
@media (max-width: 880px) { .placement-grid { grid-template-columns: 1fr; } }

.placement-stage {
  background: var(--dark2); border: 1px solid rgba(201,168,76,.15); border-radius: 8px;
  overflow: hidden;
}
.placement-stage-header {
  padding: 10px 14px; border-bottom: 1px solid rgba(201,168,76,.1);
  font-size: .85rem; color: var(--text);
}
.placement-canvas-wrap {
  background: var(--dark); display: flex; align-items: center; justify-content: center;
  min-height: 320px; max-height: 70vh; overflow: auto; padding: 0;
}
.placement-canvas {
  position: relative; cursor: crosshair; display: inline-block; line-height: 0;
  max-width: 100%;
}
.placement-canvas img {
  display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto;
  user-select: none; -webkit-user-drag: none;
}
.placement-empty {
  padding: 60px 24px; text-align: center; color: var(--text-muted); font-size: .9rem;
  background: var(--dark2); border: 1px dashed rgba(201,168,76,.2); border-radius: 8px;
}

.place-dot {
  position: absolute; transform: translate(-50%, -50%); cursor: grab;
  display: flex; align-items: center; gap: 6px; z-index: 5;
}
.place-dot:active { cursor: grabbing; }
.place-dot-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold);
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--on-accent);
  transition: transform .12s, box-shadow .12s;
}
.place-dot:hover .place-dot-num { transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.place-dot.selected .place-dot-num {
  background: var(--dot-new); color: var(--on-accent);
  box-shadow: 0 0 0 4px rgba(0,229,160,.25), 0 4px 12px rgba(0,0,0,.5);
}
.place-dot-label {
  background: rgba(13,27,42,.92); color: #F0EAD6; padding: 3px 8px; border-radius: 4px;
  font-size: .72rem; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
  border: 1px solid rgba(201,168,76,.3);
}
.place-dot:hover .place-dot-label, .place-dot.selected .place-dot-label { opacity: 1; }

.placement-side {
  background: var(--dark2); border: 1px solid rgba(201,168,76,.15); border-radius: 8px;
  padding: 14px; max-height: 70vh; overflow-y: auto;
}
.dot-editor {
  background: rgba(201,168,76,.06); border: 1px solid rgba(201,168,76,.25);
  border-radius: 6px; padding: 12px; margin-bottom: 14px;
}
.dot-editor-title { color: var(--gold); font-weight: 600; font-size: .85rem; margin-bottom: 10px; }
.dot-editor label { font-size: .72rem; margin-bottom: 4px; }
.dot-editor input { margin-bottom: 8px; padding: 8px 10px; font-size: .85rem; }
.dot-editor-meta { color: var(--text-muted); font-size: .75rem; margin-bottom: 10px; }
.dot-editor-actions { display: flex; gap: 6px; justify-content: flex-end; }

.dot-list-title { color: var(--text-muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.dot-list { display: flex; flex-direction: column; gap: 4px; }
.dot-list-empty { color: var(--text-muted); font-size: .82rem; padding: 14px 8px; text-align: center; }
.dot-list-item {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 5px;
  padding: 6px 8px; cursor: pointer; text-align: left; color: var(--text);
  font-family: inherit; font-size: .82rem; transition: all .12s;
}
.dot-list-item:hover { background: rgba(201,168,76,.06); border-color: rgba(201,168,76,.15); }
.dot-list-item.active { background: rgba(0,229,160,.08); border-color: rgba(0,229,160,.4); }
.dot-list-num {
  background: var(--gold); color: var(--on-accent); width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
}
.dot-list-item.active .dot-list-num { background: var(--dot-new); }
.dot-list-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-list-pos { color: var(--text-muted); font-size: .7rem; font-variant-numeric: tabular-nums; }

.pricing-field { margin-bottom: 10px; }
.pricing-field label { font-size: .78rem; margin-bottom: 4px; }
.pricing-field input { margin-bottom: 0; }
.pricing-section { margin-bottom: 20px; }
.pricing-section-title { color: var(--gold); font-size: .9rem; font-weight: 600; margin-bottom: 10px; }
.breakeven-box {
  background: rgba(201,168,76,.08); border: 1px solid rgba(201,168,76,.2); border-radius: 6px;
  padding: 14px 18px; margin-top: 14px;
}
.breakeven-box strong { color: var(--gold); }

.success-screen { text-align: center; padding: 60px 24px; }
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.success-title { color: var(--gold); font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; }
.success-url { color: var(--text); font-size: 1rem; margin-bottom: 6px; word-break: break-all; }
.success-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

.help-callout {
  background: rgba(201,168,76,.06); border-left: 3px solid var(--gold); padding: 12px 16px;
  font-size: .83rem; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; border-radius: 0 6px 6px 0;
}

.deck-form-panel {
  background: var(--dark2); border: 1px solid rgba(201,168,76,.2); border-radius: 8px;
  padding: 20px; margin-bottom: 14px;
}
.sections-list { margin-top: 10px; }
.section-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid rgba(201,168,76,.05);
}
.section-item input { margin-bottom: 0; flex: 1; }

.toggle-group {
  display: flex; border: 1px solid rgba(201,168,76,.3); border-radius: 5px; overflow: hidden; margin-bottom: 14px;
}
.toggle-option {
  flex: 1; padding: 8px 12px; text-align: center; cursor: pointer; font-size: .85rem;
  background: transparent; color: var(--text-muted); transition: all .2s; border: none;
}
.toggle-option.active { background: var(--gold); color: var(--on-accent); font-weight: 600; }

.strength-indicator { height: 3px; border-radius: 2px; margin-top: -10px; margin-bottom: 14px; transition: all .3s; }
.strength-weak { background: var(--danger); width: 33%; }
.strength-medium { background: #E8C96A; width: 66%; }
.strength-strong { background: var(--dot-new); width: 100%; }
