/* Vivado-style workspace layer: dense, flat, panel-based. Loaded after style.css. */
[hidden] { display: none !important; }
body { font-size: 12.5px; }
button, input, select { border-radius: 3px; }

/* title / quick access */
.titlebar { height: 50px; }
.logo img { height: 44px; }
.menus button { padding: 4px 9px; border-radius: 3px; font-size: 13px; }
.quick { position: relative; margin-right: 8px; }
.quick input { width: 200px; padding: 4px 10px 4px 26px; border-radius: 4px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a869c' stroke-width='2.4'%3E%3Ccircle cx='10' cy='10' r='6'/%3E%3Cpath d='M15 15l6 6'/%3E%3C/svg%3E") 7px center / 14px no-repeat; }
#quick-pop { position: absolute; right: 0; top: 30px; width: 320px; z-index: 80; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.3); padding: 3px; }
#quick-pop button { display: flex; justify-content: space-between; width: 100%; padding: 6px 9px; text-align: left; border-radius: 3px; color: var(--fg); }
#quick-pop button small { color: var(--muted); } #quick-pop button:hover { background: var(--hover); }

/* toolbar */
.toolbar { height: 38px; padding: 0 8px; gap: 2px; background: var(--panel2); }
.tbtn { width: 30px; height: 28px; display: grid; place-items: center; color: var(--fg); }
.tbtn svg { width: 18px; height: 18px; } .tbtn:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.tool.run { height: 26px; margin: 0 6px; }
.tinfo { color: var(--muted); font-size: 11px; }
.sep { background: var(--border); }

/* layout */
.workspace { grid-template-columns: 208px 282px 1fr; background: var(--border); gap: 1px; }
.workspace > * { background: var(--panel); min-width: 0; min-height: 0; }
.panel-title { height: 24px; padding: 0 8px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg); background: linear-gradient(var(--panel), var(--panel2)); border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .panel-title { color: var(--fg); }
.ptools { display: flex; gap: 2px; }

/* flow navigator */
.navigator { overflow: auto; border: 0; }
.fn-sec { border-bottom: 1px solid var(--border); }
.fn-h { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--navy); background: var(--panel); cursor: pointer; }
:root[data-theme="dark"] .fn-h { color: var(--fg); }
.fn-h::before { content: "▾"; color: var(--muted); font-size: 10px; width: 10px; }
.fn-sec.shut .fn-h::before { content: "▸"; } .fn-sec.shut .nav-item { display: none; }
.fn-h:hover { background: var(--hover); }
.nav-item { padding: 4px 8px 4px 24px; font-size: 12.5px; color: var(--accent); }
.nav-item.strong { font-weight: 600; } .nav-item.sub { padding-left: 38px; }
.nav-item:disabled { color: var(--muted); }

