:root {
  color-scheme: light;
  --ink: #182029;
  --muted: #66717e;
  --line: #d9e0e7;
  --paper: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --blue: #1769aa;
  --green: #1d8a68;
  --amber: #b56b18;
  --red: #c34040;
  --violet: #6657b8;
  --shadow: 0 18px 45px rgba(24, 32, 41, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 105, 170, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(29, 138, 104, 0.12), transparent 32%),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 0 22px;
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 0;
  place-items: center;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #111820;
  box-shadow: 0 10px 22px rgba(23, 105, 170, 0.22);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.is-partner .brand-mark {
  cursor: pointer;
  background: #fff;
}

body.is-partner .brand-mark img {
  object-fit: contain;
  padding: 5px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 1.15rem + 0.6vw, 2rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.45rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.3;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-login-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.admin-login-button {
  flex-direction: column;
  gap: 1px;
  min-width: 118px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  line-height: 1.05;
}

.admin-login-button small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.partner-login-button {
  border-color: rgba(24, 32, 41, 0.92);
  color: #fff;
  background: linear-gradient(145deg, #14202b, #1d3d55);
  box-shadow: 0 10px 24px rgba(24, 32, 41, 0.14);
}

.partner-login-button small {
  color: rgba(237, 244, 249, 0.82);
}

body.is-partner .partner-login-button {
  border-color: rgba(29, 138, 104, 0.7);
  background: linear-gradient(145deg, #14654e, #1d8a68);
}

.primary-button,
.secondary-button {
  border: 0;
  padding: 0 13px;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.icon-button:hover,
.tab-button:hover,
.quick-card:hover {
  border-color: rgba(23, 105, 170, 0.48);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lookup-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.lookup-panel {
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: none;
}

body:not([data-active-tab="overview"]) .lookup-panel {
  display: none;
}

body:not([data-active-tab="overview"]) #adminPanel {
  display: none;
}

.search-area {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 7px 7px 12px;
  border: 1px solid #c7d2dc;
  border-radius: 8px;
  background: var(--surface);
}

.search-box svg {
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.search-box button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.status-line {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-list {
  display: none;
  gap: 10px;
  padding: 14px;
}

body.is-admin .quick-list {
  display: grid;
}

.quick-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
}

.quick-card.is-active {
  border-color: var(--blue);
  background: #eef7ff;
}

.quick-select-button {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 66px;
  border: 0;
  border-radius: 8px;
  padding: 2px;
  color: inherit;
  text-align: left;
  background: transparent;
}

.quick-copy {
  min-width: 0;
}

.quick-delete-button {
  display: grid;
  min-width: 48px;
  min-height: 54px;
  place-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  color: #596774;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}

.quick-delete-button svg {
  width: 17px;
  height: 17px;
}

.quick-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.phone-thumb {
  display: grid;
  width: 54px;
  height: 62px;
  place-items: center;
  border-radius: 8px;
  background: #e7ecf2;
  overflow: hidden;
}

.phone-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-title {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.quick-status {
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--green);
  background: rgba(29, 138, 104, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
}

.status-delivered {
  color: #1d7157;
  background: rgba(29, 138, 104, 0.13);
}

.status-waiting {
  color: #8a5a13;
  background: rgba(181, 107, 24, 0.14);
}

.status-preparing {
  color: #1769aa;
  background: rgba(23, 105, 170, 0.13);
}

.status-preorder {
  color: #6657b8;
  background: rgba(102, 87, 184, 0.14);
}

.status-refund {
  color: #b3261e;
  background: rgba(195, 64, 64, 0.12);
}

.owner-strip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

body.is-admin .owner-strip {
  display: flex;
}

.owner-strip h3 {
  margin: 0;
}

.mini-stats {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.mini-stats strong {
  color: var(--ink);
}

.detail-panel {
  min-width: 0;
  overflow: hidden;
}

body:not(.has-device) .device-hero,
body:not(.has-device) .tab-button[data-tab="guide"],
body:not(.has-device) .tab-button[data-tab="condition"],
body:not(.has-device) .tab-button[data-tab="notes"],
body:not(.has-device) .info-band,
body:not(.has-device) .spec-grid,
body:not(.has-device) #guide,
body:not(.has-device) #condition,
body:not(.has-device) #notes {
  display: none;
}

body.has-device .empty-state {
  display: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed #c7d2dc;
  border-radius: 8px;
  padding: 24px 16px;
  color: var(--muted);
  background: #f8fbfd;
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  color: var(--blue);
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  margin: 0;
  line-height: 1.5;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 18px 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.partner-panel,
.partner-office-panel {
  border: 1px solid rgba(24, 32, 41, 0.12);
  border-radius: 8px;
  margin: 0 18px 14px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 243, 0.94));
  box-shadow: 0 12px 28px rgba(24, 32, 41, 0.08);
}

.partner-office-panel {
  margin: 18px 26px 26px;
  padding: 18px;
}

.admin-panel-head,
.admin-actions,
.admin-toolbar,
.partner-toolbar,
.partner-office-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-toolbar h2,
.partner-toolbar h2,
.partner-office-head h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.admin-actions,
.partner-actions {
  justify-content: flex-end;
}

.partner-office-button {
  min-width: 180px;
  color: #fff;
  background: linear-gradient(145deg, #14202b, #1d8a68);
}

.partner-office-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(24, 32, 41, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.partner-office-empty span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #14202b, #1d8a68);
  box-shadow: 0 12px 28px rgba(24, 32, 41, 0.14);
}

.partner-office-empty h3,
.partner-office-empty p {
  margin: 0;
}

.partner-office-empty p {
  color: var(--muted);
  font-weight: 800;
}

.partner-office-compact {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(24, 32, 41, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

body.is-admin.is-partner-office .partner-office-compact {
  display: none;
}

.partner-summary-line,
.partner-approval-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.partner-summary-line span,
.partner-approval-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.partner-summary-line small,
.partner-approval-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.partner-summary-line strong,
.partner-approval-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.partner-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 9px;
  color: #8a5a13;
  background: rgba(181, 107, 24, 0.14);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.partner-status-pill.is-approved {
  color: #1d7157;
  background: rgba(29, 138, 104, 0.13);
}

.partner-office-compact p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.partner-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid rgba(24, 32, 41, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.partner-admin-form label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.partner-admin-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d2dc;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.partner-admin-form button {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.partner-pending-panel,
.partner-company-panel,
.partner-company-room {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid rgba(24, 32, 41, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.partner-company-panel-head span,
.partner-company-room-head {
  display: grid;
  gap: 2px;
}

.partner-company-room-head {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
}

.partner-company-room-head span {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid rgba(29, 138, 104, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 243, 0.9));
}

.partner-company-room-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.partner-company-room-actions #partnerCompanyOfficeButton {
  margin-left: auto;
}

.partner-pending-panel small,
.partner-company-panel small,
.partner-company-room small,
.partner-company-room p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.partner-pending-panel strong,
.partner-company-panel strong,
.partner-company-room h3 {
  margin: 0;
}

.partner-company-room h3 {
  font-size: 1.22rem;
}

.partner-company-room-head p {
  line-height: 1.35;
}

.partner-company-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.partner-company-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 6px;
  background: rgba(248, 251, 253, 0.9);
}

.partner-company-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 6px 4px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.partner-company-link span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.partner-company-link strong,
.partner-company-link small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.partner-company-card.is-active {
  border-color: rgba(29, 138, 104, 0.55);
  background: rgba(29, 138, 104, 0.09);
}

.partner-company-room {
  border-left: 4px solid rgba(29, 138, 104, 0.52);
}

body.is-partner-company-page .partner-office-head,
body.is-partner-company-page .partner-office-compact,
body.is-partner-company-page .partner-admin-form,
body.is-partner-company-page .partner-pending-panel,
body.is-partner-company-page .partner-company-panel,
body.is-partner-company-page .partner-approval-list {
  display: none;
}

body.is-partner-company-page .partner-company-room {
  margin-top: 0;
  min-height: 360px;
  align-content: start;
}

.partner-company-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.partner-company-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid rgba(29, 138, 104, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  color: #1d7157;
  background: rgba(29, 138, 104, 0.09);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.partner-company-member-panel {
  display: grid;
  gap: 8px;
}

.partner-member-list {
  display: grid;
  gap: 8px;
}

.partner-company-member-panel.is-office-grid .partner-member-list {
  gap: 12px;
}

.partner-office-editor {
  border: 1px solid rgba(24, 32, 41, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.74);
}

.partner-office-editor-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}

.partner-office-editor-toggle::-webkit-details-marker {
  display: none;
}

.partner-office-editor-toggle span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.partner-office-editor-toggle b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(145deg, #14202b, #1d8a68);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.partner-office-editor-toggle em {
  font-style: normal;
}

.partner-office-editor .toggle-close,
.partner-office-editor[open] .toggle-open {
  display: none;
}

.partner-office-editor[open] .toggle-close {
  display: inline;
}

.partner-office-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(24, 32, 41, 0.08);
  padding: 10px 10px 0;
}

.partner-office-editor-head span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.partner-office-editor-head div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.partner-office-editor-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.partner-office-editor-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 36px;
  align-items: end;
  gap: 8px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 8px;
  background: rgba(248, 251, 253, 0.92);
}

.partner-office-editor-number {
  display: grid;
  width: 30px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #1d7157;
  background: rgba(29, 138, 104, 0.11);
  font-size: 0.8rem;
  font-weight: 900;
}

.partner-office-editor-row label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.partner-office-editor-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d2dc;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.partner-office-editor-row.is-detail-row {
  grid-template-columns: 30px minmax(0, 1fr);
}

.partner-office-editor-savebar {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(24, 32, 41, 0.08);
  padding: 0 10px 10px;
}

.partner-office-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.partner-office-tile {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  background: linear-gradient(135deg, #125a80, #22a6a1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 28px rgba(24, 32, 41, 0.1);
}

.partner-office-tile span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.partner-office-tile-1 {
  background: linear-gradient(135deg, #0f6a7c, #34c5a8);
}

.partner-office-tile-2 {
  background: linear-gradient(135deg, #4f6fb5, #67d2ee);
}

.partner-office-tile-3 {
  background: linear-gradient(135deg, #7357a8, #e099c9);
}

.partner-office-tile-4 {
  background: linear-gradient(135deg, #1f7a4f, #b6d76a);
}

.partner-office-tile-5 {
  background: linear-gradient(135deg, #7e6a2f, #f0c15a);
}

.partner-office-tile-6 {
  background: linear-gradient(135deg, #345c88, #9ab8ff);
}

.partner-office-tile-7 {
  background: linear-gradient(135deg, #2e7b72, #a6e6d2);
}

.partner-office-tile-8 {
  background: linear-gradient(135deg, #5e6472, #d6dee7);
}

.partner-office-blank-page {
  min-height: 240px;
  border: 1px dashed rgba(24, 32, 41, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.partner-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(248, 251, 253, 0.9);
}

.partner-member-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.partner-member-row strong,
.partner-member-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.partner-member-row small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.partner-member-row .compact-button {
  min-height: 32px;
  padding: 0 9px;
  color: #34404c;
  background: #eef3f7;
}

.partner-company-delete-zone {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(24, 32, 41, 0.1);
  padding-top: 8px;
}

.partner-company-delete-zone .compact-button {
  min-height: 36px;
  color: #34404c;
  background: #eef3f7;
}

.partner-approval-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.partner-approval-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 48px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 8px;
  background: rgba(248, 251, 253, 0.88);
}

.partner-company-block {
  border-left: 4px solid rgba(29, 138, 104, 0.52);
}

.partner-approval-row .compact-button {
  min-height: 34px;
  padding: 0 10px;
}

.partner-approval-row .compact-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.partner-approval-empty {
  border: 1px dashed rgba(24, 32, 41, 0.18);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

body.is-partner-office .lookup-panel,
body.is-partner-office .admin-panel,
body.is-partner-office .device-hero,
body.is-partner-office .tabs,
body.is-partner-office .tab-content {
  display: none;
}

.stock-panel,
.analytics-panel {
  display: block;
  margin: 18px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #f8fbfd;
}

.stock-panel[hidden],
.analytics-panel[hidden] {
  display: none !important;
}

body.is-stock-view .lookup-panel,
body.is-stock-view .device-hero,
body.is-stock-view .tabs,
body.is-stock-view .tab-content,
body.is-analytics-view .lookup-panel,
body.is-analytics-view .device-hero,
body.is-analytics-view .tabs,
body.is-analytics-view .tab-content {
  display: none;
}

.stock-head,
.stock-category-head,
.stock-device-head,
.analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stock-head h2,
.stock-category-head h3,
.stock-device-head h3,
.analytics-head h2 {
  margin-bottom: 4px;
}

.stock-head p,
.stock-device-head span,
.analytics-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.analytics-actions {
  display: flex;
  gap: 8px;
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analytics-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.analytics-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-stats strong {
  font-size: 1.2rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.analytics-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.analytics-recent-card {
  margin-top: 16px;
}

.analytics-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.analytics-card-head h3 {
  margin-bottom: 0;
}

.analytics-card-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.analytics-list {
  display: grid;
  gap: 9px;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbfd;
}

.analytics-row span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.analytics-row strong,
.analytics-row small,
.analytics-row b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.analytics-row small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-row b {
  color: var(--blue);
  font-size: 0.9rem;
}

.analytics-recent-row b {
  max-width: 180px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.analytics-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfdff;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.analytics-calendar {
  display: grid;
  gap: 10px;
}

.analytics-calendar-toolbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.analytics-calendar-toolbar strong {
  text-align: center;
  font-size: 1rem;
}

.analytics-calendar-toolbar .icon-button {
  width: 42px;
  height: 42px;
}

.analytics-calendar-toolbar .icon-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.analytics-weekdays,
.analytics-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 52px));
  gap: 6px;
  justify-content: center;
}

.analytics-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.analytics-day,
.analytics-day-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
}

.analytics-day {
  position: relative;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 3px;
  color: var(--ink);
  background: #f8fbfd;
  font-weight: 900;
}

.analytics-day span {
  font-size: 0.9rem;
  line-height: 1;
}

.analytics-day b {
  min-height: 12px;
  color: var(--blue);
  font-size: 0.62rem;
  line-height: 1;
}

.analytics-day.has-visits {
  border-color: rgba(23, 105, 170, 0.34);
  background: #eef7ff;
}

.analytics-day.is-today::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.analytics-day.is-selected {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.analytics-day.is-selected b {
  color: #fff;
}

.analytics-day.is-selected::after {
  background: #fff;
}

.analytics-selected-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid rgba(23, 105, 170, 0.18);
  border-radius: 8px;
  padding: 11px 12px;
  background: #eef7ff;
}

.analytics-selected-day span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.analytics-selected-day strong {
  color: var(--blue);
  font-size: 1.04rem;
}

.analytics-selected-day small,
.analytics-selected-day em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.analytics-selected-day em {
  grid-column: 1 / -1;
}

.analytics-calendar-empty {
  grid-column: 1 / -1;
}

.stock-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stock-category-card {
  display: grid;
  min-height: 104px;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  color: var(--ink);
  background: #fff;
  text-align: center;
  box-shadow: 0 10px 26px rgba(24, 32, 41, 0.05);
}

.stock-category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(23, 105, 170, 0.1);
}

.stock-category-card svg {
  width: 21px;
  height: 21px;
}

.stock-category-card strong {
  font-size: 0.98rem;
}

.stock-category-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.stock-category-card.is-active {
  border-color: var(--blue);
  background: #eef7ff;
}

.stock-category-panel,
.stock-device-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.stock-category-panel[hidden] {
  display: none !important;
}

.stock-category-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.stock-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stock-model-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: #f8fbfd;
}

.stock-model-card.is-active {
  border-color: var(--blue);
  background: #eef7ff;
}

.stock-model-thumb {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(23, 105, 170, 0.16);
  background:
    linear-gradient(145deg, rgba(23, 105, 170, 0.16), rgba(29, 113, 87, 0.12)),
    #f4f8fb;
  overflow: hidden;
}

.stock-model-thumb svg {
  width: 26px;
  height: 26px;
  color: #1769aa;
  stroke-width: 2.4;
}

.stock-model-card.is-active .stock-model-thumb {
  border-color: rgba(23, 105, 170, 0.35);
  background:
    linear-gradient(145deg, rgba(23, 105, 170, 0.22), rgba(29, 113, 87, 0.16)),
    #eef7ff;
}

.stock-model-card span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.stock-model-card strong,
.stock-model-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stock-model-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stock-model-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfdff;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.stock-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.stock-filter-bar button {
  min-height: 38px;
  border: 1px solid rgba(23, 105, 170, 0.18);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8fbfd;
  font-size: 0.84rem;
  font-weight: 900;
}

.stock-filter-bar button.is-active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.stock-filter-bar button.stock-filter-status.status-delivered:not(.is-active) {
  border-color: rgba(29, 113, 87, 0.22);
  color: #1d7157;
  background: rgba(29, 138, 104, 0.13);
}

.stock-filter-bar button.stock-filter-status.status-waiting:not(.is-active) {
  border-color: rgba(181, 107, 24, 0.22);
  color: #8a5a13;
  background: rgba(181, 107, 24, 0.14);
}

.stock-filter-bar button.stock-filter-status.status-preparing:not(.is-active) {
  border-color: rgba(23, 105, 170, 0.22);
  color: #1769aa;
  background: rgba(23, 105, 170, 0.13);
}

.stock-filter-bar button.stock-filter-status.status-preorder:not(.is-active) {
  border-color: rgba(102, 87, 184, 0.22);
  color: #6657b8;
  background: rgba(102, 87, 184, 0.14);
}

.stock-filter-bar button.stock-filter-status.status-delivered.is-active {
  border-color: #1d7157;
  background: #1d7157;
}

.stock-filter-bar button.stock-filter-status.status-waiting.is-active {
  border-color: #8a5a13;
  background: #8a5a13;
}

.stock-filter-bar button.stock-filter-status.status-preparing.is-active {
  border-color: #1769aa;
  background: #1769aa;
}

.stock-filter-bar button.stock-filter-status.status-preorder.is-active {
  border-color: #6657b8;
  background: #6657b8;
}

.stock-device-section .quick-list {
  display: grid;
  padding: 14px 0 0;
}

.admin-section {
  display: none;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

body.is-admin.has-device .admin-section {
  display: block;
}

.admin-section-head {
  margin-bottom: 12px;
}

.admin-section-head h3 {
  margin-bottom: 0;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.section-save-button {
  min-height: 46px;
  justify-self: stretch;
}

.admin-form label,
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid #c7d2dc;
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.login-card .remember-login-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 2px;
  color: #4c5a66;
  font-size: 0.82rem;
  font-weight: 900;
}

.login-card .remember-login-row input {
  width: 16px;
  height: 16px;
  accent-color: #1d8a68;
}

.admin-form textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-list-box {
  display: grid;
  gap: 10px;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.compact-button {
  min-height: 38px;
  padding: 0 11px;
  white-space: nowrap;
}

.admin-list-editor {
  display: grid;
  gap: 10px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 0.82fr) minmax(0, 1.18fr) 44px;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfd;
}

.admin-list-item-icon {
  display: grid;
  width: 34px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
}

.admin-list-item-icon svg {
  width: 18px;
  height: 18px;
}

.admin-list-item label {
  min-width: 0;
}

.admin-list-item textarea {
  min-height: 40px;
}

.remove-list-button {
  width: 40px;
  height: 40px;
  color: #6a7580;
  background: #fff;
}

.full-field {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 32, 41, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 32, 41, 0.24);
}

.login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.login-head h2 {
  margin-bottom: 0;
}

.full-button {
  width: 100%;
  margin-top: 12px;
}

.login-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.video-player-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 32, 41, 0.24);
}

.video-frame-shell {
  display: grid;
  min-height: 220px;
  overflow: hidden;
  border-radius: 8px;
  background: #111923;
}

.video-frame-shell iframe,
.video-frame-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border: 0;
  background: #111923;
}

.video-link-fallback {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 22px;
  color: #fff;
  text-align: center;
}

.video-link-fallback p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.device-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  gap: 22px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.device-image {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 8px;
  background: #dce4ec;
}

.device-image img,
.video-preview img,
.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verified-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 10px;
  color: #fff;
  background: rgba(29, 138, 104, 0.92);
  font-size: 0.78rem;
  font-weight: 900;
}

.verified-pill svg,
.play-button svg,
.icon-button svg,
.search-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.device-summary {
  align-self: center;
}

.device-summary h2 {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 3.05rem);
}

.summary-grid,
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-grid div,
.spec-item {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.summary-grid span,
.spec-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-grid strong,
.spec-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.spec-item-copy {
  display: grid;
  gap: 8px;
}

.copy-tracking-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  gap: 6px;
  border: 1px solid rgba(23, 105, 170, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  color: #1769aa;
  background: #eef7ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.copy-tracking-button svg {
  width: 16px;
  height: 16px;
}

.copy-tracking-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.warranty-card {
  margin-top: 12px;
  border: 1px solid rgba(29, 113, 87, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fcfa 0%, #ffffff 100%);
}

.warranty-card[hidden] {
  display: none;
}

.warranty-card summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.warranty-card summary::-webkit-details-marker {
  display: none;
}

.warranty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #1d7157;
  background: rgba(29, 138, 104, 0.12);
}

.warranty-icon svg {
  width: 21px;
  height: 21px;
}

.warranty-summary-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.warranty-summary-copy small {
  color: #1d7157;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.warranty-summary-copy strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.warranty-summary-copy em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

.warranty-read-more {
  border: 1px solid rgba(29, 113, 87, 0.22);
  border-radius: 999px;
  padding: 7px 9px;
  color: #1d7157;
  background: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.warranty-card[open] .warranty-read-more {
  color: #fff;
  background: #1d7157;
}

.warranty-detail {
  border-top: 1px solid rgba(29, 113, 87, 0.16);
  padding: 0 12px 12px 64px;
}

.warranty-detail ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #33404b;
  line-height: 1.5;
}

.warranty-detail li::marker {
  color: #1d7157;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
}

.tab-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.mobile-break {
  display: inline;
}

.tab-button.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.tab-content {
  display: none;
  padding: 18px;
  scroll-margin-top: 90px;
}

.tab-content.is-active {
  display: block;
}

.info-band,
.note-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.info-band h3,
.note-box p {
  margin: 0;
}

.grade-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--violet);
  background: rgba(102, 87, 184, 0.12);
  font-size: 0.82rem;
  font-weight: 900;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.check-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.check-item svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--blue);
}

.check-item strong {
  display: block;
  margin-bottom: 4px;
}

.check-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.video-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #dbe4ed;
}

.video-link-grid {
  display: grid;
  gap: 12px;
}

.condition-video-grid {
  margin-bottom: 12px;
}

.video-link-card {
  position: relative;
  display: block;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: #182029;
  text-decoration: none;
}

.video-link-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(24, 32, 41, 0.08), rgba(24, 32, 41, 0.78));
}

.video-link-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.video-link-card.is-disabled {
  cursor: not-allowed;
}

.video-link-card.is-disabled img {
  filter: grayscale(1);
  opacity: 0.72;
}

.video-play-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 32, 41, 0.86);
}

.video-play-badge svg {
  width: 22px;
  height: 22px;
}

.video-card-copy {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  display: grid;
  gap: 4px;
}

.video-card-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  text-transform: uppercase;
}

.video-card-copy strong {
  font-size: 1.2rem;
}

.video-card-copy em {
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
  line-height: 1.35;
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 32, 41, 0.86);
  transform: translate(-50%, -50%);
}

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

.note-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--surface-2);
}

.note-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.photo-card figure {
  margin: 0;
}

.photo-card img {
  aspect-ratio: 4 / 3;
}

.photo-card figcaption {
  padding: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.note-box {
  align-items: flex-start;
}

.note-box strong {
  display: block;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  min-width: min(340px, calc(100% - 32px));
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(24, 32, 41, 0.94);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 981px) {
  body {
    background:
      linear-gradient(180deg, rgba(232, 239, 246, 0.92) 0, rgba(246, 248, 250, 0.98) 440px),
      linear-gradient(135deg, rgba(23, 105, 170, 0.14), transparent 42%),
      linear-gradient(315deg, rgba(29, 138, 104, 0.11), transparent 36%),
      var(--paper);
  }

  .app-shell {
    width: min(1180px, calc(100% - 48px));
    padding: 28px 0 42px;
  }

  .topbar {
    min-height: 76px;
    margin-bottom: 18px;
    border: 1px solid rgba(217, 224, 231, 0.86);
    border-radius: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 42px rgba(24, 32, 41, 0.08);
    backdrop-filter: blur(16px);
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    box-shadow: 0 12px 24px rgba(23, 105, 170, 0.22);
    font-size: 1.08rem;
  }

  h1 {
    font-size: 1.68rem;
  }

  .admin-login-button {
    min-width: 142px;
    border-color: rgba(199, 210, 220, 0.9);
    box-shadow: 0 8px 18px rgba(24, 32, 41, 0.06);
  }

  .detail-panel {
    border-color: rgba(199, 210, 220, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(24, 32, 41, 0.12);
  }

  .lookup-panel {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fbfdff;
  }

  .search-area {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(460px, 1.2fr);
    align-items: end;
    gap: 22px;
    padding: 24px 26px;
  }

  .search-area h2 {
    margin-bottom: 0;
  }

  .search-box {
    min-height: 58px;
    border-color: #bac8d4;
    box-shadow: 0 10px 28px rgba(24, 32, 41, 0.06);
  }

  .status-line {
    grid-column: 2;
    margin-top: -12px;
  }

  body.is-admin .quick-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 16px 26px 18px;
  }

  .quick-card {
    min-height: 96px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(24, 32, 41, 0.05);
  }

  .quick-card.is-active {
    box-shadow: 0 12px 32px rgba(23, 105, 170, 0.13);
  }

  .quick-select-button {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .quick-status {
    grid-column: 2;
    justify-self: start;
    margin-top: 5px;
  }

  .owner-strip {
    padding: 18px 26px;
    background: #f3f7fb;
  }

  .admin-panel {
    margin: 18px 26px 0;
    padding: 16px 18px;
    background: #f8fbfd;
  }

  .device-hero {
    grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
    gap: 30px;
    padding: 28px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  }

  .device-image {
    min-height: 420px;
    box-shadow: 0 22px 48px rgba(24, 32, 41, 0.12);
  }

  .device-summary h2 {
    margin-bottom: 20px;
    font-size: clamp(2.35rem, 1.9rem + 1.6vw, 3.4rem);
  }

  .summary-grid {
    gap: 12px;
  }

  .summary-grid div {
    min-height: 92px;
    padding: 16px;
    box-shadow: 0 8px 18px rgba(24, 32, 41, 0.04);
  }

  .tabs {
    justify-content: center;
    gap: 10px;
    padding: 16px 26px;
    background: #ffffff;
  }

  .tab-button {
    min-width: 150px;
    border-radius: 8px;
  }

  .tab-content {
    padding: 26px;
  }

  .info-band {
    min-height: 76px;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: #f8fbfd;
  }

  .spec-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .spec-item {
    min-height: 92px;
    padding: 16px;
  }

  .warranty-card {
    margin-top: 16px;
  }

  .checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .check-item {
    min-height: 82px;
    padding: 15px;
  }

  .video-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .condition-video-grid {
    grid-template-columns: minmax(0, 0.62fr);
  }

  .video-link-card,
  .video-link-card img {
    min-height: 270px;
  }

  #notes.is-active {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
    gap: 16px;
  }

  #notes .admin-section {
    grid-column: 1 / -1;
  }

  .note-photo {
    margin-bottom: 0;
  }

  .note-photo img {
    min-height: 320px;
  }

  .note-box {
    min-height: 320px;
    padding: 18px;
  }
}

@media (max-width: 980px) {
  .workspace,
  .device-hero {
    grid-template-columns: 1fr;
  }

  .analytics-stats,
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lookup-panel {
    position: static;
  }

  .device-image {
    min-height: 280px;
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(180deg, #eef4fa 0, #f7f9fb 320px),
      var(--paper);
  }

  .app-shell {
    padding: 10px 10px calc(176px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    align-items: center;
    min-height: 64px;
    margin: -10px -10px 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(217, 224, 231, 0.85);
    background: rgba(246, 248, 250, 0.92);
    backdrop-filter: blur(14px);
  }

  .brand-block {
    gap: 10px;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .admin-login-button {
    min-width: 96px;
    min-height: 40px;
    padding: 5px 8px;
    font-size: 0.86rem;
  }

  .admin-login-button small {
    font-size: 0.58rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .eyebrow {
    font-size: 0.64rem;
  }

  h1 {
    font-size: 1.08rem;
  }

  h2 {
    font-size: 1.28rem;
  }

  .icon-button {
    width: 42px;
    height: 42px;
    background: #fff;
  }

  .workspace {
    gap: 12px;
  }

  .lookup-panel,
  .detail-panel {
    box-shadow: 0 10px 28px rgba(24, 32, 41, 0.1);
  }

  .admin-panel {
    margin: 0 12px 12px;
    padding: 14px;
  }

  .stock-panel,
  .analytics-panel {
    margin: 0 12px 12px;
    padding: 14px;
  }

  .stock-head,
  .stock-category-head,
  .stock-device-head,
  .analytics-head {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .analytics-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .analytics-card {
    padding: 12px;
  }

  .analytics-card-head {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .analytics-card-head span {
    text-align: left;
  }

  .analytics-recent-row {
    grid-template-columns: 1fr;
  }

  .analytics-recent-row b {
    max-width: none;
    text-align: left;
  }

  .stock-category-grid {
    gap: 10px;
  }

  .stock-category-card {
    min-height: 96px;
    padding: 12px 8px;
  }

  .stock-model-grid {
    grid-template-columns: 1fr;
  }

  .stock-filter-bar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  .stock-filter-bar button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .admin-panel-head,
  .admin-toolbar,
  .partner-toolbar,
  .partner-office-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions,
  .partner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .partner-actions {
    grid-template-columns: 1fr;
  }

  .partner-actions,
  .partner-office-button,
  .partner-office-head .secondary-button {
    width: 100%;
  }

  .partner-admin-form {
    grid-template-columns: 1fr 1fr;
  }

  .partner-company-room-head {
    grid-template-columns: 1fr;
  }

  .partner-company-room-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .partner-company-room-head .secondary-button {
    width: 100%;
  }

  .partner-company-member-panel.is-office-grid .partner-member-list {
    gap: 10px;
  }

  .partner-office-editor-head {
    grid-template-columns: 1fr;
  }

  .partner-office-editor-toggle {
    grid-template-columns: 1fr;
  }

  .partner-office-editor-toggle b {
    width: 100%;
  }

  .partner-office-editor-head div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .partner-office-editor-row {
    grid-template-columns: 26px minmax(0, 1fr) 36px;
  }

  .partner-office-editor-row label:first-of-type {
    grid-column: 2 / 3;
  }

  .partner-office-editor-row label:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .partner-office-editor-row .icon-button {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
  }

  .partner-office-editor-row.is-detail-row {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .partner-office-editor-row.is-detail-row label:first-of-type {
    grid-column: 2 / -1;
  }

  .partner-office-editor-savebar {
    display: grid;
  }

  .partner-office-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .partner-office-tile {
    min-height: 92px;
  }

  .partner-admin-form label:first-child,
  .partner-admin-form button {
    grid-column: 1 / -1;
  }

  .partner-approval-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .partner-approval-row .compact-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .admin-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-list-head {
    align-items: stretch;
  }

  .admin-list-item {
    grid-template-columns: 32px minmax(0, 1fr) 40px;
  }

  .admin-list-item label:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .remove-list-button {
    width: 40px;
    height: 38px;
  }

  .admin-section {
    margin-top: 14px;
    padding-top: 12px;
  }

  .search-area {
    padding: 14px;
  }

  .search-box {
    grid-template-columns: 22px minmax(0, 1fr) 92px;
    min-height: 56px;
    gap: 8px;
    padding: 6px;
  }

  .search-box button {
    width: auto;
    min-height: 42px;
    padding: 0 10px;
  }

  .status-line {
    min-height: 18px;
    margin-top: 8px;
    font-size: 0.78rem;
  }

  .quick-list {
    display: none;
    overflow-x: visible;
    gap: 10px;
    padding: 12px 14px 14px;
    scroll-snap-type: none;
  }

  body.is-admin .quick-list {
    display: grid;
  }

  .quick-list::-webkit-scrollbar {
    display: none;
  }

  .quick-card {
    grid-template-columns: minmax(0, 1fr) 48px;
    min-height: 78px;
    gap: 8px;
    padding: 8px;
    scroll-snap-align: none;
  }

  .quick-select-button {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .quick-status {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }

  .quick-delete-button {
    min-width: 46px;
    min-height: 58px;
  }

  .warranty-card summary {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    min-height: 0;
    padding: 11px;
  }

  .warranty-icon {
    width: 38px;
    height: 38px;
  }

  .warranty-read-more {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }

  .warranty-detail {
    padding: 0 12px 12px 58px;
  }

  .phone-thumb {
    width: 52px;
    height: 56px;
  }

  .quick-title {
    font-size: 0.98rem;
  }

  .quick-meta {
    font-size: 0.78rem;
  }

  .owner-strip {
    align-items: center;
    flex-direction: row;
    padding: 12px 14px;
  }

  .mini-stats {
    display: flex;
    gap: 12px;
    justify-items: start;
  }

  .device-hero {
    gap: 12px;
    padding: 12px;
    border-bottom: 0;
  }

  .device-summary {
    order: -1;
  }

  .device-summary h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
  }

  .device-image {
    min-height: 0;
    aspect-ratio: 16 / 11;
  }

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

  .summary-grid div {
    min-height: 70px;
    padding: 10px;
  }

  .summary-grid span,
  .spec-item span {
    font-size: 0.72rem;
  }

  .summary-grid strong,
  .spec-item strong {
    font-size: 0.94rem;
  }

  .tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(199, 210, 220, 0.95);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: none;
    backdrop-filter: blur(16px);
  }

  body:not(.has-device) .tabs {
    grid-template-columns: 1fr;
  }

  body.is-admin .app-shell {
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }

  body.is-admin .tabs {
    position: fixed;
    margin: 0;
    box-shadow: none;
  }

  .tab-button {
    flex-direction: column;
    min-width: 0;
    min-height: 60px;
    gap: 3px;
    border-radius: 8px;
    padding: 6px 4px;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: normal;
  }

  .tab-label {
    display: block;
    max-width: 100%;
    line-height: 1.12;
  }

  .mobile-break {
    display: block;
  }

  .tab-button svg {
    width: 20px;
    height: 20px;
  }

  .tab-content {
    padding: 0 12px 14px;
  }

  .info-band,
  .note-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
  }

  .spec-grid,
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .spec-item {
    min-height: 68px;
    padding: 11px;
  }

  .checklist {
    gap: 8px;
    margin-top: 12px;
  }

  .check-item {
    grid-template-columns: 22px minmax(0, 1fr);
    min-height: 0;
    gap: 9px;
    padding: 12px;
  }

  .check-item p {
    font-size: 0.88rem;
  }

  .play-button {
    width: 58px;
    height: 58px;
  }

  .video-link-card,
  .video-link-card img {
    min-height: 190px;
  }

  .video-card-copy strong {
    font-size: 1.05rem;
  }

  .photo-card figcaption {
    font-size: 0.8rem;
  }

  .toast {
    bottom: calc(168px + env(safe-area-inset-bottom));
    min-width: calc(100% - 28px);
  }

  body.is-admin .toast {
    bottom: 18px;
  }

  .grade-badge {
    padding: 7px 9px;
    font-size: 0.78rem;
  }
}

@media (max-width: 430px) {
  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .brand-block,
  .top-actions {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-login-button {
    min-width: 0;
  }

  .partner-admin-form {
    grid-template-columns: 1fr;
  }

  .partner-admin-form label:first-child,
  .partner-admin-form button {
    grid-column: auto;
  }
}

@media print {
  body {
    background: #fff;
  }

  .lookup-panel,
  .top-actions,
  .tabs,
  .toast {
    display: none;
  }

  .app-shell {
    padding: 0;
  }

  .workspace,
  .device-hero {
    display: block;
  }

  .detail-panel {
    box-shadow: none;
  }

  .tab-content {
    display: block;
    break-inside: avoid;
  }
}
