/* ============================================================
   Mac Usta · Top bar + left dock + stage + view container + grid
   Loaded by index.html via <link>.  See styles/_index.css for order.
   ============================================================ */

   4. TOP BAR
   ============================================================ */
.bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: minmax(240px, auto) 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 0 28px;
  background: rgba(239, 232, 218, .82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--ink);
  z-index: 50;
}
.bar::after {
  content: "";
  position: absolute; left: 28px; right: 28px; bottom: -4px;
  height: 1px; background: var(--ink); opacity: .12;
}

.bar-brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.bar-mark { width: 64px; height: 22px; color: var(--ink); }
.bar-word {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
}
.bar-word em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.bar-word span {
  font-style: normal;
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  margin-left: 4px;
  color: var(--rust);
}
.bar-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-mute);
  padding-left: 12px;
  border-left: 1px solid rgba(14,27,48,.2);
  margin-left: 4px;
}

.bar-status {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 3px rgba(183,62,46,.18);
  animation: pulse 2.2s ease-in-out infinite;
}
.dot.connected {
  background: var(--moss);
  box-shadow: 0 0 0 3px rgba(74,103,65,.22);
  animation: pulse 2.2s ease-in-out infinite;
}
.dot.scanning {
  background: var(--brass, #d4a23c);
  box-shadow: 0 0 0 3px rgba(212, 162, 60, .22);
  animation: scan 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(.78); }
}
@keyframes scan {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.55); opacity: .55; }
}

/* "İzin ver" butonu — kompakt */
.btn.small {
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .12em;
}
.dot-label { color: var(--ink); font-weight: 500; }
.bar-divider { color: rgba(14,27,48,.2); font-size: 10px; }
.last-action em { font-style: normal; color: var(--ink); }

.bar-actions { display: flex; gap: 10px; }

/* ============================================================
   6. TOPNAV (horizontal — eski sol dock'un yatay sürümü)
   ============================================================ */
