/* Kalculated Tool Base — shared styling for all tools (Tool Template v1) */

:root{
  --bg: #0b1220;
  --panel: #111a2b;
  --panel2: #0f172a;

  --text: #eaf0ff;
  --muted: #c8d2ea;
  --soft: #aebad6;

  --border: rgba(255,255,255,0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 14px;

  --kal-accent: #5ddcff;

  --link: #9bd1ff;
  --linkHover: #c6e6ff;

  --btn: rgba(255,255,255,0.08);
  --btnHover: rgba(255,255,255,0.12);
  --btnPrimary: rgba(155,209,255,0.18);
  --btnPrimaryHover: rgba(155,209,255,0.26);
}

*{ box-sizing: border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,18,32,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar .wrap,
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
  text-decoration:none;
  color: var(--text);
}

.brand-mark{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--kal-accent), rgba(93,220,255,0.65));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #06121f;
}

.brand-name{
  font-weight: 650;
  letter-spacing: 0.2px;
}

.topnav{
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 14px;
  color: var(--muted);
}

.topnav-link{
  color: var(--link);
  text-decoration: none;
}
.topnav-link:hover{ color: var(--linkHover); }

.topnav-sep{ opacity: 0.7; }
.topnav-current{ color: var(--muted); }

.main{ padding: 28px 0 44px; }

/* Hero */
.hero h1{
  margin: 10px 0 8px;
  font-size: 32px;
  letter-spacing: -0.2px;

  position: relative;
  padding-bottom: 10px;
  margin-bottom: 12px;
  text-shadow: 0 0 12px rgba(93,220,255,0.08);
}

.hero h1::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: var(--kal-accent);
  opacity: 0.9;
}

.subhead{
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.6;
}

.backlink{
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
}
.backlink:hover{ color: var(--linkHover); }

.note{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Hero spacing rhythm */
.hero .subhead{ margin-bottom: 8px; }
.hero .backlink{ display: inline-block; margin-bottom: 6px; }
.hero .note{ margin-top: 0; }

/* Grid + cards */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head{
  padding: 18px 18px 10px;
}

.card-head h2{
  margin: 0 0 6px;
  font-size: 18px;

  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(93,220,255,0.35);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.muted{ color: var(--muted); }

/* Forms */
.row{ margin-top: 14px; }

label{
  display:block;
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text);
  font-weight: 650;
}

input[type="number"], input[type="text"], select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
}

input::placeholder{ color: var(--soft); }

.hint{
  margin-top: 6px;
  color: var(--soft);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Buttons */
.actions,
.btnRow{
  display:flex;
  gap: 10px;
  margin-top: 18px;
}

.btn,
button{
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 160ms ease, transform 80ms ease;
  font-weight: 600;
}

.btn:hover,
button:hover{ background: var(--btnHover); }

.btn:active,
button:active{ transform: translateY(1px); }

.btn.primary{
  background: var(--btnPrimary);
}
.btn.primary:hover{
  background: var(--btnPrimaryHover);
}

.btn.small{
  padding: 8px 10px;
  font-size: 13px;
}

/* Share */
.sharebox{
  margin-top: 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.sharebox-top{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.sharelabel{
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.status{
  margin-top: 8px;
  font-size: 13px;
  min-height: 18px;
}

#shareLink{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Footer */
.footer{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.footer-text{
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  body{ font-size: 16px; }
  .hero h1{ font-size: 26px; }
}

/* Focus visibility */
:focus-visible{
  outline: 2px solid rgba(155,209,255,0.75);
  outline-offset: 2px;
}
