:root {
  --machine-bg: #f4f4f6;
  --machine-surface: #ffffff;
  --machine-ink: #17171a;
  --machine-muted: #77777f;
  --machine-placeholder: #a8a8b0;
  --machine-line: #dedfe5;
  --machine-soft: #ececf1;
  --machine-orange: #ff5a14;
  --machine-orange-dark: #d94400;
  --machine-danger: #b42318;
  --machine-radius: 16px;
  --machine-shadow: 0 4px 18px rgba(28, 28, 30, 0.07);
}

html {
  background: var(--machine-bg);
}

body.machine-database-ios {
  min-height: 100vh;
  margin: 0;
  padding: 0 0 calc(86px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  color: var(--machine-ink);
  background: var(--machine-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.machine-database-ios [hidden] {
  display: none !important;
}

body.machine-database-ios .global-nav,
body.machine-database-ios .mobile-app-topbar,
body.machine-database-ios .mobile-nav-shell,
body.machine-database-ios .mobile-bottom-tabs,
body.machine-database-ios .mobile-install-prompt,
body.machine-database-ios .mobile-fab,
body.machine-database-ios .mobile-context-actions {
  display: none !important;
}

body.machine-database-ios button,
body.machine-database-ios input {
  font: inherit;
}

body.machine-database-ios button,
body.machine-database-ios a {
  -webkit-tap-highlight-color: transparent;
}

.machine-app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 8px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, calc((100vw - 960px) / 2)) 8px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.machine-header-back,
.machine-header-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--machine-ink);
  text-decoration: none;
}

.machine-header-back svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-header-back:focus-visible,
.machine-header-avatar:focus-visible,
.machine-bottom-tabs a:focus-visible {
  outline: 3px solid rgba(255, 90, 20, 0.25);
  outline-offset: 2px;
}

.machine-header-title {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.machine-header-title img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
}

.machine-header-title h1 {
  overflow: hidden;
  margin: 0;
  color: #111114;
  font-size: 24px !important;
  font-weight: 700;
  line-height: 1.1 !important;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-header-avatar {
  border: 1px solid rgba(255, 90, 20, 0.18);
  background: #fff0e9;
  color: var(--machine-orange-dark);
  font-size: 13px;
  font-weight: 800;
}

body.machine-database-ios .page {
  width: min(100%, 960px);
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 14px 28px !important;
}

.machine-segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid #e3e3e8;
  border-radius: 14px;
  background: #ececf1;
}

body.machine-database-ios .machine-segmented-control button {
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  padding: 8px 12px;
  background: transparent;
  color: #6f6f78;
  box-shadow: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

body.machine-database-ios .machine-segmented-control button.is-active {
  background: var(--machine-surface);
  color: var(--machine-orange);
  box-shadow: 0 2px 9px rgba(28, 28, 30, 0.08);
}

body.machine-database-ios .machine-segmented-control button:focus-visible,
body.machine-database-ios button:focus-visible,
body.machine-database-ios input:focus-visible {
  border-color: var(--machine-orange) !important;
  outline: 3px solid rgba(255, 90, 20, 0.18) !important;
  outline-offset: 1px;
}

body.machine-database-ios .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body.machine-database-ios .panel {
  overflow: visible;
  border: 1px solid #e8e8ed;
  border-radius: var(--machine-radius);
  background: var(--machine-surface);
  box-shadow: var(--machine-shadow);
}

body.machine-database-ios .panel > h2,
body.machine-database-ios .machine-panel-title {
  margin: 0;
  padding: 16px 16px 0;
  border: 0;
  background: transparent;
  color: var(--machine-ink);
  font-size: 19px;
  font-weight: 700;
}

body.machine-database-ios .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 8px 16px 16px;
}

body.machine-database-ios .form-grid > label,
body.machine-database-ios .form-grid > .two,
body.machine-database-ios .form-grid > .three {
  padding: 10px 0 12px;
  border-bottom: 1px solid #ececf0;
}

body.machine-database-ios .form-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #24242a;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
}

