/* === 产品记录工具 · 现代极简主题 ============================== */

:root {
  color-scheme: light;

  /* Surface */
  --page: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-quiet: #f9fafb;

  /* Lines */
  --line: #e5e7eb;
  --line-strong: #d4d8e0;
  --line-soft: #eef1f6;

  /* Text */
  --text: #0f172a;
  --text-2: #1f2937;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --muted-3: #cbd5e1;

  /* Brand */
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --brand-line: #c7d2fe;

  /* Semantic */
  --green: #047857;
  --green-soft: #ecfdf5;
  --green-line: #a7f3d0;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-line: #fde68a;
  --amber-strong: #d97706;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-line: #fecaca;

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 4px rgba(79, 70, 229, 0.18);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family:
    "Inter",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans CJK SC",
    "Source Han Sans SC",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; user-select: none; background: transparent; }
a { color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

/* === Layout shell ================================================ */

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

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sticky top bar */
.top-actions-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -24px 6px;
  padding: 12px 24px;
  background: rgba(246, 247, 251, 0.85);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.top-actions-shell::before {
  content: "产品编号事件记录";
  margin-right: auto;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-panel { display: none; }

/* === Buttons ===================================================== */

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.primary-button {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}
.primary-button:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}
.primary-button:active { transform: translateY(0.5px); }
.primary-button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.ghost-button {
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--line-strong);
}
.ghost-button:hover {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-strong);
}
.ghost-button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.danger-button {
  color: var(--red);
  background: #fff;
  border: 1px solid var(--red-line);
}
.danger-button:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.icon-button {
  width: 38px;
  padding: 0;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 20px;
}
.icon-button:hover {
  color: var(--text);
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

/* Compact picker — used as tab/chip in mode-bar and inline composer */
.compact-picker {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
}
.compact-picker.is-active,
.category-chip.is-active {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
  box-shadow: none;
}
.compact-picker.is-active:hover { background: var(--text-2); border-color: var(--text-2); color: #fff; }

/* primary-button on small composer submit */
.primary-button.compact-submit {
  min-height: 36px;
  padding: 7px 16px;
  font-size: 14px;
}

/* === Inputs ====================================================== */

.text-input,
.text-area {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.text-input::placeholder,
.text-area::placeholder { color: var(--muted-2); }

.text-input:focus,
.text-area:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.text-area {
  min-height: 140px;
  resize: vertical;
  line-height: 1.65;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* === Mode bar (category tabs) ===================================== */

.mode-bar { display: block; }

.mode-bar-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  width: fit-content;
  max-width: 100%;
}

.mode-bar-shell .ghost-button.compact-picker {
  min-height: 30px;
  padding: 5px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.mode-bar-shell .ghost-button.compact-picker:hover {
  background: var(--panel-soft);
  color: var(--text);
  border-color: transparent;
}
.mode-bar-shell .ghost-button.compact-picker.is-active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

/* === Attention filter chip ======================================= */

.attention-filter-bar { display: flex; }

.attention-filter-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.attention-filter-card:hover {
  border-color: var(--amber-line);
  color: var(--amber);
  background: var(--amber-soft);
}
.attention-filter-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-line);
  font-size: 12px;
  font-weight: 700;
}
.attention-filter-card.is-active {
  color: #fff;
  background: var(--amber-strong);
  border-color: var(--amber-strong);
}
.attention-filter-card.is-active strong {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: transparent;
}

/* === Cards / panels ============================================== */

.list-tools-card,
.detail-card,
.composer-panel,
.timeline-panel,
.excel-module,
.empty-state,
.modal-form,
.lightbox-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.list-tools-card { padding: 16px 18px; }

.list-tools-head,
.timeline-header,
.event-card-header,
.upload-heading,
.modal-header,
.modal-actions,
.manage-panel-head,
.excel-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}
.list-tool { display: block; flex: 1 1 280px; max-width: 480px; }

.search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.search-input { flex: 1 1 auto; width: auto; min-width: 0; }
.search-button { flex: 0 0 auto; min-width: 72px; }

/* === Count chip + pills ========================================== */

.count-chip,
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.count-chip {
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-weight: 500;
}
.badge {
  color: var(--text-2);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.status-pill {
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.status-pill.pending {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-line);
}
.status-pill.resolved {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-line);
}

/* === Copy ======================================================== */

.workspace-copy,
.muted-copy,
.empty-state p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.detail-content { margin-top: 14px; }

.catalog-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* === Product browser grid ======================================== */

.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.browser-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.browser-card:hover {
  border-color: var(--brand-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.browser-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 6px;
}

.browser-card-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  font-size: 11px;
  font-weight: 600;
}

.product-title-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  text-decoration: none;
}

