/* KØNSTAT v0.1 — styles. Plain CSS, no framework. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  background: #e8edf3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}
button:hover { background: #f1f5f9; border-color: #94a3b8; }
button[aria-pressed="true"] { background: #0f172a; color: #fff; border-color: #0f172a; }
button:disabled { opacity: .5; cursor: default; }
input[type="text"], input[type="number"], select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 6px;
}
input[type="color"] { width: 44px; height: 28px; padding: 1px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
input[type="range"] { width: 110px; vertical-align: middle; }
.muted { color: #64748b; }
.small { font-size: 12px; }
.spacer { flex: 1; }
.sep { width: 1px; align-self: stretch; background: #cbd5e1; margin: 0 4px; }

/* Top bar */
#topbar {
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  flex-wrap: wrap;
}
#topbar .brand { font-size: 20px; font-weight: 800; letter-spacing: .04em; }
#topbar .brand-mark { width: 30px; height: 30px; vertical-align: middle; margin-right: 8px; }
#topbar .brand-sub { font-size: 12px; font-weight: 400; color: #94a3b8; letter-spacing: 0; }
#topbar .proj { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
#topbar label { color: #cbd5e1; font-size: 13px; display: flex; align-items: center; gap: 6px; }
#topbar input[type="text"] { background: #1e293b; border-color: #334155; color: #fff; width: 190px; }
#topbar button { background: #1e293b; border-color: #334155; color: #e2e8f0; }
#topbar button:hover { background: #334155; }

/* Page tabs + flow controls */
#pagebar, #toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  flex-wrap: wrap;
}
#pageTabs { display: flex; gap: 4px; flex-wrap: wrap; }
#pageTabs .tab {
  border: 1px solid #cbd5e1;
  border-radius: 6px 6px 0 0;
  background: #e2e8f0;
  padding: 4px 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
#pageTabs .tab.active { background: #fff; border-bottom-color: #fff; font-weight: 700; }
#pageTabs .tab .x {
  border: none; background: none; padding: 0 2px; color: #64748b;
  font-size: 13px; line-height: 1;
}
#pageTabs .tab .x:hover { color: #b91c1c; }
#pageTabs .tab .rn { border: none; background: none; padding: 0; font-size: 12px; color: #64748b; }
#pageTabs .tab .rn:hover { color: #0f172a; }
.ctl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; }

/* Workspace */
#workspace { flex: 1; display: flex; min-height: 0; }
#canvas { flex: 1; min-width: 0; display: block; background: #e8edf3; cursor: grab; outline: none; }
#canvas:active { cursor: grabbing; }
#props {
  width: 264px;
  flex: none;
  background: #fff;
  border-left: 1px solid #cbd5e1;
  padding: 12px 14px;
  overflow-y: auto;
}
#props h2 { margin: 0 0 10px; font-size: 15px; }
#props .field { display: block; margin-bottom: 10px; font-size: 13px; color: #334155; }
#props .field input[type="text"], #props .field select { width: 100%; margin-top: 3px; }
#props .row { display: flex; gap: 10px; }
#props .row .field { flex: 1; }
#props .check { display: flex; align-items: center; gap: 6px; }
#props hr { border: none; border-top: 1px solid #e2e8f0; margin: 14px 0; }

/* Status bar */
#statusbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 5px 12px;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 760px) {
  #workspace { flex-direction: column; }
  #canvas { min-height: 55vh; }
  #props { width: auto; border-left: none; border-top: 1px solid #cbd5e1; max-height: 40vh; }
}

/* Choice modal (v0.1.1: replace confirmation, export-budget offer) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; color: #0f172a;
  border-radius: 10px; padding: 18px 20px;
  max-width: 440px; width: calc(100vw - 48px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}
.modal h2 { margin: 0 0 8px; font-size: 16px; }
.modal p { margin: 0 0 14px; font-size: 14px; color: #334155; }
.modal-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