body.machine-database-ios .form-grid input,
body.machine-database-ios .form-grid textarea,
body.machine-database-ios .filters input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #d3d4db;
  border-radius: 10px;
  padding: 10px 13px;
  background: #ffffff;
  color: var(--machine-ink);
  box-shadow: inset 0 1px 1px rgba(28, 28, 30, 0.02);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
}

body.machine-database-ios .machine-note-field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

body.machine-database-ios .machine-note-field textarea::placeholder {
  color: var(--machine-placeholder);
  opacity: 1;
}

body.machine-database-ios input::placeholder {
  color: var(--machine-placeholder);
  opacity: 1;
}

body.machine-database-ios .two,
body.machine-database-ios .three {
  display: grid;
  gap: 12px;
}

body.machine-database-ios .two {
  grid-template-columns: 1fr;
}

body.machine-database-ios .three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.machine-database-ios .three label {
  min-width: 0;
}

body.machine-database-ios .three input {
  padding-right: 8px;
  padding-left: 10px;
}

.machine-select-field {
  position: relative;
}

.machine-select-field::after {
  position: absolute;
  right: 15px;
  bottom: 28px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #63636b;
  border-bottom: 2px solid #63636b;
  pointer-events: none;
  content: "";
  transform: rotate(45deg);
}

body.machine-database-ios .machine-select-field input {
  padding-right: 38px;
}

body.machine-database-ios .photo-manager {
  display: grid;
  gap: 12px;
  margin: 14px -16px 0;
  padding: 16px;
  border-top: 14px solid var(--machine-bg);
  border-bottom: 0;
}

.photo-manager__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

body.machine-database-ios .photo-manager__title {
  margin: 0;
  color: var(--machine-ink);
  font-size: 18px;
  font-weight: 700;
}

body.machine-database-ios .photo-summary {
  margin-top: 3px;
  color: var(--machine-muted);
  font-size: 12px;
  font-weight: 500;
}

.machine-photo-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.machine-database-ios .machine-add-photo,
.machine-photo-placeholder,
body.machine-database-ios .photo-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9dae0;
  border-radius: 12px;
  background: #fbfbfc;
}

body.machine-database-ios .machine-add-photo {
  align-content: center;
  gap: 7px;
  border-style: dashed;
  color: #6f7078;
  padding: 10px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
}

body.machine-database-ios .machine-add-photo svg,
.machine-photo-placeholder svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: #9a9ba4;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.machine-database-ios .machine-add-photo svg {
  stroke: #85868e;
}

body.machine-database-ios .photo-grid {
  display: contents;
}

body.machine-database-ios .photo-card {
  align-content: stretch;
  padding: 0;
}

body.machine-database-ios .photo-card img {
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
}

body.machine-database-ios .photo-card__name,
body.machine-database-ios .photo-card__meta {
  display: none;
}

body.machine-database-ios .photo-card button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 30px;
  min-height: 30px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 20, 0.72);
  color: transparent;
  padding: 0;
  box-shadow: none;
}

body.machine-database-ios .photo-card button::before,
body.machine-database-ios .photo-card button::after {
  position: absolute;
  width: 13px;
  height: 1.5px;
  background: #ffffff;
  content: "";
}

body.machine-database-ios .photo-card button::before {
  transform: rotate(45deg);
}

body.machine-database-ios .photo-card button::after {
  transform: rotate(-45deg);
}

body.machine-database-ios .photo-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body.machine-database-ios .photo-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--machine-orange);
  padding: 6px 8px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}

body.machine-database-ios .form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 16px;
}

body.machine-database-ios .form-actions > button {
  width: 100%;
  min-height: 50px;
  border-radius: 11px;
  font-size: 17px;
  font-weight: 700;
}

body.machine-database-ios .form-actions > .primary {
  border: 1px solid var(--machine-orange);
  background: var(--machine-orange);
  color: #ffffff;
  box-shadow: 0 5px 13px rgba(255, 90, 20, 0.18);
}

