/* Console layout and component styling for the KioskGrid customer device console. */
:root {
  --toolbar-height: 64px;
  --tab-strip-height: 56px;
  --sidebar-width: 288px;
  --page-gutter: 24px;
  --color-ink: #07132f;
  --color-muted: #5d6b86;
  --color-soft: #edf5f7;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f8fb;
  --color-border: #dce4ec;
  --color-sidebar: #041a3d;
  --color-sidebar-strong: #02102a;
  --color-brand: #00d4b3;
  --color-brand-strong: #008f7a;
  --color-accent: #16a3ff;
  --color-lime: #8bdc32;
  --color-coral: #ff5a5f;
  --color-warning: #e5484d;
  --shadow-soft: 0 12px 30px rgba(7, 19, 47, 0.08);
  --shadow-pop: 0 16px 34px rgba(0, 212, 179, 0.2);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  color: var(--color-ink);
  background: var(--color-surface-alt);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 184, 217, 0.4);
  outline-offset: 2px;
}

button:focus,
button:active {
  outline: none;
}

button::-moz-focus-inner {
  border: none;
}

.main-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: var(--toolbar-height) 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
}

.header {
  grid-area: header;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

.header a {
  color: inherit;
  text-decoration: none;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.menu-icon:hover {
  background: var(--color-soft);
}

.menu-icon img,
.dropdown-but img,
.action-but img,
.but-cancel-all-options img {
  display: block;
}

#logo-item {
  width: auto;
  min-width: 0;
  padding: 0;
}

#logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  height: 44px;
  padding: 0 10px 0 4px;
  color: var(--color-ink);
  font-weight: 800;
  letter-spacing: 0;
}

#logo img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(7, 19, 47, 0.08);
}

#selected-targets {
  min-width: 0;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.toolbar-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.first-right-item {
  margin-left: auto;
}

#but-notifications,
#but-help,
#account-menu {
  margin-left: 0;
}

.dropdown-container {
  position: relative;
}

.dropdown-but {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--color-ink);
  background: #ffffff;
  border-color: var(--color-border);
  transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.dropdown-but:hover {
  background: var(--color-soft);
  border-color: rgba(0, 212, 179, 0.34);
  transform: translateY(-1px);
}

.dropdown-options {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  z-index: 30;
}

.dropdown-visible {
  display: block;
}

.dropdown-options ul {
  width: 100%;
  max-height: 420px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
}

.dropdown-options a {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 10px;
  padding: 10px 12px;
  color: var(--color-brand-strong);
  border-radius: var(--radius-sm);
  font-weight: 650;
}

.dropdown-options a:hover,
.dropdown-item:hover {
  background: var(--color-soft);
}

.dropdown-options img {
  width: 20px;
  height: 20px;
  margin: 0;
}

.dropdown-item {
  border-radius: var(--radius-sm);
}

.help-option {
  margin: 0;
}

.notification-item,
.command-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--color-ink);
  white-space: normal;
}

.command-queue-item > div:first-child {
  min-width: 0;
  flex: 1;
}

.command-queue-but {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(229, 72, 77, 0.1);
}

.command-queue-but img {
  width: 18px;
  height: 18px;
}

.but-cancel-all-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 16px);
  min-height: 42px;
  margin: 0 8px 8px;
  padding: 0 12px;
  color: var(--color-warning);
  font-weight: 750;
  border: 1px solid rgba(229, 72, 77, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(229, 72, 77, 0.08);
}

.no-commands-option {
  padding: 14px;
  color: var(--color-muted);
  font-style: italic;
}

.item-failed {
  color: var(--color-warning);
}

.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: var(--toolbar-height);
  left: 0;
  z-index: 12;
  width: min(var(--sidebar-width), calc(100vw - 28px));
  height: calc(100vh - var(--toolbar-height));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: #ffffff;
  background: linear-gradient(180deg, var(--color-sidebar) 0%, var(--color-sidebar-strong) 100%);
  border-right: 0;
  box-shadow: 14px 0 40px rgba(2, 16, 42, 0.2);
  transform: translateX(calc(-1 * var(--sidebar-width)));
  transition: transform 0.24s ease;
}

