/* =====================================================================
   Mobile Preview — feuille de styles
   ===================================================================== */

:root {
  --bg: #0b0d12;
  --panel: #12151d;
  --panel-2: #1a1f2b;
  --panel-3: #232936;
  --line: #262d3c;
  --text: #e9edf5;
  --muted: #8c95a8;
  --accent: #4f8cff;
  --accent-2: #7a5cff;
  --warn: #f0b429;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 78% -12%, #1c2440 0%, rgba(11, 13, 18, 0) 62%),
    radial-gradient(900px 600px at 0% 110%, #1a1630 0%, rgba(11, 13, 18, 0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== barre supérieure ============================================== */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 22, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.logo {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 5px 16px rgba(79, 140, 255, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-title { font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.urlbar { flex: 1 1 auto; display: flex; gap: 8px; min-width: 0; }

.field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  transition: border-color .15s, box-shadow .15s;
}

.field:focus-within {
  border-color: rgba(79, 140, 255, .6);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .12);
}

.field-icon { flex: 0 0 auto; color: var(--muted); }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.field input::placeholder { color: #5f6879; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
}

.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(140deg, var(--accent), #3f6fe0);
  color: #fff;
  box-shadow: 0 7px 18px rgba(79, 140, 255, .28);
}

.btn.primary:hover { background: linear-gradient(140deg, #5c95ff, #4877e8); }

.btn.small { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }

.btn[aria-pressed="true"] {
  border-color: rgba(79, 140, 255, .6);
  background: rgba(79, 140, 255, .16);
}

/* ===== mise en page ================================================= */

.layout { flex: 1 1 auto; display: flex; min-height: 0; }

.panel {
  flex: 0 0 272px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(18, 21, 29, .72);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section h2 {
  margin: 0 0 9px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.section-head h2 { margin: 0; }

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.linkbtn:hover { color: var(--text); }

.device-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.device-btn {
  text-align: left;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.device-btn:hover { background: var(--panel-3); }

.device-btn strong { display: block; font-size: 12px; font-weight: 600; }
.device-btn span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }

.device-btn[aria-pressed="true"] {
  border-color: rgba(79, 140, 255, .65);
  background: rgba(79, 140, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, .35);
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row + .row { margin-top: 9px; }
.row > label { font-size: 12px; color: var(--muted); }

select,
input[type="number"] {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: 0;
}

select { max-width: 152px; cursor: pointer; }

select:focus,
input[type="number"]:focus { border-color: rgba(79, 140, 255, .6); }

option { background: var(--panel-2); color: var(--text); }

.sizefields { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.sizefields input { width: 62px; text-align: center; }

.note {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(79, 140, 255, .22);
  border-radius: 10px;
  background: rgba(79, 140, 255, .07);
  color: #a9bdd9;
  font-size: 11.5px;
  line-height: 1.5;
}

.note.warn {
  border-color: rgba(240, 180, 41, .3);
  background: rgba(240, 180, 41, .09);
  color: #e9c479;
}

.note:empty { display: none; }

.empty { margin: 0; font-size: 11.5px; color: #6b7485; line-height: 1.5; }

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history button {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.history button:hover { background: var(--panel-2); color: var(--text); }

/* ===== scène ======================================================== */

.stage {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  padding: 24px 28px 56px;
  overflow: auto;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 22px 22px;
}

.fit { position: relative; flex: 0 0 auto; margin: auto; }

.device {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  background: #05070b;
  border-radius: 44px;
  overflow: hidden;
  box-shadow:
    0 0 0 11px #0a0d14,
    0 0 0 13px #3a4356,
    0 0 0 14px #0a0d14,
    0 28px 70px rgba(0, 0, 0, .6);
}

.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
  border-radius: inherit;
}

.screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.notch {
  position: absolute;
  z-index: 3;
  background: #05070b;
  pointer-events: none;
}

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  background: linear-gradient(165deg, #12161f, #0a0c11);
  color: var(--muted);
}

.ph-icon { color: #4a5468; margin-bottom: 2px; }
.ph-title { color: var(--text); font-size: 14px; font-weight: 600; }
.ph-text { font-size: 12px; line-height: 1.5; max-width: 230px; }

.stagebar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 21, 29, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== petits écrans ================================================ */

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand-sub { display: none; }
  .urlbar { order: 3; flex-basis: 100%; }

  .layout { flex-direction: column; }

  .stage {
    order: 1;
    padding: 14px 14px 46px;
    min-height: 46vh;
  }

  .panel {
    order: 2;
    flex: 0 0 auto;
    border-right: 0;
    border-top: 1px solid var(--line);
    max-height: 44vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