.topnav {
  position: sticky;
  top: var(--bar-h);
  margin-top: var(--bar-h);
  height: var(--topnav-h);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 18px;
  border-top: 1px solid rgba(14,27,48,.10);
  border-bottom: 1px solid var(--ink);
  background: linear-gradient(180deg, rgba(246,241,229,.96), rgba(229,220,201,.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 6px -2px rgba(14,27,48,.16);
  z-index: 40;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.topnav::-webkit-scrollbar { height: 4px; }

.topnav-foot {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 0 4px 0 18px;
  border-left: 1px dashed rgba(14,27,48,.2);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border: 0;
  border-right: 1px dashed rgba(14,27,48,.14);
  color: var(--ink-soft);
  position: relative;
  white-space: nowrap;
  transition: all var(--t-fast);
  cursor: pointer;
  background: transparent;
  min-height: 100%;
}
.nav-item:first-child { border-left: 1px dashed rgba(14,27,48,.14); }
.nav-no {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-mute);
}
.nav-ico {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  color: var(--rust);
  filter: drop-shadow(0 0 6px rgba(183,62,46,.18));
}
.nav-label {
  font-family: var(--f-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .005em;
}
.nav-item:hover {
  color: var(--ink);
  background: rgba(14,27,48,.05);
}
.nav-item:hover .nav-no { color: var(--rust); }
.nav-item.active {
  color: var(--paper-0);
  background: var(--ink);
  box-shadow: inset 0 -3px 0 var(--rust);
}
.nav-item.active .nav-no { color: var(--brass-light); }
.nav-item.active .nav-ico { color: var(--brass-light); filter: none; }
.nav-item.active .nav-label { font-style: italic; font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1; }

.nav-group-label {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rust);
  background: rgba(183,62,46,.06);
  border-right: 1px solid rgba(14,27,48,.18);
  white-space: nowrap;
}
.nav-group-sep {
  display: inline-block;
  width: 1px;
  background: linear-gradient(180deg, transparent 14%, rgba(14,27,48,.22) 14%, rgba(14,27,48,.22) 86%, transparent 86%);
  margin: 0 4px;
}

/* ============================================================
   7. STAGE (main area)
   ============================================================ */
.stage {
  position: relative;
  min-height: 100vh;
  margin-left: 0;
  padding-top: 0;
  display: flex; flex-direction: column;
}

.stage-rule {
  display: flex; align-items: center; gap: 14px;
  height: var(--rule-h);
  padding: 0 32px;
  border-bottom: 1px solid var(--ink);
  background: rgba(239,232,218,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: calc(var(--bar-h) + var(--topnav-h));
  z-index: 30;
}
.stage-rule-no {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.stage-rule-dash {
  font-family: var(--f-mono);
  letter-spacing: .15em;
  color: rgba(14,27,48,.3);
}
.stage-rule-title {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1;
  color: var(--ink);
  letter-spacing: -.01em;
}
.stage-rule-spacer { flex: 1; }
.stage-rule-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Landing'de stage rule gizli ve dock transparan */
body[data-page="landing"] .stage-rule { display: none; }
body[data-page="landing"] .bar { background: transparent; backdrop-filter: none; }

/* ---------- VIEW container ---------- */
.view {
  display: none;
  padding: 28px 32px 80px;
}
.view.active {
  display: block;
  animation: viewIn var(--t-mid);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TOAST STACK — sağ alt köşe, install/firmware/info bildirimleri
   ============================================================ */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 40px));
}
.toast {
  pointer-events: auto;
  background: var(--paper-0);
  border: 1px solid var(--ink);
  border-left: 4px solid var(--ink);
  padding: 12px 14px 12px 16px;
  box-shadow: 0 16px 32px -16px rgba(14, 27, 48, .45);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  animation: toastIn 280ms cubic-bezier(.22, .6, .2, 1);
}
.toast.toast-out {
  animation: toastOut 220ms ease-in forwards;
}
.toast-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.2;
  font-variation-settings: "opsz" 36, "SOFT" 100, "WONK" 1, "wght" 500;
}
.toast-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rust);
  align-self: start;
}
.toast-msg {
  grid-column: 1 / -1;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 4px;
  word-break: break-word;
}
.toast-close {
  grid-row: 1;
  grid-column: 2;
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0 0 0 8px;
  align-self: start;
}
.toast-close:hover { color: var(--ink); }
.toast-bar {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--paper-2);
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}
.toast-bar i {
  display: block;
  height: 100%;
  background: var(--rust);
  transition: width 200ms ease-out;
}

.toast-info  { border-left-color: var(--ink); }
.toast-info  .toast-tag { color: var(--ink-soft); }
.toast-info  .toast-bar i { background: var(--ink-soft); }

.toast-ok    { border-left-color: var(--moss); }
.toast-ok    .toast-tag { color: var(--moss); }
.toast-ok    .toast-bar i { background: var(--moss); }

.toast-err   { border-left-color: var(--rust); }
.toast-err   .toast-tag { color: var(--rust); }
.toast-err   .toast-bar i { background: var(--rust); }

.toast-work  { border-left-color: var(--brass); }
.toast-work  .toast-tag { color: var(--brass); }
.toast-work  .toast-bar i { background: var(--brass); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(20px); }
}

/* ============================================================
   INSTALL PILL — bar-actions içinde install in-progress göstergesi
   ============================================================ */
.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  background: var(--paper-0);
  border: 1px solid var(--rust);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-fast);
}
.install-pill:hover {
  background: var(--rust);
  color: var(--paper-0);
}
.install-pill[hidden] { display: none; }
.install-pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 3px rgba(183, 62, 46, .2);
  animation: pulse 1.2s ease-in-out infinite;
}
.install-pill:hover .install-pill-dot {
  background: var(--paper-0);
  box-shadow: 0 0 0 3px rgba(246, 241, 229, .35);
}
.install-pill-label {
  font-weight: 500;
}
.install-pill-pct {
  font-style: normal;
  color: var(--rust);
  font-weight: 600;
}
.install-pill:hover .install-pill-pct { color: var(--paper-0); }
.install-pill.is-done {
  border-color: var(--moss);
}
.install-pill.is-done .install-pill-dot {
  background: var(--moss);
  box-shadow: 0 0 0 3px rgba(74, 103, 65, .22);
  animation: none;
}
.install-pill.is-done .install-pill-pct { color: var(--moss); }