.sidebar-visible {
  transform: translateX(0);
}

.sidebar-header-row {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--tab-strip-height);
  min-height: var(--tab-strip-height);
  padding: 8px 12px;
  background: rgba(2, 16, 42, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.device-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.device-search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  pointer-events: none;
}

.device-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 7px;
  height: 2px;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  transform: rotate(45deg);
  transform-origin: left center;
}

#device-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

#device-search-input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

#device-search-input:focus {
  border-color: rgba(0, 212, 179, 0.9);
  box-shadow: 0 0 0 3px rgba(0, 212, 179, 0.18);
}

.but-add-device {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 10px 20px rgba(0, 212, 179, 0.2);
  font-size: 0;
  font-weight: 800;
  line-height: 1;
}

.but-add-device:hover {
  background: #16e6c7;
}

.but-add-device::before,
.but-add-device::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.but-add-device::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.sidebar ul {
  margin: 0;
  padding: 8px;
  user-select: none;
}

.sidebar__list-item {
  width: 100%;
  min-height: 58px;
  margin: 0 0 6px;
  padding: 9px 10px;
  color: rgba(255, 255, 255, 0.92);
  list-style: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.sidebar__list-item:hover {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar__list-item.selected {
  color: var(--color-sidebar-strong);
  background: var(--color-brand);
  border-color: transparent;
  box-shadow: none;
}

.device-list-title {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.device-status-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.device-status-dot.online {
  background: var(--color-brand);
}

.device-status-dot.offline {
  background: rgba(255, 255, 255, 0.48);
}

.sidebar__list-item.selected .device-status-dot {
  width: 18px;
  height: 18px;
  background: #ffffff;
  box-shadow: none;
}

.sidebar__list-item.selected .device-status-dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
}

.sidebar__list-item.selected .device-status-dot.online::after {
  background: var(--color-brand);
}

.sidebar__list-item.selected .device-status-dot.offline::after {
  background: #626c7d;
}

.device-list-title > div {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
}

.device-list-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-list-primary {
  overflow: hidden;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-list-secondary {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__list-item.selected .device-list-secondary {
  color: rgba(2, 16, 42, 0.68);
}

.device-selection-menu-layer {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 26;
  width: calc(min(var(--sidebar-width), calc(100vw - 28px)) - 16px);
  height: 0;
  overflow: visible;
}

#device-selection-menu {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  background: rgba(2, 16, 42, 0.86);
  box-shadow: 0 14px 26px rgba(2, 16, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  backdrop-filter: blur(8px);
}

#device-selection-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#device-selection-summary {
  min-width: 0;
  flex: 1;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.2;
}

#device-selection-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--color-sidebar-strong);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  font-weight: 750;
}

#but-select-all-devices {
  white-space: nowrap;
}

#but-close-device-context-menu {
  width: 36px;
  min-width: 36px;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

#device-selection-menu img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

#device-selection-hint {
  position: absolute;
  inset: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(2, 16, 42, 0.78);
  box-shadow: 0 12px 22px rgba(2, 16, 42, 0.18);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

#device-selection-hint.active {
  opacity: 1;
  transform: translateY(0);
}

#sb-no-search-results,
#sb-no-devices {
  margin: 14px;
  padding: 16px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  line-height: 1.45;
}

#sb-no-search-results {
  display: none;
  margin-top: 8px;
  text-align: center;
}

#sb-no-devices a {
  color: var(--color-sidebar-strong);
  font-weight: 800;
}

#sb-no-devices p {
  margin: 0 0 12px;
}

.empty-activate-device,
#mobile-activate-device {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--color-sidebar-strong);
  text-decoration: none;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  font-weight: 850;
}

.empty-activate-device {
  width: 100%;
}

#mobile-activate-device {
  display: none;
}

