/* PoleFX Sizing Diagram — embeddable art */

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-border: #2a3040;
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #6ea8ff;
  --accent-dim: #3d6fb5;
  --input-bg: #0c0e13;
  --ok: #3dd68c;
  --warn: #f0b429;
  --danger: #f07178;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  overflow-y: auto;
  padding: 20px 18px 32px;
}

.panel-header {
  margin-bottom: 20px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2b5a9e, #1a3a6b);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--panel-border);
}

.section:last-child {
  border-bottom: 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

label.primary {
  color: var(--text);
  font-weight: 500;
}

label.derived input {
  color: var(--accent);
  font-weight: 600;
  background: #0f1624;
  border-color: var(--accent-dim);
}

.optional {
  font-weight: 400;
  opacity: 0.7;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 8px;
}

label.checkbox input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

input[type="text"],
input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.15);
}

input[readonly] {
  cursor: default;
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 4px;
}

.input-with-unit input {
  margin-top: 0;
  border-radius: 7px 0 0 7px;
}

.input-with-unit .unit {
  padding: 8px 10px;
  background: #141820;
  border: 1px solid var(--panel-border);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.stack-check {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--mono);
  background: #12151c;
  border: 1px solid var(--panel-border);
  color: var(--muted);
}

.stack-check.ok {
  border-color: rgba(61, 214, 140, 0.35);
  color: var(--ok);
}

.stack-check.error {
  border-color: rgba(240, 113, 120, 0.4);
  color: var(--danger);
}

.fixed-stack {
  font-size: 12px;
  color: var(--muted);
}

.fixed-table {
  width: 100%;
  border-collapse: collapse;
}

.fixed-table td {
  padding: 4px 0;
  border-bottom: 1px solid var(--panel-border);
}

.fixed-table td:last-child {
  text-align: right;
  font-family: var(--mono);
  color: var(--text);
}

.fixed-table tr:last-child td {
  border-bottom: 0;
  padding-top: 8px;
  color: var(--text);
}

.fixed-table .tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font);
  font-weight: 600;
  background: rgba(110, 168, 255, 0.15);
  color: var(--accent);
  vertical-align: middle;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: #1c2130;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.btn:hover {
  background: #252b3d;
  border-color: #3a4258;
}

.btn.primary {
  background: linear-gradient(180deg, #4d8de8, #3a6fbe);
  border-color: #5a96ea;
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(180deg, #5b9af0, #4480d4);
}

/* —— Preview —— */

.preview-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60, 90, 140, 0.1), transparent 50%),
    #0a0c10;
  overflow: auto;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.art-frame {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 24px 48px;
}

/* White card around the art for screen preview only */
.art-frame svg {
  width: min(100%, 480px);
  height: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* —— Print / embed clean —— */

@media print {
  @page {
    size: letter portrait;
    margin: 0.5in;
  }

  html,
  body {
    background: #fff !important;
    height: auto;
    overflow: visible;
  }

  .app {
    display: block;
    height: auto;
  }

  .panel,
  .preview-toolbar,
  .no-print {
    display: none !important;
  }

  .preview-wrap {
    background: #fff !important;
    overflow: visible;
    display: block;
  }

  .art-frame {
    padding: 0;
    display: block;
  }

  .art-frame svg {
    width: 100% !important;
    max-width: 520px;
    margin: 0 auto;
    display: block;
    box-shadow: none;
    border-radius: 0;
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }

  .preview-wrap {
    min-height: 60vh;
  }
}
