.brand-main { display: flex; flex-direction: column; gap: 4px; }
.logo {
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
  pointer-events: none;
}
.logo-stripes {
  position: relative;
  width: 34px;
  height: 38px;
  display: block;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25em;
  rotate: 90deg;
}
.logo-stripes span {
  /*position: absolute;
  left: 50%;*/
  width: 7px;
  height: 14px;
  border-radius: 999px;
  transform-origin: center;
}

.logo-stripes.left span:nth-child(1) { background: #E60012; }
.logo-stripes.left span:nth-child(2) { background: #85C419; }
.logo-stripes.left span:nth-child(3) { background: #19A8E0; }
.logo-stripes.right span:nth-child(1) { background: #00A859; }
.logo-stripes.right span:nth-child(2) { background: #FFD200; }
.logo-stripes.right span:nth-child(3) { background: #EC008C; }

.logo-stripes.right span:nth-child(1), .logo-stripes.left span:nth-child(3) { rotate: -15deg; }
.logo-stripes.right span:nth-child(3), .logo-stripes.left span:nth-child(1) { rotate: 15deg; }
.logo-word {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .2px;
  color: #f8fbff;
  line-height: 1;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Nunito", var(--sans);
}
h1 { margin: 0; font-size: 1.6rem; line-height: 1.1; }
@media (max-width: 900px) {
  .logo { padding: 4px 0; gap: 8px; flex-wrap: wrap; }
  .logo-word { font-size: 1.7rem; }
  .logo-stripes { width: 28px; height: 32px; }
  .logo-stripes span { width: 6px; height: 12px; }
  .subtitle { font-size: .9rem; line-height: 1.35; }
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.badge { padding: 6px 10px; border-radius: 999px; font-size: .85rem; border: 1px solid var(--border); }
.badge-muted { color: var(--muted); }
.badge-ok { color: #052e16; background: #86efac; border-color: #86efac; }
.badge-bad { color: #450a0a; background: #fca5a5; border-color: #fca5a5; }

.panel { background: rgba(30,41,59,.9); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }

.status { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.status-info { background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.35); }
.status-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.status-warn { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.status-error { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(229,238,252,.25); border-top-color: var(--info); border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 auto; }
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.device-panel h2, .transfers-panel h2 { margin: 0 0 12px; font-size: 1.1rem; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(148,163,184,.25); font-size: .95rem; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; word-break: break-all; }
.drive-box { margin-top: 14px; padding: 12px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--border); }
.drive-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .9rem; color: var(--muted); }
.drive-head strong { color: var(--text); }
.progress { height: 10px; background: #0b1220; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #22c55e); width: 0%; transition: width .2s ease; }
.progress-sm { height: 7px; }
.drive-meta { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.actions-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.help { margin-top: 14px; color: var(--muted); font-size: .9rem; }
.help summary { cursor: pointer; color: var(--text); margin-bottom: 6px; }
.help ul { margin: 6px 0 0 18px; padding: 0; }
.help li { margin: 4px 0; }
.help a { color: var(--info); text-decoration: none; }
.help a:hover { text-decoration: underline; }
.support-footer-btn:hover { transform: translateY(-1px); }
.ai-disclaimer { width: 100%; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border); background: rgba(17, 24, 39, 0.45); }
.ai-disclaimer p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; text-align: center; }

.btn {
  appearance: none; border: 1px solid var(--border); background: #162033; color: var(--text);
  padding: 6px 10px; border-radius: 10px; font: inherit; font-size: .9rem; line-height: 1.2; cursor: pointer; transition: .15s ease;
  min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box;
}
.btn:hover:not(:disabled) { background: #1b2940; border-color: #415675; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #081225; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: .9rem; border-radius: 8px; min-height: 34px; }
#dfuBtn { grid-column: 1 / -1; }
.lang-select { padding: 6px 8px; min-width: 58px; min-height: 34px; background: #162033; color: var(--text); text-align: center; }
.file-label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.file-label:has(input:disabled) { opacity: .45; cursor: not-allowed; pointer-events: none; }

.pathbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-family: var(--mono); font-size: .9rem; }
.crumb { color: var(--info); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumb:hover { background: rgba(56,189,248,.12); }
.crumb.sep { color: var(--muted); cursor: default; padding: 0 2px; }
.crumb.sep:hover { background: none; }

.move-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 12px; background: rgba(79,140,255,.12); border: 1px solid rgba(79,140,255,.35); border-radius: 10px; }
.move-bar.hidden { display: none; }
.move-info { font-size: .95rem; color: var(--text); word-break: break-all; }
.move-actions { display: flex; gap: 8px; flex-shrink: 0; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th, .file-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.file-table th { background: #162033; color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
.file-table tr:hover td { background: rgba(255,255,255,.02); }
.col-size { width: 90px; white-space: nowrap; }
.col-type { width: 90px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.file-table td.col-actions { text-align: right; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.icon { min-width: 22px; text-align: center; }
.name-link { color: var(--text); }
.name-link.dir { color: #93c5fd; font-weight: 500; cursor: pointer; }
.name-link.dir:hover { text-decoration: underline; }
.name-link.file { cursor: default; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.muted { color: var(--muted); }
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  &[data-act="download"] {
    padding-right: 4px;
  }
}
.icon-btn:hover:not(:disabled) { color: #fecaca; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.12); }
.icon-btn:disabled { cursor: not-allowed; opacity: .45; }
.name-link.disabled, .crumb.disabled { cursor: not-allowed; opacity: .6; pointer-events: none; }

.app-busy .btn,
.app-busy .file-label,
.app-busy .icon-btn,
.app-busy .name-link.dir,
.app-busy .crumb,
.app-busy #clearTransfersBtn,
.app-busy .move-actions button { cursor: not-allowed !important; }
.app-busy .name-link.dir,
.app-busy .crumb { pointer-events: none; opacity: .65; }

.transfer-list { display: flex; flex-direction: column; gap: 10px; }
.transfer-item { padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.transfer-group { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.transfer-group-header { padding: 12px; background: rgba(79,140,255,.08); border-bottom: 1px solid var(--border); }
.transfer-group.active .transfer-group-header { background: rgba(79,140,255,.12); }
.transfer-files { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 320px; overflow: auto; }
.transfer-file-item { padding: 8px 10px; background: #162033; border: 1px solid var(--border); border-radius: 8px; }
.transfer-top { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; margin-bottom: 6px; }
.transfer-name { font-weight: 500; word-break: break-all; }
.file-name { font-weight: 400; font-size: .9rem; }
.transfer-state { white-space: nowrap; font-size: .85rem; }
.t-ok { color: #86efac; }
.t-err { color: #fca5a5; }
.t-run { color: #7dd3fc; }
.t-warn { color: #fcd34d; }
.transfer-meta { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.log-panel summary, .transfers-panel summary { cursor: pointer; }
.log {
  margin: 10px 0 0; max-height: 220px; overflow: auto; background: #0b1220; color: #cbd5e1;
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); font-family: var(--mono); font-size: .8rem; white-space: pre-wrap;
}


/* Toolbar additions */
.toolbar-actions { gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input {
  background: #0b1220; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: .9rem; min-width: 180px;
}
.search-input:focus { outline: none; border-color: #415675; }
.toggle-inline {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted);
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: rgba(22,32,51,.5);
  cursor: pointer; user-select: none; min-height: 34px; box-sizing: border-box;
}
.toggle-inline input { margin: 0; accent-color: var(--primary); }
.toggle-inline:hover { color: var(--text); border-color: #415675; }

.btn-danger { color: #fecaca; border-color: rgba(239,68,68,.35); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.5); color: #fee2e2; }

/* Drag and drop */
.table-wrap { position: relative; }
.drop-hint {
  position: absolute; inset: 8px; z-index: 5; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 16px; border: 2px dashed rgba(79,140,255,.6); border-radius: 10px;
  background: rgba(15,23,42,.85); color: #dbeafe; font-weight: 600; pointer-events: none;
}
.drop-hint.hidden { display: none; }
#dropZone.drag-over, .browser-panel.drag-over .table-wrap { box-shadow: inset 0 0 0 2px rgba(79,140,255,.35); }

/* Log actions */
.log-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }
.log-summary::-webkit-details-marker { display: none; }
.log-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.log-actions .btn { padding: 4px 8px; }
.project-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  color: var(--muted);
  font-size: .9rem;
}
.project-links a { color: var(--info); text-decoration: none; }
.project-links a:hover { text-decoration: underline; }


.toolbar-actions.hidden { display: none !important; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.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; }
.btn-iconic { min-width: 34px; min-height: 34px; height: 34px; padding: 6px 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.icon-toggle { gap: 6px; padding: 6px 8px; }
.icon-toggle .icon { font-size: .95rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 900px) {
  .subtitle { display: none; }
  .header-actions { gap: 6px; }
  .badge { font-size: .8rem; padding: 5px 8px; }
}


.icon-stack { position: relative; display: inline-block; width: 1.25em; height: 1em; line-height: 1; vertical-align: middle; }
.icon-stack span { position: absolute; font-size: .85em; line-height: 1; }
.icon-stack span:nth-child(1) { left: 0; top: 0.1em; opacity: .85; }
.icon-stack span:nth-child(2) { left: 0.22em; top: -0.02em; opacity: .95; }
.icon-stack span:nth-child(3) { left: 0.44em; top: 0.1em; }


@media (max-width: 600px) {
  .file-table th, .file-table td { padding: 8px 6px; }
  .file-table th { font-size: .78rem; text-transform: none; letter-spacing: 0; }
  .col-size { width: 72px; }
  .col-type { width: 64px; font-size: .85rem; }
  .col-actions { width: 1%; }
  .name-cell { gap: 6px; }
  .toolbar-group { width: auto; flex: 0 1 auto; }
}
@media (max-width: 420px) {
  .file-table { table-layout: fixed; width: 100%; }
  .file-table th, .file-table td { padding: 7px 4px; }
  .file-table th { font-size: .72rem; }
  .file-table th.col-name { width: auto; }
  .col-size { width: 56px; font-size: .8rem; }
  .col-type { width: 52px; font-size: .75rem; }
  .col-actions { width: 96px; }
  .file-table th.col-size, .file-table th.col-type, .file-table th.col-actions { font-size: 0; line-height: 1; }
  .file-table th.col-size::after { content: "Tam."; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .file-table th.col-type::after { content: "Tipo"; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .file-table th.col-actions::after { content: "Acc."; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .file-table td.col-type { overflow: hidden; text-overflow: ellipsis; }
  .name-cell .name-link { overflow-wrap: anywhere; }
  .icon-btn {
    padding: 1px;
    font-size: .7em;
  }
  .search-input { width: 100%; }
  .toolbar-group-main { display: contents; }
  .toolbar-group-main .search-input { flex: 1 1 100%; width: 100%; }
  .toolbar-group-upload { display: inline-flex; flex: 0 0 auto; width: auto; }
}


.ios-banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(245,158,11,.35); background: rgba(245,158,11,.12); color: var(--text); }
.ios-banner.hidden { display: none; }
.ios-banner-icon { font-size: 1.4rem; line-height: 1; flex: 0 0 auto; }
.ios-banner-body { flex: 1; min-width: 0; }
.ios-banner-body strong { display: block; margin-bottom: 2px; }
.ios-banner-body p { margin: 0 0 6px; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.ios-banner-link { color: #7dd3fc; text-decoration: none; font-weight: 600; }
.ios-banner-link:hover { text-decoration: underline; }
.ios-banner-close { appearance: none; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 4px; border-radius: 6px; }
.ios-banner-close:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* Bluetooth unavailable: dim/block device interaction areas */
.bt-unavailable .device-panel,
.bt-unavailable .browser-panel { opacity: .45; filter: saturate(.7); }
.bt-unavailable .device-panel,
.bt-unavailable .device-panel *,
.bt-unavailable .browser-panel,
.bt-unavailable .browser-panel *,
.bt-unavailable #connectBtn { cursor: not-allowed !important; }
.bt-unavailable .device-panel,
.bt-unavailable .browser-panel { pointer-events: none; }
.bt-unavailable #connectBtn { pointer-events: none; opacity: .6; }
.bt-unavailable #langSelect,
.bt-unavailable .lang-select { pointer-events: auto; cursor: pointer !important; opacity: 1; filter: none; }


.device-panel { container-type: inline-size; container-name: device; }
.panel-title { margin: 0 0 12px; }
.panel-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  appearance: none; background: transparent; border: none; color: inherit; font: inherit; padding: 0; margin: 0; cursor: default; text-align: left;
}
.panel-toggle .chev { display: none; transition: transform .2s ease; }
.device-panel-content { overflow: hidden; height: auto; transition: height .2s ease; }
.device-panel.collapsed .device-panel-content { height: 0; }
.device-panel.collapsed .panel-toggle .chev { transform: rotate(-90deg); }
.device-kv-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

@container device (min-width: 420px) {
  .device-kv-grid { column-gap: 12px; }
  .device-kv-grid .kv { border-bottom: 1px dashed rgba(148,163,184,.25); }
}
@container device (min-width: 700px) {
  .device-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .panel-toggle { cursor: pointer; }
  .panel-toggle .chev { display: inline-block; }
  .panel-title { margin-bottom: 8px; }
  .device-panel.collapsed .panel-title { margin-bottom: 0; }
}