.no-devices-state .device-search-wrap,
.no-devices-state .but-add-device {
  display: none;
}

.no-devices-state .sidebar-header-row {
  display: none;
}

.no-devices-state #sb-no-devices {
  margin-top: 16px;
}

.has-devices-state #sb-no-devices {
  display: none !important;
}

.untrusted-device {
  opacity: 0.72;
  cursor: default !important;
  background: transparent !important;
}

.trust-device-but {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  background: var(--color-coral);
  font-size: 0.86rem;
  font-weight: 800;
}

.trust-device-but img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.main {
  grid-area: main;
  width: 100%;
  min-width: 0;
}

.main-header {
  position: fixed;
  top: var(--toolbar-height);
  left: 0;
  right: 0;
  z-index: 11;
  height: var(--tab-strip-height);
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(14px);
  overflow: visible;
}

.tab-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tablinks {
  flex: 0 0 auto;
  min-width: 92px;
  height: 40px;
  padding: 0 16px;
  color: var(--color-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 780;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.tablinks:hover {
  color: var(--color-ink);
  background: var(--color-soft);
}

.tablinks.selected {
  color: var(--color-sidebar-strong);
  background: var(--color-brand);
  box-shadow: none;
}

#main-content {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--toolbar-height) - var(--tab-strip-height));
  padding: calc(var(--tab-strip-height) + var(--page-gutter)) var(--page-gutter) var(--page-gutter);
}

.tab-container {
  display: none;
}

.tab-container h2 {
  margin: 0 0 18px;
  color: var(--color-ink);
  font-size: 1.15rem;
  line-height: 1.25;
}

.contentcard,
.package-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 20px;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.contentcard {
  flex: 0 1 360px;
}

.card-header,
.package-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
}

.img-card-header,
.card-icon {
  width: 40px;
  height: 40px;
  margin: 0;
  flex: 0 0 auto;
  border-radius: 8px;
}

.card-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-sidebar-strong);
  background: var(--color-brand);
}

.card-icon::before,
.card-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.card-icon-android::before {
  width: 22px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 5px 5px 4px 4px;
}

.card-icon-android::after {
  width: 16px;
  height: 8px;
  top: 8px;
  border-top: 2px solid currentColor;
  transform: skew(-14deg);
}