body.machine-database-ios .form-actions > .soft {
  border: 1px solid #d5d6dc;
  background: #ffffff;
  color: var(--machine-orange);
  box-shadow: none;
}

.machine-office-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.machine-database-ios .machine-office-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: #f2f2f6;
  color: #55565e;
  padding: 7px 10px;
  box-shadow: none;
  font-size: 12px;
  white-space: normal;
}

.machine-list-heading {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
}

body.machine-database-ios .machine-list-heading h2 {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--machine-ink);
  font-size: 18px;
  font-weight: 700;
}

body.machine-database-ios .machine-list-heading button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--machine-orange);
  padding: 6px 2px 6px 10px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
}

body.machine-database-ios .filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 6px 16px 12px;
  border: 0;
}

body.machine-database-ios[data-machine-view="add"] .filters {
  display: none;
}

body.machine-database-ios .filters label {
  display: block;
}

body.machine-database-ios .search-actions {
  display: flex;
  gap: 6px;
}

body.machine-database-ios .search-actions button {
  min-height: 46px;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}

body.machine-database-ios .search-actions .primary {
  border: 1px solid var(--machine-orange);
  background: var(--machine-orange);
  color: #ffffff;
}

body.machine-database-ios .search-actions .soft {
  border: 1px solid #d5d6dc;
  background: #ffffff;
  color: #55565e;
}

body.machine-database-ios .status {
  margin: 0 16px;
  padding: 0 0 10px;
  color: var(--machine-muted);
  font-size: 12px;
  font-weight: 500;
}

body.machine-database-ios[data-machine-view="add"] .status[data-tone="success"] {
  display: none;
}

body.machine-database-ios .status[data-tone="error"] {
  color: var(--machine-danger);
}

.machine-list {
  overflow: hidden;
  margin: 0 16px 16px;
  border: 1px solid #e2e3e8;
  border-radius: 13px;
  background: #ffffff;
}

.machine-list .empty {
  padding: 28px 16px;
  color: var(--machine-muted);
  text-align: center;
  font-size: 14px;
}

.machine-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-bottom: 1px solid #e6e6eb;
}

.machine-list-row:last-child {
  border-bottom: 0;
}

body.machine-database-ios .machine-row-main {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--machine-ink);
  padding: 10px 12px;
  text-align: left;
  box-shadow: none;
  white-space: normal;
}

.machine-list-media {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: #f5f5f7;
  color: #74757d;
}

.machine-list-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.machine-list-media svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-row-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.machine-row-copy strong,
.machine-row-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-row-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.machine-row-copy span {
  color: var(--machine-muted);
  font-size: 13px;
  font-weight: 450;
}

.machine-row-copy .machine-row-location {
  white-space: normal;
  overflow-wrap: anywhere;
}

.machine-row-chevron {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #4d4e54;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-row-details {
  display: none;
  padding: 0 12px 11px 72px;
}

.machine-row-details > span {
  display: block;
  margin-bottom: 8px;
  color: var(--machine-muted);
  font-size: 12px;
}

.machine-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.machine-database-ios .machine-row-actions button {
  min-height: 36px;
  border: 1px solid #d7d8de;
  border-radius: 8px;
  background: #ffffff;
  color: #4d4e55;
  padding: 6px 9px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
}

body.machine-database-ios .machine-row-actions .machine-delete-button {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.06);
  color: var(--machine-danger);
}

