/* NXT Tools shared stylesheet — NextPower brand.
   Tokens sourced from the nextpower_branding_package (10_design_tokens.css);
   layout follows 14_internal_tool_component_rules.md: compact rhythm, white
   ground, orange reserved for the primary action. */

:root {
  --nxp-orange: #FE5000;
  --nxp-white: #FFFFFF;
  --nxp-black: #111111;
  --nxp-gray-950: #171717;
  --nxp-gray-800: #2F2F2F;
  --nxp-gray-600: #5E5E5E;
  --nxp-gray-400: #BDBDBD;
  --nxp-gray-200: #E8E8E8;
  --nxp-gray-100: #F5F5F5;

  --bg: var(--nxp-white);
  --surface: var(--nxp-white);
  --border: var(--nxp-gray-200);
  --text: var(--nxp-black);
  --muted: var(--nxp-gray-600);
  --accent: var(--nxp-orange);
  --danger: #b42318;

  --font: "Neue Montreal", Arial, Helvetica, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}
@media (max-width: 640px) {
  .container { padding: 20px 20px 48px; }
}

/* --- top nav: minimal, logo-led, 64px --- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 32px;
  background: var(--nxp-white);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .topnav { height: 56px; padding: 0 20px; }
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 18px; width: auto; display: block; }
.nav-title { font-weight: 700; font-size: 14px; letter-spacing: 0.01em; }
a.nav-title { color: inherit; text-decoration: none; }
a.nav-title:hover { text-decoration: underline; }
.nav-hub {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.nav-hub:hover { text-decoration: underline; }
.nav-sep { color: var(--nxp-gray-400); }
.nav-user {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topnav a { color: var(--text); }
.topnav .nav-right a { text-decoration: none; font-weight: 500; }
.topnav .nav-right a:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

button.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button.linklike:hover { text-decoration: underline; }

/* --- headings / text: bold, tight, minimal intro copy --- */
h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
h2 { font-size: 20px; line-height: 1.2; font-weight: 700; margin: 28px 0 12px; }
.subtitle { color: var(--muted); font-size: 16px; margin: 0 0 24px; }

a { color: var(--text); }

/* --- cards (hub tool grid): group functions, not decoration --- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-card:hover { border-color: var(--nxp-black); box-shadow: var(--shadow-md); }
.tool-card .tool-icon { font-size: 24px; }
.tool-card .tool-name { font-weight: 700; font-size: 16px; margin: 10px 0 4px; }
.tool-card .tool-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* --- panels / forms: compact, labels adjacent, action aligned --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.panel.narrow { max-width: 420px; margin: 8vh auto 0; }

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 16px 0 6px;
}
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--nxp-gray-400);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--nxp-white);
  color: var(--text);
}
textarea { min-height: 0; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--nxp-orange);
  outline-offset: 1px;
  border-color: var(--nxp-orange);
}

/* primary action: orange fill, verb-first label, one per row */
button.primary {
  margin-top: 20px;
  min-height: 44px;
  padding: 10px 24px;
  background: var(--nxp-orange);
  color: var(--nxp-white);
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
button.primary:hover { background: #E14800; }
button.primary[disabled] { opacity: 0.6; cursor: default; }

button.secondary {
  min-height: 44px;
  padding: 10px 20px;
  background: var(--nxp-white);
  color: var(--text);
  border: 1px solid var(--nxp-black);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.secondary:hover { background: var(--nxp-gray-100); }

.error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* --- history / results: compact rows, explicit empty state --- */
.run-list { list-style: none; padding: 0; margin: 16px 0; }
.run-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.run-item a { color: var(--text); text-decoration: none; font-weight: 600; }
.run-item a:hover { text-decoration: underline; }
.run-meta { color: var(--muted); font-size: 12px; }
.run-empty { color: var(--muted); padding: 20px 4px; }

pre.output {
  background: var(--nxp-gray-950);
  color: var(--nxp-gray-100);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
}

table.kv { border-collapse: collapse; margin: 10px 0; }
table.kv td { border: 1px solid var(--border); padding: 6px 12px; font-size: 13px; }
table.kv td:first-child { color: var(--muted); background: var(--nxp-gray-100); }

.file-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.file-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--nxp-black);
  border-radius: var(--radius-sm);
  background: var(--nxp-white);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.file-links a:hover { background: var(--nxp-gray-100); }