.card-icon-device::before {
  width: 22px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.card-icon-device::after {
  bottom: 9px;
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.card-icon-upload::before {
  width: 18px;
  height: 14px;
  bottom: 9px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.card-icon-upload::after {
  width: 12px;
  height: 12px;
  top: 10px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: rotate(45deg);
}

.card-icon-reboot::before {
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

.card-icon-reboot::after {
  top: 10px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(28deg);
}

.card-icon-message::before {
  width: 24px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.card-icon-message::after {
  left: 12px;
  bottom: 9px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skew(-18deg);
}

.card-icon-danger {
  color: #ffffff;
  background: var(--color-warning);
}

.card-icon-danger::before {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.card-icon-danger::after {
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.title-card-header {
  min-width: 0;
  margin: 0;
  color: var(--color-ink);
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.25;
}

.details-card-content {
  width: 100%;
  margin: 18px 0 0;
  color: var(--color-muted);
  line-height: 1.45;
}

.card-label {
  display: block;
  margin: 0 0 4px;
  color: var(--color-ink);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-data {
  margin: 0 0 14px;
  color: var(--color-muted);
  font-size: 0.96rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.card-data:last-child {
  margin-bottom: 0;
}

.card-data input,
#in-show-msg,
#current-dir,
#kiosk-url-input,
#kiosk-video-url-input,
#kiosk-youtube-url-input,
#kiosk-orientation-select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-ink);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.card-data input:focus,
#in-show-msg:focus,
#current-dir:focus,
#kiosk-url-input:focus,
#kiosk-video-url-input:focus,
#kiosk-youtube-url-input:focus,
#kiosk-orientation-select:focus {
  border-color: var(--color-brand);
}

.action-but,
.but-info-action,
.but-file-toolbar,
.files-tab-input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-sidebar);
  box-shadow: none;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.action-but:hover,
.but-info-action:hover,
.but-info-action:focus,
.but-file-toolbar:hover,
.but-file-toolbar:focus,
.files-tab-input-label:hover {
  transform: translateY(-1px);
  background: var(--color-sidebar-strong);
  box-shadow: none;
}

.action-but img,
.but-info-action img {
  width: 20px;
  height: 20px;
}

.danger-action {
  background: var(--color-warning) !important;
  box-shadow: none;
}

.apply-action {
  width: fit-content;
}

.next-to-input {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  margin: 0 0 0 8px;
}

.inline-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-edit-row input {
  flex: 1;
  min-width: 0;
}

.is-hidden {
  display: none !important;
}

#circular-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 101;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border: 12px solid rgba(0, 87, 255, 0.12);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#progress-wrapper {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 101;
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  transform: translateX(-50%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-pop);
}

#progress-bar {
  width: 100%;
}

#tab-info-container,
#tab-control-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, 360px);
  justify-content: start;
  align-items: start;
  gap: 18px;
  margin: 0;
  max-width: 760px;
}

#tab-control-container {
  display: block;
  max-width: 820px;
}

.info-item,
.control-card {
  width: min(100%, 360px);
}

.control-card {
  width: min(100%, 340px);
}

.control-action-list {
  width: min(100%, 820px);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.control-action-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(132px, auto);
  align-items: center;
  gap: 18px;
  min-height: 86px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.control-action-row:last-child {
  border-bottom: 0;
}

.control-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.control-action-img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.control-action-copy {
  min-width: 0;
  align-self: center;
}

.control-action-copy h3 {
  margin: 0 0 4px;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 820;
  line-height: 1.25;
}

.control-action-copy p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.control-action-area {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.control-action-area .action-but {
  min-width: 118px;
  white-space: nowrap;
}

.control-message-action {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  justify-content: end;
}

.control-message-action input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.control-upload-panel {
  grid-column: 2 / 4;
  margin-top: 4px;
}

.control-upload-panel[hidden] {
  display: none !important;
}

.control-settings-row {
  align-items: start;
  cursor: pointer;
}

.android-settings-panel {
  grid-column: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.android-settings-panel[hidden],
.android-settings-list[hidden],
.android-settings-status[hidden] {
  display: none !important;
}

.android-settings-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.settings-inline-action {
  min-height: 30px;
  padding: 0 12px;
  color: var(--color-brand);
  font-weight: 760;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

.pending-wipe-warning {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: auto;
  margin: 14px 18px;
  padding: 12px 14px;
  color: #7d1010;
  border: 1px solid rgba(183, 28, 28, 0.32);
  border-radius: var(--radius-md);
  background: #fff2f1;
}

.pending-wipe-warning[hidden] {
  display: none !important;
}

.pending-wipe-warning button {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.icon-action-but {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

.chevron-action span {
  display: block;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--color-ink);
  border-bottom: 2px solid var(--color-ink);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.16s ease;
}

.chevron-action[aria-expanded="true"] span {
  transform: rotate(225deg) translate(-2px, -2px);
}

.switch-control input:disabled + span {
  opacity: 0.58;
  cursor: not-allowed;
}

.android-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  overflow: hidden;
}

.settings-section-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  color: var(--color-ink);
  font-weight: 820;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.settings-section-header img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.section-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
}

.settings-section-header[aria-expanded="true"] .section-chevron {
  transform: rotate(225deg);
}

.settings-section-body {
  padding: 0 10px 10px;
}

.settings-section.collapsed .settings-section-body {
  display: none;
}

.setting-control-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 130px;
}

.setting-control-wrap select {
  min-height: 38px;
  max-width: 170px;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.setting-control-wrap input[type="range"] {
  width: 140px;
}

.settings-action-button {
  min-height: 36px;
  padding: 0 14px;
}

.setting-range-value {
  min-width: 34px;
  color: var(--color-muted);
  font-size: 0.84rem;
  text-align: right;
}

.setting-risk-high {
  border-color: rgba(183, 28, 28, 0.22);
}

.settings-password-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 12, 26, 0.48);
}

.settings-password-dialog {
  width: min(100%, 420px);
  padding: 20px;
  color: var(--color-ink);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.settings-password-dialog h3 {
  margin: 0 0 8px;
}

.settings-password-dialog p {
  margin: 0 0 12px;
  color: var(--color-muted);
  line-height: 1.35;
}

.settings-password-dialog .danger-copy {
  color: #9b1c1c;
  font-weight: 720;
}

.settings-password-dialog input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.settings-password-error {
  margin-top: 10px;
  color: #9b1c1c;
  font-size: 0.88rem;
  font-weight: 720;
}

.settings-password-error[hidden] {
  display: none !important;
}

.settings-password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

#control-tooltip {
  visibility: hidden;
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  color: #ffffff;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--color-brand-strong);
  box-shadow: var(--shadow-pop);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
}

.disabled-control {
  pointer-events: none;
  opacity: 0.42;
}

.disabled-control ~ #control-tooltip {
  visibility: visible;
}

.select-files-section {
  display: grid;
  place-items: center;
  min-height: 116px;
  color: var(--color-sidebar);
  text-align: center;
  border: 2px dashed rgba(0, 212, 179, 0.42);
  border-radius: var(--radius-md);
  background: #f1fbf9;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  width: 100%;
  padding: 20px;
  cursor: pointer;
  font-weight: 800;
}

#package-item-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.package-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.package-search {
  width: 100%;
  min-height: 42px;
  padding: 0 40px 0 12px;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.package-search-wrap {
  position: relative;
  min-width: 0;
}

.package-search-clear {
  display: none;
  position: absolute;
  top: 50%;
  right: 7px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #31415f;
  border: 1px solid rgba(49, 65, 95, 0.12);
  border-radius: 50%;
  background: #eef3f8;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1;
  transform: translateY(-50%);
}

.package-search-clear.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.package-search-clear:hover {
  color: var(--color-sidebar-strong);
  border-color: rgba(0, 212, 179, 0.35);
  background: var(--color-soft);
}

.package-filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.package-filter-chip {
  min-height: 34px;
  padding: 0 10px;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.package-filter-chip.active {
  color: var(--color-sidebar-strong);
  border-color: rgba(0, 212, 179, 0.55);
  background: rgba(0, 212, 179, 0.14);
}

.package-filter-chip-state {
  border-style: dashed;
}

.package-filter-chip-state.active {
  color: #4c3b78;
  border-color: rgba(111, 79, 191, 0.45);
  background: rgba(111, 79, 191, 0.1);
}

.package-filter-status {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.packages-empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  text-align: center;
}

.packages-empty-state-text {
  max-width: 520px;
  color: var(--color-muted);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: normal;
}

.package-item-uninstalled {
  background: #fff9ed;
  border-color: #f3c47e;
  border-left: 5px solid #e89b24;
}

.package-item-hidden {
  background: #f7f3ff;
  border-color: #cfc0f2;
  border-left: 5px solid #7c5cc4;
}

.package-item-uninstalled.package-item-hidden {
  background: linear-gradient(90deg, #fff9ed 0, #fff9ed 52%, #f7f3ff 100%);
  border-left-color: #e89b24;
}

.package-card-header {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  flex-wrap: nowrap;
  align-items: center;
}

.package-card-header .title-card-header {
  min-width: 0;
  overflow-wrap: anywhere;
}

.package-title-block {
  min-width: 0;
}

.package-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
  margin-top: 5px;
}

.package-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 7px;
  color: #31415f;
  border: 1px solid rgba(49, 65, 95, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.package-badge img {
  width: 14px;
  height: 14px;
}

.package-name {
  margin: 12px 0 0 52px;
}

.package-info-card-section {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 6px 0 0 52px;
}

.package-part {
  min-width: 150px;
}

.package-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-width: max-content;
}

.package-but {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
}

.package-but:hover {
  background: var(--color-soft);
  border-color: rgba(0, 87, 255, 0.28);
}

.package-but img {
  width: 24px;
  height: 24px;
}

.package-enable-system-but {
  border-color: rgba(232, 155, 36, 0.45);
  background: #fff5dc;
}

.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0 0 3px;
  color: #ffffff;
  border: 0;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 14px 28px rgba(0, 212, 179, 0.24);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 56px;
}

.action-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 44px) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.but-file-toolbar {
  width: 44px;
  min-width: 44px;
  height: 42px;
  padding: 0;
}

#current-dir {
  min-width: 0;
  margin: 0;
  text-align: left;
}

.files-tab-input-label {
  min-width: max-content;
  white-space: nowrap;
}

#files-list {
  max-width: 760px;
}