.machine-bottom-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: grid;
  min-height: 70px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 7px 4px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.machine-bottom-tabs a {
  display: grid;
  min-width: 0;
  min-height: 52px;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: #3e3f45;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.machine-bottom-tabs svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-bottom-tabs a:first-child {
  color: var(--machine-orange);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 390px) {
  .machine-header-title {
    gap: 8px;
  }

  .machine-header-title img {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .machine-header-title h1 {
    font-size: 20px !important;
  }

  body.machine-database-ios .page {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }

  body.machine-database-ios .machine-segmented-control button {
    font-size: 14px;
  }

  body.machine-database-ios .form-grid {
    padding-right: 13px;
    padding-left: 13px;
  }

  body.machine-database-ios .photo-manager {
    margin-right: -13px;
    margin-left: -13px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .machine-photo-slots {
    gap: 7px;
  }

  body.machine-database-ios .machine-add-photo,
  .machine-photo-placeholder,
  body.machine-database-ios .photo-card {
    min-height: 92px;
  }
}

@media (min-width: 760px) {
  body.machine-database-ios {
    padding-bottom: 36px;
  }

  .machine-bottom-tabs {
    display: none;
  }

  body.machine-database-ios .page {
    padding: 22px 20px 40px !important;
  }

  .machine-segmented-control {
    width: min(100%, 620px);
    margin-right: auto;
    margin-bottom: 20px;
    margin-left: auto;
  }

  body.machine-database-ios .layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
  }

  body.machine-database-ios[data-machine-view="browse"] .machine-browser-panel {
    grid-column: 1 / -1;
  }

  body.machine-database-ios .machine-office-actions {
    display: grid;
  }

  body.machine-database-ios .machine-row-details {
    display: block;
  }
}

@media (max-width: 759px) {
  body.machine-database-ios .machine-panel-title {
    display: none;
  }

  body.machine-database-ios .machine-office-actions {
    display: none;
  }

  body.machine-database-ios .machine-browser-panel {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  body.machine-database-ios .machine-segmented-control button,
  body.machine-database-ios button,
  body.machine-database-ios a {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }

  body.machine-database-ios button:active,
  body.machine-database-ios a:active {
    transform: scale(0.985);
  }
}

body.machine-database-ios.machine-viewer-open {
  overflow: hidden;
}

.machine-detail-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 12, 14, 0.62);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}

