/* ============================================================
   CutsPro – Stylesheet
   Spalvų schema: tamsus navy + oranžinis akcentas
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

/* ---------- CSS kintamieji ---------- */
:root {
  --c-bg:        #f4f3ef;
  --c-surface:   #ffffff;
  --c-border:    #e2e1dc;
  --c-text:      #1a1a1a;
  --c-muted:     #6b6b6b;
  --c-accent:    #e8650a;
  --c-accent-h:  #c85508;
  --c-navy:      #1e2b3c;
  --c-navy-l:    #263548;
  --c-green:     #22a06b;
  --c-red:       #d93025;
  --font-main:   'DM Sans', sans-serif;
  --font-mono:   'Space Mono', monospace;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --transition:  .18s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--c-bg); color: var(--c-text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  background: var(--c-navy);
  border-bottom: 3px solid var(--c-accent);
  position: sticky; top: 0; z-index: 100;
}
.nav__inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
}
.nav__logo {
  width: 32px; height: 32px;
  background: var(--c-accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav__logo svg { color: #fff; }
.nav__title {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  color: #fff; letter-spacing: -0.5px;
}
.nav__title span { color: var(--c-accent); }
.nav__version {
  font-size: 10px; color: rgba(255,255,255,.45);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.nav__links {
  display: flex; gap: 4px; list-style: none;
  align-items: center;
}
.nav__links a {
  color: rgba(255,255,255,.75);
  font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  transition: var(--transition);
}
.nav__links a:hover,
.nav__links a.active { color: #fff; background: rgba(255,255,255,.08); }
.nav__links a.active { color: var(--c-accent); }

/* hamburger */
.nav__burger {
  display: none;
  background: none; border: none;
  padding: 6px;
  flex-direction: column; gap: 5px;
}
.nav__burger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: var(--transition);
}
.nav__mobile {
  display: none;
  flex-direction: column;
  background: var(--c-navy-l);
  padding: 8px 16px 12px;
}
.nav__mobile a {
  color: rgba(255,255,255,.8);
  font-size: 14px; font-weight: 500;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: block;
  transition: var(--transition);
}
.nav__mobile a:last-child { border: none; }
.nav__mobile a:hover { color: var(--c-accent); }
.nav__mobile.open { display: flex; }

/* ============================================================
   HERO / PAGE HEADER
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--c-navy) 0%, #2a3f58 100%);
  padding: 36px 20px 32px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 600; color: #fff;
  letter-spacing: -0.5px;
}
.page-hero p {
  color: rgba(255,255,255,.6);
  font-size: 14px; margin-top: 6px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.page-hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232,101,10,.15);
  border: 1px solid rgba(232,101,10,.4);
  color: var(--c-accent);
  font-size: 12px; font-family: var(--font-mono);
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 14px;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content { flex: 1; }

.app-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}

/* ============================================================
   PANEL (bendras kortelis)
   ============================================================ */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel__title {
  font-size: 11px; font-weight: 600;
  color: var(--c-muted); letter-spacing: .8px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.panel__title svg { flex-shrink: 0; }

/* ============================================================
   FORMOS ELEMENTAI
   ============================================================ */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 10px; font-weight: 600;
  color: var(--c-muted); letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.inp {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--c-border);
  border-radius: 7px;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.inp:focus {
  border-color: var(--c-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232,101,10,.12);
  background: #fff;
}
.inp-sm { width: 110px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* toggle */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
}
.tog {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.tog input { opacity: 0; width: 0; height: 0; position: absolute; }
.tog-sl {
  position: absolute; inset: 0;
  background: #cbd5e0; border-radius: 11px;
  cursor: pointer; transition: .2s;
}
.tog-sl::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tog input:checked + .tog-sl { background: var(--c-accent); }
.tog input:checked + .tog-sl::before { transform: translateX(18px); }
.tog-lbl { font-size: 13px; color: var(--c-text); font-weight: 500; }
/* Toggle lentelėje */
.tbl td .tog {
  display: inline-block;
  vertical-align: middle;
}
.tbl td .tog,
.btn-del,
.btn-add {
  margin-top: 6px;
}

/* Matomas hint prie input */
.hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  background: var(--c-border);
  color: var(--c-text);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
}
.hint-icon:hover {
  background: var(--c-accent);
  color: #fff;
}

/* ============================================================
   MYGTUKAS OPTIMIZUOTI
   ============================================================ */
.btn-run {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(232,101,10,.3);
}
.btn-run:hover {
  background: var(--c-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,101,10,.4);
}
.btn-run:active { transform: translateY(0); }

/* ============================================================
   SUVESTINĖ
   ============================================================ */
.summary {
  background: var(--c-navy);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  color: #fff;
}
.summary h3 {
  font-size: 11px; font-weight: 600;
  color: var(--c-accent); letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.summary__row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.summary__row:last-child { border: none; }
.summary__val {
  font-weight: 600; font-family: var(--font-mono); font-size: 13px;
}
.summary__val--accent { color: var(--c-accent); }
.summary__val--green  { color: #4ade80; }

/* ============================================================
   DETALIŲ LENTELĖ
   ============================================================ */
.parts-panel {}
.parts-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.parts-header h2 { font-size: 16px; font-weight: 600; }
.parts-header p  { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.parts-badge {
  background: var(--c-accent);
  color: #fff; font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; align-self: flex-start;
}

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px; table-layout: fixed;
  min-width: 0px;
}
.tbl th {
  text-align: left;
  font-size: 10px; font-weight: 600;
  color: var(--c-muted); letter-spacing: .6px;
  text-transform: uppercase;
  padding: 8px 8px;
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-border);
}
.tbl td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.tbl tr:last-child td { border: none; }
.tbl tr:hover td { background: #fafaf8; }

.tinp {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color var(--transition);
}
.tinp:focus { border-color: var(--c-accent); outline: none; }

.btn-add {
  background: var(--c-accent);
  border: none; color: #fff;
  width: 30px; height: 30px;
  border-radius: 7px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--transition);
}
.btn-add:hover { background: var(--c-accent-h); }

.btn-del {
  background: none; border: none;
  color: #c0392b; font-size: 15px;
  padding: 3px 6px; border-radius: 5px;
  transition: background var(--transition);
}
.tbl td .tog,
.btn-del {
  margin-top: 6px;
}
.btn-del:hover { background: #fdf0f0; }

/* ============================================================
   PLOKŠTĖS (rezultatai)
   ============================================================ */
.boards-wrap { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }

.board-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.board-hdr {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.board-hdr__title {
  font-size: 15px; font-weight: 600; color: var(--c-text);
}
.board-hdr__title span { font-size: 11px; color: var(--c-muted); font-weight: 400; margin-left: 4px; }
.board-hdr__stats { font-size: 12px; color: var(--c-muted); display: flex; gap: 14px; flex-wrap: wrap; }

.eff-g { color: var(--c-green);  font-weight: 600; }
.eff-o { color: var(--c-accent); font-weight: 600; }
.eff-r { color: var(--c-red);    font-weight: 600; }

.board-canvas-wrap { overflow-x: auto; }
canvas {
  display: block;
  border-radius: 0px;
  background: #d4d4ce;
  border: 1.5px solid var(--c-border);
  max-width: 100%;
}

/* ============================================================
   INSTRUKCIJOS / FAQ
   ============================================================ */
.info-section {
  max-width: 1280px; margin: 0 auto;
  padding: 40px 16px 60px;
}
.info-section h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600; margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.info-section .sub {
  color: var(--c-muted); font-size: 14px; margin-bottom: 28px;
}

/* instrucijų kortelės */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.step-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.step-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-accent);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700;
  color: rgba(232,101,10,.15);
  line-height: 1;
  margin-bottom: 8px;
}
.step-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-card p  { font-size: 13px; color: var(--c-muted); line-height: 1.6; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.faq-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left;
  padding: 16px 18px;
  background: none; border: none;
  font-size: 14px; font-weight: 600;
  color: var(--c-text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--c-bg); }
.faq-q svg { flex-shrink: 0; transition: transform .2s; color: var(--c-accent); }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 18px 16px;
  font-size: 13px; color: var(--c-muted); line-height: 1.7;
  border-top: 1px solid var(--c-border);
}
.faq-item.open .faq-a { display: block; }
.faq-a strong { color: var(--c-text); }

/* rašto kryptis */
.grain-info {
  background: var(--c-navy);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  margin-bottom: 40px;
}
.grain-info h3 {
  font-size: 16px; font-weight: 600;
  color: var(--c-accent); margin-bottom: 6px;
}
.grain-info p { font-size: 13px; color: rgba(255,255,255,.7); line-height: 1.7; }
.grain-visual {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grain-box {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 14px;
}
.grain-box h4 { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5); letter-spacing: .5px; margin-bottom: 8px; text-transform: uppercase; }
.grain-box p  { font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.6; }
.grain-box svg { margin-bottom: 8px; color: var(--c-accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--c-navy);
  border-top: 3px solid var(--c-accent);
  color: rgba(255,255,255,.65);
  padding: 40px 20px 24px;
}
.footer__inner {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.footer__brand .nav__logo {
  width: 36px; height: 36px;
  margin-bottom: 10px;
}
.footer__brand h3 {
  font-family: var(--font-mono);
  font-size: 16px; color: #fff; font-weight: 700;
}
.footer__brand p {
  font-size: 13px; line-height: 1.7; margin-top: 6px; max-width: 260px;
}
.footer__col h4 {
  font-size: 11px; font-weight: 600;
  color: #fff; letter-spacing: .8px;
  text-transform: uppercase; margin-bottom: 12px;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer__col a {
  font-size: 13px; color: rgba(255,255,255,.55);
  transition: color var(--transition);
}
.footer__col a:hover { color: var(--c-accent); }
.footer__bottom {
  max-width: 1280px; margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: rgba(255,255,255,.35);
}
.footer__bottom a { color: rgba(255,255,255,.45); }
.footer__bottom a:hover { color: var(--c-accent); }

/* ============================================================
   LEGENDA
   ============================================================ */
.board-legend {
  display: flex;
  flex-direction: column;
  gap: 6px 16px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 7px;
}
.board-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.board-legend__color {
  width: 13px; height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.1);
}
.board-legend__name {
  font-weight: 600;
  color: var(--c-text);
}
.board-legend__dim {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-muted);
}

/* ============================================================
   SPAUSDINIMO MYGTUKAS
   ============================================================ */
.btn-print {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px 20px;
  background: var(--c-navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-print:hover {
  background: var(--c-navy-l);
  transform: translateY(-1px);
}
.btn-print:active { transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app-wrap { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .grain-visual { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .col-hide { display: none; }
    .tinp {
    font-size: 13px;
    padding: 7px 8px;
  }
}

@media (max-width: 480px) {
  .app-wrap { padding: 12px 10px; }
  .panel { padding: 14px; }
  .board-card { padding: 12px; }
  .col-hide { display: none; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

#toast {
  position: fixed;
  top: 24px; /* Šiek tiek žemiau nuo viršaus */
  left: 50%;
  transform: translateX(-50%);

  min-width: 320px;
  max-width: 90%;

  /* Ryški, bet ne "pigiai" atrodanti raudona */
  background: #c0392b; 
  color: #ffffff;

  padding: 16px 20px;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;

  z-index: 9999;

  /* Gylesnis šešėlis su šiek tiek spalvos geresniam gyliui */
  box-shadow: 0 10px 30px rgba(192, 57, 43, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);

  /* Kontrastingas kairys kraštas */
  border-left: 6px solid #8e2a20;
  
  font-family: 'DM Sans', sans-serif;

  /* Švelnus atsiradimo efektas */
  animation: slideIn 0.3s ease-out forwards;
  
  /* Užtikriname, kad tekstas būtų skaitomas */
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Animacija: iš viršaus į apačią su švelniu skaidrumu */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}