#files-list ul {
  margin: 0;
  padding: 0;
}

.file-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 10px;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.file-item:hover {
  background: var(--color-soft);
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 184, 217, 0.1);
}

.file-info-with-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
}

.file-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 750;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-file-info {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--color-muted);
  font-size: 0.84rem;
  font-weight: 520;
}

.action-file-pull {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  margin-left: auto;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  font-size: 1.1rem;
}

.permission-warning-card {
  width: 100% !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  margin: 0 0 18px !important;
  padding: 16px !important;
  border-left: 6px solid var(--color-warning);
}

.permission-warning-card h3 {
  margin: 0 0 4px;
  color: var(--color-warning);
  font-size: 1rem;
}

.permission-warning-card p,
.supporting-copy {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

video {
  width: 100% !important;
  height: auto !important;
}

.video-text-overlay {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 100;
  width: 100%;
  font-size: 1.5rem;
  text-align: center;
}

#screenshot-container img {
  display: block;
  max-width: min(100%, 760px);
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

#kiosk-tab-container {
  margin: 0;
}

.kiosk-card {
  width: min(100%, 680px);
}

.kiosk-selection-summary {
  margin: 8px 0 4px;
  color: var(--color-muted);
  font-weight: 720;
}

.settings-panel {
  flex-direction: column;
  gap: 16px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--color-ink);
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kiosk-switch-control {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--color-border);
  transition: background 160ms ease;
}