.machine-detail-dialog {
  display: grid;
  width: min(100%, 980px);
  max-height: min(90vh, 780px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  background: var(--machine-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.machine-detail-header {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 68px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.14);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

body.machine-database-ios .machine-detail-close,
body.machine-database-ios .machine-detail-edit,
body.machine-database-ios .machine-detail-nav,
body.machine-database-ios .machine-detail-thumbnails button {
  box-shadow: none;
}

body.machine-database-ios .machine-detail-close {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f0f0f3;
  color: #29292e;
  padding: 0;
}

.machine-detail-close svg,
.machine-detail-nav svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-detail-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.machine-detail-heading strong,
.machine-detail-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-detail-heading strong {
  color: var(--machine-ink);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
}

.machine-detail-heading span {
  color: var(--machine-muted);
  font-size: 12px;
  font-weight: 550;
}

body.machine-database-ios .machine-detail-edit {
  min-width: 58px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: #fff0e9;
  color: var(--machine-orange-dark);
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
}

.machine-detail-content {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
}

.machine-detail-gallery {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #08080a;
}

.machine-detail-stage {
  position: relative;
  display: grid;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
  background: #08080a;
}

.machine-detail-stage > img {
  width: 100%;
  height: 100%;
  max-height: 650px;
  object-fit: contain;
}

.machine-detail-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  color: #ffffff;
  text-align: center;
}

.machine-detail-empty svg {
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  fill: none;
  stroke: #8e8e96;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.machine-detail-empty strong {
  font-size: 18px;
  font-weight: 700;
}

.machine-detail-empty span {
  color: #aaaab2;
  font-size: 13px;
}

body.machine-database-ios .machine-detail-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(24, 24, 27, 0.72);
  color: #ffffff;
  padding: 0;
  transform: translateY(-50%);
}

body.machine-database-ios .machine-detail-nav.previous {
  left: 14px;
}

body.machine-database-ios .machine-detail-nav.next {
  right: 14px;
}

body.machine-database-ios .machine-detail-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.machine-detail-thumbnails {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 11px 14px 14px;
  background: #08080a;
  scrollbar-width: none;
}

.machine-detail-thumbnails::-webkit-scrollbar {
  display: none;
}

body.machine-database-ios .machine-detail-thumbnails button {
  width: 68px;
  min-width: 68px;
  min-height: 54px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #202024;
  padding: 0;
  opacity: 0.62;
}

body.machine-database-ios .machine-detail-thumbnails button[aria-current="true"] {
  border-color: var(--machine-orange);
  opacity: 1;
}

.machine-detail-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.machine-detail-info {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: var(--machine-bg);
}

.machine-detail-info-list,
.machine-detail-notes {
  overflow: hidden;
  border: 1px solid #e3e3e8;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(28, 28, 30, 0.05);
}

.machine-detail-info-row {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border-bottom: 1px solid #ececf0;
}

.machine-detail-info-row:last-child {
  border-bottom: 0;
}

.machine-detail-info-row span,
.machine-detail-notes > span {
  color: var(--machine-muted);
  font-size: 12px;
  font-weight: 600;
}

.machine-detail-info-row strong {
  color: var(--machine-ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.machine-detail-notes {
  margin-top: 12px;
  padding: 14px 15px;
}

.machine-detail-notes p {
  margin: 6px 0 0;
  color: var(--machine-ink);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

body.machine-viewer-open .machine-bottom-tabs {
  display: none;
}

@media (max-width: 759px) {
  .machine-detail-viewer {
    place-items: stretch;
    padding: 0;
    background: #08080a;
  }

  .machine-detail-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #08080a;
  }

  .machine-detail-header {
    min-height: 66px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(8, 8, 10, 0.94);
  }

  body.machine-database-ios .machine-detail-close {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(40, 40, 44, 0.8);
    color: #ffffff;
  }

  .machine-detail-heading strong {
    color: #ffffff;
  }

  .machine-detail-heading span {
    color: #a7a7af;
  }

  body.machine-database-ios .machine-detail-edit {
    background: var(--machine-orange);
    color: #ffffff;
  }

  .machine-detail-content {
    display: block;
    min-height: 0;
    overflow-y: auto;
    background: #08080a;
  }

  .machine-detail-gallery {
    min-height: 0;
  }

  .machine-detail-stage {
    min-height: min(58vh, 540px);
    height: min(58vh, 540px);
  }

  .machine-detail-stage > img {
    max-height: none;
  }

  .machine-detail-info {
    overflow: visible;
    padding: 14px 12px calc(24px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: #f2f2f7;
  }

  body.machine-database-ios .machine-detail-nav.previous {
    left: 10px;
  }

  body.machine-database-ios .machine-detail-nav.next {
    right: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .machine-detail-viewer:not([hidden]) .machine-detail-dialog {
    animation: machine-detail-enter 180ms ease-out;
  }
}

@keyframes machine-detail-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.machine-database-ios .machine-confirm {
  width: min(340px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid #e5e5ea;
  border-radius: 20px;
  background: #fff;
  color: #1c1c1e;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .16);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Arial, sans-serif;
  overflow: auto;
  letter-spacing: 0;
}

.machine-confirm::backdrop { background: rgba(0, 0, 0, .3); }
.machine-confirm-content { padding: 24px 22px 20px; text-align: center; }
body.machine-database-ios .machine-confirm h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1.3;
}
.machine-confirm p { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.machine-confirm-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid #e5e5ea; }
body.machine-database-ios .machine-confirm .machine-confirm-actions button[type="submit"] {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 12px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 17px;
  font-weight: 500;
  white-space: normal;
  box-shadow: none;
}
body.machine-database-ios .machine-confirm .machine-confirm-actions button + button[type="submit"] { border-left: 1px solid #e5e5ea; color: var(--machine-orange); font-weight: 700; }
body.machine-database-ios .machine-confirm[data-destructive="true"] .machine-confirm-actions [value="confirm"] { color: #d70015; }
body.machine-database-ios .machine-confirm .machine-confirm-actions button:focus-visible { outline: 2px solid var(--machine-orange); outline-offset: -4px; }
body.machine-database-ios .machine-confirm .machine-confirm-actions button:hover { background: #f2f2f7; }
