:root {
  color-scheme: light;
  --bg: #e9eef2;
  --bg-2: #f3f7fa;
  --panel: #f8fbfe;
  --panel-deep: #eef4f8;
  --ink: #1e2a33;
  --muted: #5b6770;
  --line: #d2dbe3;
  --accent: #2aa9e0;
  --accent-2: #5fc1a6;
  --accent-3: #f2c04b;
  --shadow: 0 10px 22px rgba(30, 40, 50, 0.12);
  --shadow-soft: 0 6px 14px rgba(30, 40, 50, 0.08);
  --menu-rgba: rgba(174, 195, 255, 0.2);
  --menu-strong-rgba: rgba(174, 195, 255, 0.35);
  --menu-blur: 0px;
  --dots-opacity: 0;
}

.status-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 20, 27, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.phone.text-light .status-pill {
  background: rgba(255, 255, 255, 0.65);
  color: #1d2630;
  border-color: rgba(0, 0, 0, 0.1);
}

.status-date {
  opacity: 0.8;
}

.status-battery {
  width: 20px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 1px;
}

.status-battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 2px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}

.status-battery-level {
  height: 100%;
  width: 80%;
  background: currentColor;
  border-radius: 1px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: linear-gradient(rgba(90, 105, 120, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 105, 120, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 28px clamp(16px, 4vw, 44px) 60px;
}

h3 {
  font-family: "M PLUS Rounded 1c", "IBM Plex Sans", sans-serif;
  margin: 0;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.system-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 64px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(140deg, #dff2ff, #c9e8f9);
  border: 1px solid rgba(42, 169, 224, 0.35);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1f5c76;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.brand-title {
  font-family: "M PLUS Rounded 1c", "IBM Plex Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
}

.system-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30, 40, 50, 0.12);
}

.chip.ghost {
  background: transparent;
}

.chip.small {
  padding: 6px 12px;
  font-size: 12px;
}

.file-chip {
  position: relative;
  overflow: hidden;
}

.file-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.system-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.control-stack,
.preview-stack {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 16px 20px 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.card-head h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #32424f;
}

.card-hint {
  font-size: 12px;
  color: var(--muted);
}

.card-body {
  padding: 16px 20px 20px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 600;
  font-size: 14px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: center;
}

input[type="text"],
input[type="number"],
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: linear-gradient(180deg, #ffffff, #f3f7fa);
  color: var(--ink);
}

input:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

input[type="color"] {
  height: 44px;
  border: none;
  background: transparent;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #344452;
}

.file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff, #f1f5f8);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.file input {
  display: none;
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

.icons-list {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.icon-row img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}

.icon-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: linear-gradient(180deg, #f6f9fc, #edf2f6);
  border: 1px dashed var(--line);
}

.icon-meta {
  font-size: 12px;
  color: var(--muted);
}

.icon-row button {
  margin-left: auto;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 12px;
}

.system-icons-grid {
  display: grid;
  gap: 16px;
}

.system-app-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.system-app-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.system-icon-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.system-icon-row img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.system-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: linear-gradient(180deg, #f6f9fc, #edf2f6);
  border: 1px dashed var(--line);
}

.system-icon-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.system-icon-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.preview-card {
  padding-bottom: 16px;
}

.preview-head {
  padding: 18px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.preview-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-control {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.screen-frame {
  margin: 0 20px 12px;
  padding: 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, #f2f6f9, #e2e9ef);
  border: 1px solid #cfd9e2;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.device-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(380px, 52vh, 640px);
}

.phone {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #0f141b;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  --ui-text: #f5f6f7;
  --ui-text-muted: rgba(255, 255, 255, 0.7);
  --ui-outline: rgba(255, 255, 255, 0.2);
  --ui-icon: rgba(255, 255, 255, 0.85);
}

.phone::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.phone.text-light {
  --ui-text: #1d2630;
  --ui-text-muted: rgba(29, 38, 48, 0.7);
  --ui-outline: rgba(0, 0, 0, 0.15);
  --ui-icon: rgba(0, 0, 0, 0.65);
}

.wallpaper {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3f4c6b, #606c88);
  background-size: cover;
  background-position: center;
  filter: none;
  transition: filter 0.2s ease;
}

.phone.blur-bg .wallpaper {
  filter: blur(8px);
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.phone.darken .scrim {
  opacity: 1;
}

.ui {
  position: relative;
  z-index: 2;
  padding: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--ui-text);
  transition: opacity 0.2s ease;
}

.phone.hide-ui .ui {
  opacity: 0;
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.top-title {
  font-family: "M PLUS Rounded 1c", "IBM Plex Sans", sans-serif;
  letter-spacing: 0.18em;
}

.chip-mini {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--ui-outline);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.bubble-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.bubble {
  position: relative;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.12)),
    var(--menu-rgba);
  color: var(--ui-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(var(--menu-blur));
  border: 1px solid var(--ui-outline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.bubble span {
  font-size: 12px;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: var(--dots-opacity);
  pointer-events: none;
}

.icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--ui-icon);
}

.phone.transparent-icons .icon {
  background: transparent;
  border: 2px solid var(--ui-text);
}

.dock {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dock-item {
  height: 20px;
  border-radius: 10px;
  background: var(--menu-strong-rgba);
  border: 1px solid var(--ui-outline);
}

.device-meta {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.legend {
  margin: 10px 20px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
}

.console-carousel-ui {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}

.console-carousel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 35% 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.console-carousel::-webkit-scrollbar {
  display: none;
}

.console-carousel:active {
  cursor: grabbing;
}

.carousel-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  width: 240px;
  opacity: 0.5;
  transform: scale(0.9);
  transition: all 0.3s ease;
  scroll-snap-align: center;
  flex-shrink: 0;
  pointer-events: none;
  padding-left: 20px;
}

.carousel-item.active {
  opacity: 1;
  transform: scale(1.05);
}

.carousel-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.carousel-label {
  font-weight: 700;
  font-size: 16px;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: "M PLUS Rounded 1c", sans-serif;
}

@media (max-width: 1080px) {
  .system-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .system-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .system-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
  }

  .preview-head {
    flex-direction: column;
  }
}