.kiosk-switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease;
}

.switch-row input:checked + .kiosk-switch-control {
  background: var(--color-brand);
}

.switch-row input:checked + .kiosk-switch-control::after {
  transform: translateX(20px);
}

.kiosk-mode-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.kiosk-mode-selector label {
  min-width: 0;
}

.kiosk-mode-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kiosk-mode-selector span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  color: var(--color-ink);
  font-weight: 780;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
}

.kiosk-mode-selector input:checked + span {
  color: #ffffff;
  border-color: var(--color-sidebar);
  background: var(--color-sidebar);
}

.kiosk-warning {
  padding: 10px 12px;
  color: #744d00;
  background: #fff5d6;
  border: 1px solid #f3d276;
  border-radius: var(--radius-sm);
}

.kiosk-mode-panel[hidden],
.kiosk-warning[hidden],
.kiosk-upload-progress[hidden] {
  display: none !important;
}

.kiosk-upload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.kiosk-upload-row .file-input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  font-weight: 820;
  border-radius: var(--radius-sm);
  background: var(--color-sidebar);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.kiosk-file-name {
  min-width: 0;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.kiosk-current-file {
  margin-bottom: 10px;
  color: var(--color-muted);
  font-weight: 720;
}

.secondary-action-but {
  min-height: 38px;
  padding: 0 12px;
  color: var(--color-sidebar);
  font-weight: 780;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
}

.secondary-action-but[hidden] {
  display: none !important;
}

.kiosk-upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.kiosk-upload-progress progress {
  width: 100%;
}

.kiosk-advanced-settings {
  color: var(--color-muted);
}

.kiosk-advanced-settings summary {
  color: var(--color-ink);
  font-weight: 780;
  cursor: pointer;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-ink);
  font-weight: 780;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--color-ink);
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-brand);
}