.browser-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.browser-cover img,
.detail-product-cover img,
.image-card img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  background: #fff;
  margin: 5%;
}

.lightbox-shell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.browser-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.browser-card-text { margin-top: 10px; }

.edit-overlay-link {
  display: inline-flex;
  position: absolute;
  right: 8px;
  bottom: 8px;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.browser-card:hover .edit-overlay-link,
.edit-overlay-link:focus-visible {
  opacity: 1;
}
.edit-overlay-link:hover {
  background: #fff;
  border-color: var(--brand-line);
  color: var(--brand-strong);
}

.product-item-code,
.detail-product-code {
  overflow: hidden;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  letter-spacing: -0.01em;
}
.product-item-code { font-size: 14px; }

.product-item-name,
.detail-product-name {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.product-title-link:hover .product-item-code,
.product-title-link:hover .product-item-name {
  color: var(--brand-strong);
}

/* === Detail page ================================================== */

.detail-flow {
  display: grid;
  gap: 16px;
}

.detail-product-strip {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.compact-detail-strip { grid-template-columns: 92px minmax(0, 1fr); }

.detail-product-cover {
  display: block;
  width: 92px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.detail-product-code {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.detail-product-name { font-size: 14px; }

/* === Composer + timeline panels =================================== */

.composer-panel,
.timeline-panel,
.detail-card { padding: 18px; }

.composer-panel {
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.composer-panel:focus-within {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.composer-form, .manage-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.composer-form { gap: 14px; }

.composer-panel .timeline-header { margin-bottom: 6px; }

.category-picker,
.composer-inline-actions,
.due-shortcuts,
.button-row,
.reply-actions,
.event-images,
.image-grid,
.excel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer-inline-actions, .reply-actions { justify-content: flex-start; }

.due-date-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-quiet);
}
.due-date-field { flex: 0 1 280px; }
.due-input { min-width: 220px; }

.image-url-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 8px;
  margin-top: 8px;
  justify-content: start;
}
.compact-url-row { margin-top: 0; }

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.secondary-list, .secondary-grid { margin-top: 12px; }

.collapsed-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-quiet);
}
.collapsed-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.collapsed-panel summary::-webkit-details-marker { display: none; }
.collapsed-panel summary::before {
  content: "▸ ";
  color: var(--muted-2);
  margin-right: 4px;
}
.collapsed-panel[open] summary::before { content: "▾ "; }

/* === Event cards ================================================== */

.event-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 22px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.event-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { border-color: var(--line-strong); }

.reply-card { background: var(--panel-quiet); }

.event-card-header { align-items: flex-start; }

.event-meta,
.event-category-line {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.event-category-line {
  display: none; /* category is already shown as a badge below */
}

.event-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.event-deadline {
  margin-bottom: 10px;
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 600;
}

.event-body {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.7;
  font-size: 14.5px;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 22px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-quiet);
}
.reply-text-area { min-height: 96px; }

.reply-badge {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

/* === Image grid =================================================== */

.image-grid { margin-top: 8px; }
.compact-image-grid { margin-top: 0; }

.image-card {
  position: relative;
  width: 120px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.image-card button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease;
}
.image-card button:hover { background: rgba(220, 38, 38, 0.92); }
.image-card-caption {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
  font-size: 11px;
}

.link-button {
  color: var(--brand-strong);
  font-weight: 600;
  text-decoration: none;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.small-link { font-size: 12px; }

/* === Empty / loading ============================================== */

.empty-state {
  padding: 56px 28px;
  text-align: center;
}
.empty-state h3 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}
.empty-state p { margin-bottom: 16px; }
.empty-state .primary-button { margin: 0 auto; }

.loading-state {
  min-height: 200px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13.5px;
}
.loading-dot {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: loading-spin 0.85s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* === Excel module ================================================== */

.excel-module { padding: 16px 18px; }
.excel-module-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.excel-module-head > div:first-child { flex: 1 1 240px; }

/* === Forms ======================================================== */

.detail-card.manage-panel { padding: 22px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label:nth-child(3) { grid-column: 1 / -1; }

.upload-block {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-quiet);
}

.grow { flex: 1; }
.hidden { display: none !important; }

/* === Modal / dialog =============================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.modal-form {
  width: min(720px, calc(100vw - 32px));
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}

.lightbox {
  width: min(1020px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}
.lightbox::backdrop,
.modal::backdrop { background: rgba(15, 23, 42, 0.55); }

.lightbox-shell {
  position: relative;
  padding: 16px 16px 24px;
  border-radius: var(--radius-xl);
}
.lightbox-shell img {
  display: block;
  max-height: 76vh;
  border-radius: var(--radius-md);
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* === Detail-view view-mode tweaks ================================= */

body[data-view="detail"] .list-tools-card {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
body[data-view="detail"] .list-tools-head,
body[data-view="detail"] .list-tools-grid { display: none; }
body[data-view="detail"] #newProductButton,
body[data-view="detail"] .excel-module { display: none; }
body[data-view="detail"] .attention-filter-bar { display: none; }

/* === Responsive =================================================== */

@media (max-width: 760px) {
  .app-shell { padding: 8px 14px 36px; }

  .top-actions-shell {
    margin: 0 -14px 4px;
    padding: 10px 14px;
  }
  .top-actions-shell::before { font-size: 14px; }

  .workspace { gap: 12px; }

  .search-row,
  .list-tools-grid,
  .due-date-panel,
  .modal-actions,
  .manage-panel-head,
  .timeline-header,
  .event-card-header,
  .excel-module-head {
    flex-direction: column;
    align-items: stretch;
  }
  .event-card-header { gap: 10px; }
  .search-input { width: 100%; }

  .browser-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .detail-product-strip,
  .compact-detail-strip {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }
  .detail-product-cover { width: 72px; }
  .detail-product-code { font-size: 18px; }

  .composer-inline-actions,
  .reply-actions { justify-content: flex-start; }

  .image-url-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-card { width: 96px; }

  .composer-panel,
  .timeline-panel,
  .detail-card,
  .list-tools-card,
  .excel-module {
    padding: 14px;
  }

  .modal-form { padding: 16px; }

  .edit-overlay-link { opacity: 1; } /* touch devices need it visible */
}

@media (max-width: 520px) {
  .top-actions-shell::before { display: none; }

  .primary-button,
  .ghost-button,
  .danger-button { width: 100%; }
  .top-actions-shell .ghost-button,
  .top-actions-shell .primary-button,
  .top-actions-shell .icon-button,
  .mode-bar-shell .ghost-button,
  .button-row .ghost-button,
  .button-row .primary-button,
  .composer-inline-actions .ghost-button,
  .due-shortcuts .ghost-button,
  .reply-actions .ghost-button,
  .reply-actions .primary-button,
  .category-picker .ghost-button { width: auto; }

  .button-row .primary-button.compact-submit { width: 100%; }
}
