/* ============ Fresas & Velocidades ============ */
:root {
  --bg: #f3f1ed; --bg2: #e9e6e0; --card: #ffffff; --line: #dcd8d0; --line2: #ece9e3;
  --txt: #1d2226; --muted: #6a7178; --accent: #e8741a; --accent-2: #ffb266; --accent-ink: #fff;
  --ok: #1f9d6b; --warn: #c98100; --bad: #d23f3f; --info: #2b7fd1;
  --des: #e8833a; --det: #3a9be8; --div: #8e6be8;
  --claude: #3a7be8;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  --r: 12px; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #15181b; --bg2: #1c2024; --card: #1f2428; --line: #30363c; --line2: #272c31;
  --txt: #e8eaec; --muted: #8d959c; --accent: #f28c28; --accent-2: #ffb266; --accent-ink: #1a1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --claude: #7aa7ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: clip; }
body { font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--txt); min-height: 100vh; }
h2 { font-size: 20px; margin: 0; } h3 { font-size: 14px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 12px; } .mt { margin-top: 8px; } .mt2 { margin-top: 20px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.spacer { flex: 1; } .right { text-align: right; } .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--txt); text-decoration: none; }
.brand .logo { width: 30px; height: 30px; color: var(--accent); }
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 10px; }
.tabs a { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 7px 12px; border-radius: 7px; cursor: pointer; display: flex; gap: 6px; align-items: center; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--txt); }
.tabs a.active { background: var(--card); color: var(--txt); box-shadow: var(--shadow); }
.count { background: var(--line); color: var(--txt); font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.ia-btn { background: color-mix(in srgb, var(--claude) 14%, var(--card)); border-color: color-mix(in srgb, var(--claude) 40%, var(--line)); color: var(--claude); }
.spark { color: var(--claude); }
.icon-btn { border: 1px solid transparent; background: none; color: var(--muted); font-size: 16px; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; }
.icon-btn:hover { background: var(--bg2); color: var(--txt); }
input, select, textarea { width: 100%; font: inherit; font-weight: 400; color: var(--txt); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #181c20; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; } label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.full { grid-column: 1 / -1; }

/* segmented */
.seg { display: flex; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 10px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: center; }
.seg button.on { background: var(--card); color: var(--txt); box-shadow: var(--shadow); }
.seg.small button { padding: 4px 10px; font-size: 12px; }
.seg.col { flex-direction: column; }
.seg.col button { text-align: left; display: flex; justify-content: space-between; align-items: center; }
.seg.col button small { font-weight: 500; color: var(--muted); font-size: 11px; }
#modeSeg button.on[data-v="conservador"] { color: var(--ok); } #modeSeg button.on[data-v="rapido"] { color: var(--bad); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--txt); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { opacity: .6; font-weight: 500; margin-left: 4px; }

/* ---------- Layout */
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }

/* ---------- Calculadora */
.calc-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.calc-form { position: sticky; top: 76px; padding: 0; max-height: calc(100vh - 96px); overflow: auto; }
.step { padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.step:last-child { border-bottom: 0; }
.step-h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.step-h > span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; }
.step-h .seg { margin-left: auto; }
.sugg-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sugg { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.sugg button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); font: inherit; text-align: left; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.sugg button:hover { border-color: var(--accent); }
.sugg button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.sugg .mini { width: 22px; height: 38px; flex: none; display: block; }
.sugg .mini svg { width: 100%; height: 100%; }
.sugg .c { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.sugg .d { font-size: 12px; color: var(--muted); }
.sugg-empty { font-size: 12px; color: var(--muted); padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }
.bit-summary { margin-top: 10px; font-size: 12px; color: var(--muted); }
.only-v, .only-tip { display: none; }
.show-v .only-v, .show-tip .only-tip { display: flex; }

.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.res-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.res-head p { margin: 4px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.tile .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile .pt { font-size: 11px; color: var(--muted); }
.tile .val { font-family: var(--mono); font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; white-space: nowrap; }
.tile .val small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile .dial { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 2px 10px; border-radius: 99px; font-size: 13px; }
.tile .txt { font-size: 13px; font-weight: 600; margin-top: 8px; }
.tile.na .val { color: var(--muted); font-size: 20px; }
.tile.hl { border-color: var(--accent); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { border-radius: 10px; padding: 10px 14px; font-size: 13px; border: 1px solid; }
.alert.warn { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.alert.info { background: color-mix(in srgb, var(--info) 8%, var(--card)); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line2); }
.tbl td.m { font-family: var(--mono); }
.tbl tr.cur td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: var(--bg2); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); text-align: right; }
.tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* ---------- Fresas */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { width: 300px; }
.toolbar select { width: 190px; }
.toolbar h2 { margin-right: 10px; }
.toolbar p { margin: 0; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 10; display: flex; flex-direction: column; }
.menu-list a, .menu-list label { color: var(--txt); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.menu-list a:hover, .menu-list label:hover { background: var(--bg2); }
.cat-h { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-weight: 700; }
.cat-h .dot { width: 10px; height: 10px; border-radius: 50%; }
.cat-h .muted { font-weight: 500; }
.bits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bit { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; display: flex; flex-direction: column; }
.bit:hover { transform: translateY(-2px); border-color: var(--accent); }
.bit .img { height: 130px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--bg2), var(--card)); position: relative; }
.bit .img svg.bitsvg { height: 122px; width: auto; }
.bit .img img { max-height: 118px; max-width: 90%; object-fit: contain; }
.bit .img img.photo { max-height: 130px; max-width: 100%; width: 100%; height: 130px; object-fit: cover; }
.code-badge { font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; color: #fff; background: var(--des); }
.code-badge.DET { background: var(--det); } .code-badge.DIV { background: var(--div); }
.bit .code-badge { position: absolute; top: 8px; left: 8px; }
.bit .state { position: absolute; top: 8px; right: 8px; }
.bit .info { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.bit .name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.bit .specs { display: flex; flex-wrap: wrap; gap: 4px; }
.bit .specs span { font-size: 11px; background: var(--bg2); padding: 1px 6px; border-radius: 4px; color: var(--muted); font-family: var(--mono); }
.list .tbl svg.bitsvg { width: 20px; height: 34px; vertical-align: middle; }
.list .tbl td.ph img.photo { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; }
.empty { text-align: center; padding: 60px 20px; border: 2px dashed var(--line); border-radius: var(--r); }

/* ---------- Receitas */
.rec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.rec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.rec h4 { margin: 0; font-size: 15px; }
.rec .meta { font-size: 12px; color: var(--muted); }
.rec .vals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rec .vals div { background: var(--bg2); border-radius: 6px; padding: 6px; text-align: center; }
.rec .vals b { display: block; font-family: var(--mono); font-size: 13px; }
.rec .vals span { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.stars button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--line); padding: 0 1px; }
.stars button.on { color: var(--accent); }

/* ---------- Máquina */
.mach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.motor, .equip { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.motor .grow, .equip .grow { flex: 1; min-width: 0; }
.motor b, .equip b { display: block; }
.dials { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dials span { font-family: var(--mono); font-size: 11px; background: var(--bg2); padding: 2px 6px; border-radius: 4px; }
.dials span b { display: inline; color: var(--accent); }
.dialtbl { margin: 12px 0; display: grid; grid-template-columns: 80px 1fr 34px; gap: 6px; align-items: center; }
.dialtbl .h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* ---------- Dialog */
.dlg { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--card); color: var(--txt); width: min(640px, 96vw); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.dlg.wide { width: min(920px, 96vw); }
.dlg.narrow { width: min(560px, 96vw); }
.dlg::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.dlg-h, .dlg-f { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.dlg-h { border-bottom: 1px solid var(--line2); justify-content: space-between; }
.dlg-h h2 { display: flex; gap: 10px; align-items: center; font-size: 17px; }
.dlg-f { border-top: 1px solid var(--line2); }
.dlg-body { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 18px; max-height: 70vh; overflow: auto; }
.dlg-body.block { display: block; }
.dlg-body.block > label { margin-top: 10px; }
.photo-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.photo { height: 220px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, var(--bg2), var(--card)); border: 1px solid var(--line2); display: grid; place-items: center; overflow: hidden; }
.photo svg.bitsvg { height: 205px; width: auto; }
.photo img { max-width: 100%; max-height: 210px; object-fit: contain; }
.photo img.photo-real { width: 100%; height: 100%; object-fit: cover; max-height: none; }
[data-show] { display: none; } [data-show].vis { display: flex; }

/* ---------- Chat drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0,0,0,.25); z-index: 40; display: flex; flex-direction: column; transform: translateX(105%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
.drawer.open { transform: none; visibility: visible; }
.drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.chat-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 4px; }
.msg.error { align-self: stretch; background: color-mix(in srgb, var(--bad) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.msg img.att { max-width: 140px; max-height: 110px; border-radius: 6px; display: block; margin-bottom: 6px; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg code { font-family: var(--mono); font-size: 12px; background: color-mix(in srgb, var(--txt) 10%, transparent); padding: 1px 4px; border-radius: 4px; }
.msg pre { background: #111; color: #eee; padding: 10px; border-radius: 8px; overflow: auto; }
.msg pre code { background: none; color: inherit; }
.msg h1, .msg h2, .msg h3, .msg h4 { font-size: 14px; margin: 10px 0 4px; text-transform: none; letter-spacing: 0; color: var(--txt); display: block; }
.msg table { border-collapse: collapse; font-size: 12px; margin: 6px 0; } .msg td, .msg th { border: 1px solid var(--line); padding: 3px 6px; }
.msg .usage { font-size: 10px; color: var(--muted); margin-top: 6px; }
.typing::after { content: "▍"; animation: blink 1s infinite; color: var(--claude); } @keyframes blink { 50% { opacity: 0; } }
.chat-welcome { color: var(--muted); }
.chat-welcome .qs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.chat-welcome .qs button { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--txt); font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.chat-welcome .qs button:hover { border-color: var(--claude); }
.chat-input { border-top: 1px solid var(--line2); padding: 10px 12px 14px; }
.ctx-toggle { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 6px; } .ctx-toggle input { width: auto; }
.chat-box { display: flex; gap: 6px; align-items: flex-end; }
.chat-box textarea { resize: none; max-height: 160px; }
.attach-prev { display: flex; gap: 6px; flex-wrap: wrap; }
.attach-prev img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; cursor: pointer; margin-bottom: 6px; }

.toast { visibility: hidden; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--txt); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; transition: transform .2s; z-index: 60; }
.toast.show { visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); color: #fff; }

/* ---------- Responsivo */
@media (max-width: 1250px) { .tiles { grid-template-columns: repeat(3, 1fr); } .two { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; } .calc-form { position: static; max-height: none; }
  .mach-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; } .tabs { order: 3; width: 100%; overflow-x: auto; }
}
@media (max-width: 640px) {
  main { padding: 12px; } .tiles { grid-template-columns: 1fr 1fr; } .tile .val { font-size: 22px; }
  .toolbar input[type=search], .toolbar select { width: 100%; }
  .dlg-body { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr 1fr; }
  .rec-list { grid-template-columns: 1fr; }
}
.grow { flex: 1; min-width: 0; }

/* ================= v2 ================= */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.entrada-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.brand.grande .logo { width: 40px; height: 40px; }
.brand.grande strong { font-size: 19px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.erro { color: var(--bad); font-size: 13px; min-height: 1em; }
.push { margin-left: auto; }
.row.between { justify-content: space-between; align-items: center; }
.icon-btn.conta { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; border-radius: 50%; width: 32px; height: 32px; }
.icon-btn.conta:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.1); }
.topbar { gap: 14px; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.grid3 .full, .grid2 .full { grid-column: 1 / -1; }
.calc-form .grid3 { grid-template-columns: repeat(3, 1fr); }
.step-h .check { font-weight: 600; font-size: 12px; }
.bit-sel { display: flex; gap: 10px; align-items: center; }
.bit-sel .mini { width: 24px; height: 42px; flex: none; }
.bit-sel .mini svg { width: 100%; height: 100%; }
.tiles-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile.small .val { font-size: 22px; }
.tile.tempo::before { background: var(--info); }
.tile.small .sub { line-height: 1.35; }
.card.rot h3 a { text-transform: none; letter-spacing: 0; font-weight: 600; }
.kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kvs div { background: var(--bg2); border-radius: 8px; padding: 10px 12px; }
.kvs span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.kvs b { font-family: var(--mono); font-size: 20px; }
.compat { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 12px 16px; border: 1px solid; font-size: 14px; }
.compat .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.compat.ok { background: color-mix(in srgb, var(--ok) 10%, var(--card)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); } .compat.ok .ic { background: var(--ok); }
.compat.warn { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); } .compat.warn .ic { background: var(--warn); }
.compat.bad { background: color-mix(in srgb, var(--bad) 12%, var(--card)); border-color: color-mix(in srgb, var(--bad) 50%, transparent); } .compat.bad .ic { background: var(--bad); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.rotbox { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.legenda { margin: -6px 0 10px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.lg::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.tbl-wrap { overflow-x: auto; }
.tabs-line { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabl { border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-weight: 600; padding: 7px 12px; border-radius: 99px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabl.on { color: var(--txt); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tabl.sucesso .count { background: color-mix(in srgb, var(--ok) 25%, transparent); } .tabl.falhado .count { background: color-mix(in srgb, var(--bad) 25%, transparent); } .tabl.outro .count { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.rec { border-left: 4px solid var(--line); }
.rec.ok { border-left-color: var(--ok); } .rec.bad { border-left-color: var(--bad); } .rec.warn { border-left-color: var(--warn); }
.rec .seg.estado { flex-wrap: wrap; }
.rec .seg.estado button.on.ok { color: var(--ok); } .rec .seg.estado button.on.bad { color: var(--bad); } .rec .seg.estado button.on.warn { color: var(--warn); }
.badge.tipo { background: var(--bg2); color: var(--muted); }
.item { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.item b { display: block; }
.span2 { grid-column: 1 / -1; }
.guias { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.guia-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 76px; }
.guia-nav a { color: var(--txt); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.guia-nav a:hover { background: var(--bg2); } .guia-nav a.on { background: var(--accent); color: var(--accent-ink); }
.guia { max-width: 900px; }
.guia h2 { margin-bottom: 10px; }
.guia .lead { font-size: 15px; }
.guia code, .calc101 code { font-family: var(--mono); background: var(--bg2); padding: 1px 6px; border-radius: 4px; }
.passo { display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin: 16px 0; }
.passo .n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.passo h4 { margin: 4px 0 6px; font-size: 15px; }
.passo p, .passo ul { margin: 0 0 8px; }
.specs-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 12px 0; }
.specs-box div { background: var(--bg2); border-radius: 8px; padding: 8px 10px; }
.specs-box span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.calc101 { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; margin: 10px 0; background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.res101 { font-family: var(--mono); font-size: 18px; margin-top: 8px; } .res101 b { font-size: 26px; color: var(--accent); }
.guia .tbl td { vertical-align: top; }
details summary { cursor: pointer; font-weight: 600; }
.alert { margin: 8px 0; }
@media (max-width: 980px) { .guias { grid-template-columns: 1fr; } .guia-nav { position: static; } .calc-form .grid3 { grid-template-columns: 1fr 1fr; } }

/* ================= cncdoze ================= */
.brand .simbolo { width: 34px; height: 34px; border-radius: 9px; }
.brand strong em { font-style: normal; color: var(--accent); font-weight: 600; }
.brand.grande { flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brand.grande img { width: min(300px, 80%); height: auto; }
.brand.grande span { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.logo-escuro { display: none; } [data-theme="dark"] .logo-claro { display: none; } [data-theme="dark"] .logo-escuro { display: block; }
.convite-link { display: flex; gap: 6px; } .convite-link input { font-family: var(--mono); font-size: 12px; }
.conv-ok { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--card)); margin-top: 10px; }

/* ===== v2.1 — Fresas: encavadouros, seleção múltipla, menu do botão direito, Aspire ===== */
.toolbar.sub { margin-top: -6px; }
.toolbar.sub .chips { align-items: center; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.dica-dir { margin-left: 12px; opacity: .8; }
.cat-h .dot.haste { background: var(--txt); border-radius: 3px; }
.cat-h .tabua-uso { width: 120px; height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-left: 8px; }
.cat-h .tabua-uso span { display: block; height: 100%; background: var(--accent); }
.sub-h { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px 4px; font-size: 13px; font-weight: 600; }
.sub-h .dot { width: 8px; height: 8px; border-radius: 50%; }
/* Barra de seleção */
.sel-bar { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; }
.btn.danger:not(.ghost) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Caixas de seleção nos cartões e na lista */
.bit .ck { position: absolute; bottom: 8px; left: 8px; width: 24px; height: 24px; border-radius: 6px; background: var(--card); border: 1px solid var(--line);
  display: none; place-items: center; cursor: pointer; }
.bit .ck input, .tbl .ck input { pointer-events: none; margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.tbl th.ck input { pointer-events: auto; }
.bit:hover .ck, .a-selecionar .bit .ck, .bit.sel .ck { display: grid; }
.bit.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tbl tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tbl td.ck, .tbl th.ck { width: 28px; }
.tbl tr.grupo td { background: var(--bg2); font-weight: 700; font-size: 13px; }
.tbl tr.grupo td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--txt); }
.tbl tr.grupo .tabua-uso { display: none; }
.bit .mais { position: absolute; bottom: 6px; right: 6px; background: var(--card); border: 1px solid var(--line); width: 28px; height: 28px; opacity: 0; }
.bit:hover .mais { opacity: 1; }
@media (hover: none) { .bit .mais { opacity: 1; } .bit .ck { display: grid; } .dica-dir { display: none; } }
/* Menu do botão direito */
.menu-list.ctx { position: fixed; right: auto; top: 0; z-index: 1000; min-width: 230px; }
.menu-list.ctx a { display: block; }
.menu-list.ctx a.perigo { color: var(--bad); }
.menu-list.ctx hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 0; }
.ctx-h { padding: 4px 10px 6px; }
/* Duplicar */
.dup-prev { margin-top: 12px; }
.dup-prev p { margin: 6px 0; }
.dup-range { font-size: 18px; display: flex; gap: 10px; align-items: center; }
.dup-range .code-badge { font-size: 15px; padding: 4px 10px; }
/* Ficha: nome automático e dados para o Aspire */
.nome-row { flex-wrap: nowrap; align-items: center; }
.nome-row input[name=nome] { flex: 1; }
.nome-row label.check { white-space: nowrap; }
input[readonly] { background: var(--bg2); color: var(--muted); }
.aspire-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 4px 0; }
.aspire-box legend { font-weight: 700; padding: 0 6px; font-size: 13px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
@media (max-width: 720px) { .grid5 { grid-template-columns: 1fr 1fr; } .sel-bar { top: 0; } }
/* Exportar Aspire e tábua */
.chips-ck { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0; }
.tabua-linha { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 6px; }

/* ===== v2.2 — Nome automático configurável e campos da ficha ===== */
.nf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 10px; }
@media (max-width: 860px) { .nf-grid { grid-template-columns: 1fr; } }
.nf-opcoes { gap: 16px; align-items: flex-end; }
.nf-opcoes label { min-width: 180px; }
.nf-lista { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nf-campo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.nf-campo.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.nf-off .nf-campo { opacity: .85; }
.nf-ordem { display: flex; gap: 2px; }
.icon-btn.sm { width: 26px; height: 26px; font-size: 13px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.nf-demo { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg2); min-height: 80px; }
.nf-ex { display: flex; flex-direction: column; gap: 2px; }
.nf-ex .code-badge { align-self: flex-start; }
.nf-ex b { font-size: 15px; word-break: break-word; }
.nf-aplicar { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.nf-aplicar label.sub { margin-left: 26px; font-size: 13px; }
.nf-base { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 6px; }
.nf-base label.fixo { color: var(--muted); }
.nf-extra { display: grid; grid-template-columns: 2fr 1fr 1.6fr auto; gap: 6px; margin-top: 6px; align-items: center; }
.nf-extra input[hidden] { display: none; }
.mt2 { margin-top: 26px; }
#bf label.desativado { display: none !important; }
.nf-lista.nf-off { display: grid; grid-template-columns: 1fr 1fr; }
.nf-lista .nf-campo { padding: 4px 10px; }
#nfNome .lbl.mt { margin-top: 14px; }