.setting-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}

.setting-switch-copy {
  min-width: 0;
}

.setting-switch-copy .card-label {
  margin: 0 0 3px;
}

.setting-switch-help {
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.3;
}

.switch-control {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  min-width: 48px;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d1df;
  transition: background-color 0.16s ease;
}

.switch-control span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(7, 19, 47, 0.2);
  transition: transform 0.16s ease;
}

.switch-control input:checked + span {
  background: var(--color-brand);
}

.switch-control input:checked + span::after {
  transform: translateX(20px);
}

.location-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 4px;
}

.location-label-row .card-label {
  margin: 0;
}

.inline-chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--color-brand-strong);
  border: 1px solid rgba(0, 87, 255, 0.24);
  border-radius: 999px;
  background: var(--color-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.wide-map-action {
  width: 100%;
  margin-top: 15px;
}

.footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 0 18px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
}

.footer a,
.footer a:visited {
  color: var(--color-brand-strong);
  text-decoration: none;
  font-weight: 700;
}

.footer__copyright {
  cursor: default;
}

@media screen and (min-width: 800px) {
  .main-grid {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "sidebar main"
      "sidebar footer";
  }

  #toggle-sidebar-but {
    display: none;
  }

  .sidebar {
    transform: translateX(0);
    box-shadow: none;
  }

  .main-header {
    left: var(--sidebar-width);
    padding: 0 24px;
  }

  #main-content {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media screen and (max-width: 799px) {
  :root {
    --toolbar-height: 60px;
    --page-gutter: 14px;
  }

  .header {
    gap: 4px;
    padding: 0 8px;
  }

  #logo span {
    display: none;
  }

  #selected-targets {
    flex: 1;
    max-width: none;
    font-size: 0.86rem;
  }

  .no-devices-state #selected-targets {
    display: none;
  }

  .no-devices-state #mobile-activate-device {
    display: inline-flex;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .dropdown-but {
    width: 38px;
    height: 38px;
  }

  #but-help {
    display: none;
  }

  .main-header {
    padding: 0 10px;
  }

  #main-content {
    padding-top: calc(var(--tab-strip-height) + 16px);
  }

  .contentcard,
  .package-item {
    padding: 18px;
  }

  #tab-info-container,
  #tab-control-container {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .control-action-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .control-action-icon {
    grid-row: 1 / 3;
    align-self: center;
  }

  .control-action-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .control-action-area,
  .control-upload-panel,
  .android-settings-panel {
    grid-column: 2 / 3;
    justify-content: flex-start;
  }

  .control-message-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .control-message-action input {
    min-width: 0;
    order: 2;
  }

  .control-message-action .action-but {
    order: 1;
  }

  .control-action-area .action-but {
    min-width: 0;
  }

  .action-toolbar {
    grid-template-columns: repeat(3, 44px) minmax(0, 1fr);
  }

  .files-tab-input-label {
    grid-column: 1 / -1;
  }

  .permission-warning-card {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .package-card-header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
  }

  .package-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-left: 52px;
  }

  .fab {
    right: 18px;
    bottom: 18px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 16px;
  }
}

@media screen and (max-width: 480px) {
  .dropdown-options {
    right: -42px;
  }

  #but-enqueued-commands .dropdown-options,
  #but-notifications .dropdown-options {
    right: -86px;
  }

  .tablinks {
    min-width: auto;
    padding: 0 14px;
  }

  .package-name,
  .package-info-card-section,
  .package-actions {
    margin-left: 0;
  }

  .package-toolbar {
    grid-template-columns: 1fr;
  }

  .package-filter-group {
    justify-content: flex-start;
  }

  .package-filter-chip {
    padding: 0 9px;
    font-size: 0.78rem;
  }
}