/* left column: sources + properties */
.leftcol { display: flex; flex-direction: column; border: 0; }
.leftcol .sources { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; border: 0; overflow: hidden; }
.leftcol .props { flex: 0 0 auto; max-height: 45%; border-top: 1px solid var(--border); overflow: auto; background: var(--panel); }
.subtabs { display: flex; border-bottom: 1px solid var(--border); background: var(--panel2); }
.subtabs button { padding: 4px 10px; font-size: 12px; color: var(--muted); }
.subtabs button.active { color: var(--fg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--mint); background: var(--panel); }
#src-body { flex: 1; overflow: auto; padding: 2px 0; }
.srow { display: flex; align-items: center; gap: 5px; min-height: 22px; padding-right: 8px; cursor: pointer; white-space: nowrap; }
.srow:hover { background: var(--hover); } .srow.sel { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.srow .tw { width: 10px; color: var(--muted); font-size: 10px; }
.fico { width: 13px; height: 10px; border-radius: 2px; background: #E0B84C; flex: none; position: relative; }
.fico.file { width: 10px; height: 12px; background: var(--muted); border-radius: 1px; }
.mico { width: 12px; height: 12px; border-radius: 2px; flex: none; background: var(--brand); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.mn { font-weight: 500; } .inst, .fn, .cnt, .dim { color: var(--muted); } .folder b { font-weight: 600; }
.topbadge { margin-left: 6px; font-size: 9px; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--mint); color: #04302a; text-transform: uppercase; }
.pad { padding: 8px 10px; }
.ptbl { width: 100%; border-collapse: collapse; } .ptbl td { padding: 3px 8px; vertical-align: top; } .ptbl td:first-child { color: var(--muted); width: 74px; white-space: nowrap; }
.ptbl select { padding: 1px 4px; font-size: 12px; } .ptbl label { display: block; } .mono { font-family: "JetBrains Mono", monospace; font-size: 11px; word-break: break-all; }
.orow2 { display: grid; grid-template-columns: 22px 1fr 62px 44px; gap: 6px; align-items: center; padding: 3px 8px; cursor: pointer; border-bottom: 1px solid var(--grid); }
.orow2.head { background: var(--panel2); font-weight: 600; font-size: 11px; color: var(--muted); cursor: default; } .orow2:not(.head):hover { background: var(--hover); } .orow2.sel { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.orow2 .nm { overflow: hidden; text-overflow: ellipsis; } .orow2.off .nm { text-decoration: line-through; opacity: .6; }
.orow2 .mv button { width: 18px; height: 18px; font-size: 11px; color: var(--muted); } .orow2 .mv button:hover { background: var(--panel2); color: var(--fg); }

/* documents */
.center { background: var(--border); gap: 0; }
.doc-area { flex: 1 1 66%; display: flex; flex-direction: column; position: relative; min-height: 100px; background: var(--panel); }
#docs { flex: 1; position: relative; min-height: 0; }
#editor { position: absolute; inset: 0; }
#tabs { background: var(--panel2); }
#tabs button { padding: 5px 12px; font-size: 12px; }
#tabs button.active { box-shadow: inset 0 2px 0 var(--mint); }
#tabs button.off { opacity: .55; text-decoration: line-through; }
#tabs .wtab .x { margin-left: 8px; padding: 0 3px; border-radius: 3px; color: var(--muted); } #tabs .wtab .x:hover { background: var(--hover); color: var(--bad); }
#tab-wave { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); }
.wave-tools { padding: 3px 6px; }
.hint.foot { font-family: "JetBrains Mono", monospace; font-size: 11px; }

/* bottom dock */
.splitter { height: 4px; background: var(--border); }
.dock { flex: 1 1 34%; min-height: 90px; display: flex; flex-direction: column; background: var(--panel); }
.dock-tabs { background: var(--panel2); }
.dock-tabs button { padding: 4px 12px; font-size: 12px; }
.dock-body { flex: 1; min-height: 0; overflow: auto; }
#tab-tcl { display: flex; flex-direction: column; overflow: hidden; }
#console { flex: 1; margin: 0; padding: 6px 10px; overflow: auto; background: var(--editor); font: 12px/1.45 "JetBrains Mono", Consolas, monospace; white-space: pre-wrap; }
#console .cmd { color: var(--accent); font-weight: 500; } #console .err { color: var(--bad); }
.tclin { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); background: var(--panel2); padding: 3px 8px; }
.tclin span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tclin input { flex: 1; border: 0; background: var(--editor); font: 12px "JetBrains Mono", monospace; padding: 4px 6px; }
#logpre { margin: 0; padding: 6px 10px; background: var(--editor); font: 12px/1.45 "JetBrains Mono", Consolas, monospace; white-space: pre-wrap; }
#msgs, #runs { height: 100%; overflow: auto; }
.msg { padding: 3px 10px; }
.rtbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.rtbl th { position: sticky; top: 0; text-align: left; padding: 4px 10px; background: var(--panel2); border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.rtbl td { padding: 4px 10px; border-bottom: 1px solid var(--grid); } .rtbl tr.good td:nth-child(3) { color: var(--teal); font-weight: 600; } .rtbl tr.bad td:nth-child(3) { color: var(--bad); font-weight: 600; }

/* context menu */
#ctx { position: fixed; z-index: 90; min-width: 210px; padding: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
#ctx button { display: block; width: 100%; padding: 5px 10px; text-align: left; border-radius: 3px; color: var(--fg); } #ctx button:hover { background: var(--accent); color: #fff; }
#ctx hr { border: 0; border-top: 1px solid var(--border); margin: 3px 2px; }

/* dialogs: templates + settings */
dialog.tpl { width: 820px; max-width: 94vw; } dialog.settings { width: 720px; max-width: 94vw; }
.tpl-wrap { display: grid; grid-template-columns: 250px 1fr; height: 440px; }
.tpl-tree { overflow: auto; border-right: 1px solid var(--border); background: var(--panel2); padding: 6px 0; }
.tpl-cat { padding: 6px 12px 2px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tpl-item { padding: 4px 12px 4px 22px; cursor: pointer; } .tpl-item:hover { background: var(--hover); } .tpl-item.sel { background: var(--accent); color: #fff; }
.tpl-prev { padding: 16px 20px; overflow: auto; } .tpl-prev h3 { margin: 0 0 4px; }
.tpl-code { background: var(--editor); border: 1px solid var(--border); border-radius: 4px; padding: 12px; font: 12px/1.5 "JetBrains Mono", monospace; min-height: 200px; white-space: pre; overflow: auto; }
.set-wrap { display: flex; height: 400px; }
.set-nav { list-style: none; margin: 0; padding: 8px 0; width: 170px; background: var(--panel2); border-right: 1px solid var(--border); }
.set-nav li { padding: 7px 16px; cursor: pointer; } .set-nav li:hover { background: var(--hover); } .set-nav li.cur { background: var(--accent); color: #fff; } .set-nav li.dim { color: var(--muted); } .set-nav li.cur.dim { color: #fff; }
.set-body { flex: 1; padding: 18px 24px; overflow: auto; } .set-body h3 { margin: 0 0 8px; }

@media (max-width: 1000px) { .workspace { grid-template-columns: 250px 1fr; } .navigator { display: none; } .quick input { width: 120px; } }
@media (max-width: 700px) { .workspace { grid-template-columns: 1fr; overflow: auto; } .leftcol { max-height: 240px; } .center { min-height: 560px; } .quick { display: none; } }
.leftcol .props { max-height: 36%; } .leftcol .sources { min-height: 180px; }

/* synthesis: schematic + reports */
#tab-schem { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); }
.stitle { font-weight: 600; padding: 0 6px; } .szoom { color: var(--muted); font: 11px "JetBrains Mono", monospace; min-width: 38px; text-align: right; }
#schem-view { flex: 1; position: relative; overflow: hidden; background: #fff; cursor: grab; touch-action: none; }
#schem-view.grab { cursor: grabbing; }
#schem-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#schem-stage svg { display: block; max-width: none; }
:root[data-theme="dark"] #schem-view { background: #14151a; }
:root[data-theme="dark"] #schem-stage svg { filter: invert(.9) hue-rotate(180deg); }
#reports { height: 100%; overflow: auto; } #reports .empty { padding: 14px; }
.rep { padding: 10px 14px 14px; }
.rep-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; } .rep-head span { color: var(--muted); } .rep-head button { padding: 3px 10px; border: 1px solid var(--border); border-radius: 4px; }
.rep-head button:hover { background: var(--hover); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; background: var(--panel2); } .tile span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; } .tile b { font-size: 22px; font-weight: 600; }
.rep-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; } @media (max-width: 900px) { .rep-cols { grid-template-columns: 1fr; } }
.rtbl .mono { font-family: "JetBrains Mono", monospace; font-size: 11.5px; } .bar { height: 8px; background: var(--grid); border-radius: 4px; min-width: 60px; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.rep-note { margin: 12px 0 0; font-size: 11.5px; }

/* PDK manager + part info */
.pinfo { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel2); font-size: 12px; line-height: 1.5; }
.tile b.sm { font-size: 15px; line-height: 1.7; } .seqtag { font-style: normal; font-size: 9px; padding: 0 5px; border-radius: 8px; background: var(--panel2); color: var(--muted); }
dialog.pdkm { width: 920px; max-width: 95vw; } .pdk-wrap { display: grid; grid-template-columns: 270px 1fr; height: 520px; }
.pdk-list { overflow: auto; background: var(--panel2); border-right: 1px solid var(--border); padding: 6px 0; }
.pdk-item { padding: 9px 14px; cursor: pointer; border-left: 3px solid transparent; } .pdk-item:hover { background: var(--hover); } .pdk-item.sel { background: var(--panel); border-left-color: var(--accent); }
.pdk-item b { display: block; } .pdk-item small { color: var(--muted); }
.chip { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 9px; background: var(--panel2); color: var(--muted); margin-right: 4px; border: 1px solid var(--border); }
.chip.foundry { color: var(--teal); } .chip.academic { color: var(--muted); } .chip.ok { color: var(--teal); border-color: currentColor; } .chip.no { color: var(--bad); border-color: currentColor; } .chip.ref { color: var(--muted); }
.pdk-detail { padding: 18px 24px; overflow: auto; } .pdk-detail h3 { margin: 0 0 4px; } .pdk-detail p { line-height: 1.5; }
.pdk-detail a { color: var(--accent); } .pdk-meta { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 12px 0; } .pdk-meta span:nth-child(odd) { color: var(--muted); }
.pdk-detail .rtbl td button { padding: 2px 10px; border: 1px solid var(--border); border-radius: 4px; } .pdk-detail .rtbl td button:hover:not(:disabled) { background: var(--accent); color: #fff; } .pdk-detail .rtbl td button:disabled { opacity: .45; cursor: not-allowed; }

/* long device / PDK names must not break the toolbar or status bar */
.tool.run { white-space: nowrap; flex: none; }
.tinfo, #partinfo { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statusbar > span { white-space: nowrap; } #status { overflow: hidden; text-overflow: ellipsis; }

/* ---- two design flows + timing ---- */
body[data-flow="fpga"] [data-flow="asic"], body[data-flow="asic"] [data-flow="fpga"] { display: none !important; }
.flowtag { margin-right: 10px; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--panel); border: 1px solid var(--border); color: var(--accent); white-space: nowrap; }
.flowhead { margin: 14px 0 6px; font-weight: 600; }
.flowcards { display: grid; gap: 10px; } .flowcard { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; position: relative; }
.flowcard input { position: absolute; opacity: 0; } .flowcard b { display: block; font-size: 14px; } .flowcard em { display: block; font-style: normal; color: var(--accent); font-size: 12px; margin: 2px 0 6px; }
.flowcard em i, .flowcard em u { font-style: normal; } .flowcard em i { color: var(--muted); } .flowcard em u { text-decoration: none; font-weight: 600; }
.flowcard span { color: var(--muted); font-size: 12px; line-height: 1.5; } .flowcard.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.banner { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; border: 1px solid; font-size: 12.5px; } .banner.ok { border-color: var(--teal); color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, transparent); } .banner.bad { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.banner code { color: var(--fg); }
.tile.neg b { color: var(--bad); } .tile.pos b { color: var(--teal); } td.neg { color: var(--bad); font-weight: 600; } td.pos { color: var(--teal); }
.subtabs.tt { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px 6px 0 0; } h4.sub { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pathhead { display: grid; gap: 2px; margin-bottom: 8px; font-size: 12px; } .pathhead code { font-family: "JetBrains Mono", monospace; } .pathsel { margin-bottom: 8px; } .pathsel select { max-width: 100%; }
tr.cap td { color: var(--muted); } tr.sumrow td { font-weight: 600; background: var(--panel2); } tr.sumrow.ok td:last-child, tr.sumrow.ok td:first-child { color: var(--teal); } tr.sumrow.bad td { color: var(--bad); }
.rawrpt, .warnbox { background: var(--editor); border: 1px solid var(--border); border-radius: 4px; padding: 10px; font: 11.5px/1.45 "JetBrains Mono", monospace; overflow: auto; max-height: 340px; white-space: pre; } .warnbox { max-height: 120px; color: var(--muted); }
#timing { height: 100%; overflow: auto; }

/* implementation */
#impl { height: 100%; overflow: auto; } .rep-head button.primary { padding: 3px 12px; color: #fff; }

.inrow { display: flex; gap: 6px; margin-top: 6px; } .inrow input { flex: 1; } .inrow button { padding: 0 14px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel2); }

/* physical design */
#phys { height: 100%; overflow: auto; }
.pdsteps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; margin: 10px 0; } .pdstep { display: flex; gap: 8px; font-size: 12px; color: var(--muted); } .pdstep.running { color: var(--accent); font-weight: 600; } .pdstep.done { color: var(--fg); } .pdstep.done span { color: var(--teal); } .pdstep.failed { color: var(--bad); }
#tab-layout { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); }
#layout-view { flex: 1; position: relative; overflow: hidden; background: #0b0d12; cursor: grab; touch-action: none; } #layout-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; } #layout-stage img { image-rendering: auto; max-width: none; }

/* ---- professional start page ---- */
:root[data-theme="dark"] .logo img, :root[data-theme="dark"] .hero-logo { background: none; padding: 0; border-radius: 0; box-shadow: none; }
.hero { margin: 0 0 26px; } .hero-logo { height: 120px; }
.hero p.tagline { max-width: 660px; margin: 8px auto 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chips span { padding: 4px 12px; border: 1px solid var(--border); border-radius: 14px; font-size: 12px; color: var(--muted); background: var(--panel); }
.flowc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.flowc { display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.flowc:hover { border-color: var(--accent); transform: translateY(-2px); }
.flowc-ic { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.flowc h3 { margin: 8px 0 0; font-size: 19px; font-weight: 600; }
.fl-dev { margin: 0; color: var(--accent); font-weight: 600; font-size: 12.5px; }
.fl-steps { margin: 6px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; } .fl-note { display: block; font-size: 11.5px; opacity: .85; margin-top: 2px; }
.flowc button { align-self: flex-start; padding: 9px 20px; border-radius: 6px; font-weight: 600; margin-top: auto; }
@media (max-width: 800px) { .flowc-grid { grid-template-columns: 1fr; } .hero-logo { height: 90px; } }

/* ---- account / cloud save ---- */
.cloud { position: relative; margin-right: 8px; }
.cloudbtn { height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; }
.cloudbtn:hover { border-color: var(--accent); } .cloudbtn.in { padding: 0 3px; border-radius: 50%; width: 28px; justify-content: center; }
.cav { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; } .cav img { width: 100%; height: 100%; }
#cloud-pop { position: fixed; right: 8px; top: 48px; max-width: calc(100vw - 16px); z-index: 60; width: 270px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; }
#cloud-pop p { margin: 6px 0 12px; color: var(--muted); line-height: 1.5; } #cloud-pop small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
#cloud-pop .cm-name { font-weight: 600; font-size: 14px; } #cloud-pop .cm-mail { color: var(--muted); } #cloud-pop button { margin-right: 6px; }
