/* ===================================================
🌟 TIMEMARK APP THEME — BLUE-VIOLET PREMIUM PWA
Thiết kế tối ưu Mobile & Thao tác vuốt/chạm mượt mà
=================================================== */
@font-face {
  font-family: 'Social Gothic Soft';
  src: url('Social Gothic Soft.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  /* ====== BỘ MÀU TỐI (MẶC ĐỊNH) ====== */
  --bg-deep: #0d0614;
  --bg-surface: #160e24;
  --card-bg: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --primary: #a855f7;
  --secondary: #3b82f6;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #ffffff;
  --text-muted: #8e8e93;
  --text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  --input-bg: rgba(0, 0, 0, 0.2);
  --input-focus: rgba(0, 0, 0, 0.4);
  --file-btn-bg: rgba(255, 255, 255, 0.1);
  --file-btn-active: rgba(255, 255, 255, 0.2);
  --header-bg: rgba(13, 6, 20, 0.75);
  --bg-grad-1: rgba(168, 85, 247, 0.25);
  --bg-grad-2: rgba(59, 130, 246, 0.25);
  --bg-grad-3: rgba(236, 72, 153, 0.1);
  --canvas-bg: #1c1c1e;
  --slider-bg: rgba(255,255,255,0.15);
  
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  /* ====== BỘ MÀU SÁNG ====== */
  --bg-deep: #f3f4f6;
  --bg-surface: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 1);
  --primary: #8b5cf6;
  --glass-border: rgba(0, 0, 0, 0.08);
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-shadow: none;
  --input-bg: rgba(255, 255, 255, 0.6);
  --input-focus: #ffffff;
  --file-btn-bg: rgba(0, 0, 0, 0.05);
  --file-btn-active: rgba(0, 0, 0, 0.1);
  --header-bg: rgba(255, 255, 255, 0.85);
  --bg-grad-1: rgba(168, 85, 247, 0.15);
  --bg-grad-2: rgba(59, 130, 246, 0.15);
  --bg-grad-3: rgba(236, 72, 153, 0.05);
  --canvas-bg: #f8fafc;
  --slider-bg: rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-main);
  background-color: var(--bg-deep);
  min-height: 100vh;
  overscroll-behavior-y: none; 
  user-select: none; 
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed; inset: 0;
  background: 
    radial-gradient(circle at 10% 0%, var(--bg-grad-1) 0%, transparent 50%),
    radial-gradient(circle at 90% 100%, var(--bg-grad-2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--bg-grad-3) 0%, transparent 60%);
  z-index: 0; pointer-events: none;
}

.app {
  position: relative; 
  z-index: 2;
  max-width: 420px; margin: 0 auto;
  padding-bottom: 100px; /* Nhường chỗ riêng cho nút Menu nổi */
}

@media (min-width: 421px) {
  .app {
    margin: 20px auto; border-radius: 40px; overflow: hidden;
    border: 8px solid #1c1c1e; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    height: calc(100vh - 40px); overflow-y: auto;
  }
  .app::-webkit-scrollbar { width: 0px; }
}

/* HEADER CỐ ĐỊNH NHƯ APP */
.header-app {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
}
.header-app h2 { margin: 0 0 4px 0; font-size: 18px; font-weight: 700; background: linear-gradient(135deg, #c084fc, #60a5fa, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; }
.header-app p { margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 500; }

.theme-toggle-btn {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  background: var(--file-btn-bg); border: 1px solid var(--glass-border); color: var(--text-main);
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.theme-toggle-btn:active { transform: translateY(-50%) scale(0.9); }

/* CARDS MODULE */
.app-card {
  background: var(--card-bg); 
  border-radius: var(--radius-lg);
  padding: 16px; margin: 16px; 
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.section-title { margin: 0 0 16px 0; font-size: 15px; font-weight: 600; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.5px; opacity: 1; display: flex; align-items: center; gap: 8px; text-shadow: var(--text-shadow); }

/* INPUTS THEO STYLE IOS */
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
input:not([type="checkbox"]):not([type="range"]), select, textarea {
  width: 100%; height: 44px; background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); padding: 0 12px;
  font-size: 15px; color: var(--text-main); font-family: var(--font-ui);
  outline: none; transition: all 0.2s ease; margin-bottom: 12px;
}
textarea {
  min-height: 82px;
  height: auto;
  padding: 11px 12px;
  line-height: 1.45;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); background: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}
input[type="file"] { height: auto; padding: 8px; line-height: 1.5; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; width: 100%; }
input[type="file"]::file-selector-button {
  background: var(--file-btn-bg); border: none; color: var(--text-main);
  padding: 8px 12px; border-radius: 8px; margin-right: 12px; cursor: pointer; font-weight: 500; transition: 0.2s;
}
input[type="file"]::file-selector-button:active { background: var(--file-btn-active); }

.infoGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.infoGrid > div { margin-bottom: 0; }
.fullRow { grid-column: 1 / -1; }
.style-form { display: none; }
.style-form.active { display: block; }
.note-control { margin-top: -4px; }
.note-add-btn {
  width: 100%;
  min-height: 42px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--file-btn-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
}
.note-add-btn:active { background: var(--file-btn-active); transform: scale(0.98); }
.extra-note-wrap { display: none; }
.extra-note-wrap.show { display: block; }

/* BUTTONS CẢI TIẾN */
.btn-primary {
  background: linear-gradient(135deg, #ec4899, var(--primary), var(--secondary));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  color: #fff; border: none; height: 56px; border-radius: 28px;
  font-size: 16px; font-weight: 600; font-family: var(--font-ui);
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4); width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 4px 10px var(--primary-glow); }

.btn-secondary-action {
  background: var(--file-btn-bg); color: var(--text-main); border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  height: 56px; border-radius: 28px; font-size: 15px; font-weight: 600; font-family: var(--font-ui);
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3); width: 100%;
}
.btn-secondary-action:active { transform: scale(0.96); background: var(--file-btn-active); }

.btn-secondary {
  background: var(--file-btn-bg); color: var(--text-main); border: 1px solid var(--glass-border);
  height: 44px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  width: 100%; cursor: pointer; transition: 0.2s; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:active { background: var(--file-btn-active); transform: scale(0.96); }

.btnToggle {
  background: transparent; border: none; color: var(--primary); font-weight: 500;
  padding: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: none; font-size: 14px; cursor: pointer;
}
.btnToggle .gear { transition: 0.3s ease; font-size: 18px; }
.btnToggle.active .gear { transform: rotate(90deg); color: var(--primary); }

/* THANH BOTTOM ACTION NHƯ APP THẬT */
.action-bar {
  position: relative; /* Đưa xuống cuối cùng của cuộn trang */
  width: 100%; padding: 0 16px 20px 16px;
  background: transparent;
  border-top: none; display: flex; gap: 12px; z-index: 10;
}

/* THANH TRƯỢT RANGE */
.scale-control label { color: var(--text-main); font-weight: 600; margin-bottom: 8px; margin-top: 0; display: block; }
.scale-control .hint { font-size: 12px; color: var(--text-muted); display: block; margin-top: 8px; line-height: 1.4; text-align: center; }

input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--slider-bg); border-radius: 2px; outline: none; margin: 10px 0; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text-main); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* SWITCH NÚT BẬT TẮT */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-row .title { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-main); }

.switch { position: relative; width: 48px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background-color: var(--slider-bg); border-radius: 30px; transition: 0.3s; }
.slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 2px; bottom: 2px; background-color: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
input:checked + .slider { background: var(--primary); } /* Màu gradient tím */
input:checked + .slider:before { transform: translateX(20px); }

/* PANEL TRƯỢT MỞ RỘNG */
#advancedPanel { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); margin-top: 0; }
#advancedPanel.open { max-height: 500px; opacity: 1; margin-top: 8px; }

/* KHU VỰC PREVIEW CANVAS */
.canvas-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.canvas-wrap::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); border-radius: 16px; pointer-events: none; }
canvas { width: 100%; display: block; background: var(--canvas-bg); }

/* ================= MODAL KHÓA ================= */
.lock {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lockBox {
  background: var(--bg-surface); border: 1px solid var(--glass-border);
  padding: 30px 24px; border-radius: var(--radius-lg); width: 100%; max-width: 340px;
  text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}
.lockBox h3 { margin-top: 0; font-size: 20px; color: var(--text-main); }
.lockBox p { color: var(--text-muted); line-height: 1.5; }
.shieldIcon { font-size: 40px; margin-bottom: 16px; filter: drop-shadow(0 0 10px var(--primary-glow)); }

/* ================= POPUP / MODAL BUTTONS ================= */
.lockBox button, .god-btn {
  width: 100%; height: 48px; border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600; font-family: var(--font-ui);
  cursor: pointer; transition: all 0.2s ease; margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#btnActivate, #notifyBtn, .god-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
#btnActivate:active, #notifyBtn:active, .god-btn:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3); }

#btnBuy { background: linear-gradient(135deg, #ff6a00, #ff9800); color: #fff; box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3); }
#btnBuy:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3); }

.notifyActions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.notifyActions button { margin-top: 0; }
#notifyBtn2 { background: var(--file-btn-bg); color: var(--text-main); border: 1px solid var(--glass-border); }
#notifyBtn2:active { background: var(--file-btn-active); transform: scale(0.96); }

/* ================= FLOAT MENU ================= */
.tmFab { position: fixed; right: 20px; bottom: 30px; z-index: 99; } /* Hạ xuống góc phải vì Action Bar đã di chuyển */
.tmFabBtn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--file-btn-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--text-main); border: 1px solid var(--glass-border); font-size: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; justify-content: center; margin: 0;
}
.tmFabBtn:active { transform: scale(0.9); }
.tmFabMenu {
  position: absolute; bottom: 70px; right: 0; display: flex; flex-direction: column; gap: 12px;
  opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.95);
  transform-origin: bottom right; transition: all 0.3s;
}
.tmFabMenu.show { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.tmFabItem {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-md); background: var(--bg-surface);
  border: 1px solid var(--glass-border); color: var(--text-main); text-decoration: none;
  font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* ================= AI GOD MODE ================= */
.god-mode { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; z-index: 99999; padding: 20px; }
.god-box { width: 280px; padding: 30px; border-radius: var(--radius-lg); background: #000; border: 1px solid var(--primary); text-align: center; box-shadow: 0 0 40px var(--primary-glow); position: relative; overflow: hidden; }
.god-box-success { width: min(360px, 100%); min-height: 250px; }
.god-state { position: relative; z-index: 1; }
.god-ring, .god-ring2 { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); border-radius: 50%; border: 2px solid var(--primary); border-top-color: transparent; }
.god-ring { width: 50px; height: 50px; animation: spin 1s linear infinite; }
.god-ring2 { width: 66px; height: 66px; border: 2px solid rgba(139, 92, 246, 0.3); border-bottom-color: transparent; animation: spinReverse 1.5s linear infinite; }
.god-title { margin-top: 80px; font-size: 12px; font-weight: bold; letter-spacing: 2px; color: var(--primary); }
.god-text { margin-top: 8px; font-size: 14px; color: #fff; }
.god-bar { margin-top: 16px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.god-bar span { display: block; height: 100%; width: 30%; background: var(--primary); border-radius: 4px; animation: godLoad 1s ease-in-out infinite alternate; }
.god-success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(34, 197, 94, 0.32);
}
.god-success-title {
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.god-success-text {
  max-width: 280px;
  margin: 10px auto 18px;
  color: #cfd8ff;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}
.god-success-text + .god-btn { margin-top: 0; }
@keyframes spin { 100% { transform: translateX(-50%) rotate(360deg); } }
@keyframes spinReverse { 100% { transform: translateX(-50%) rotate(-360deg); } }
@keyframes godLoad { 0% { transform: translateX(-10%); } 100% { transform: translateX(250%); } }

.loadingBlur { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; display: none; }

/* ===================================================
   MOBILE-FIRST REFRESH UI
=================================================== */
:root {
  --bg-deep: #081120;
  --bg-surface: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-border: rgba(125, 211, 252, 0.34);
  --card-shadow: 0 18px 44px rgba(2, 6, 23, 0.22), inset 0 1px 0 rgba(255,255,255,0.82);
  --primary: #0284c7;
  --secondary: #0f766e;
  --accent: #fb7185;
  --primary-glow: rgba(56, 189, 248, 0.34);
  --glass-border: rgba(125, 211, 252, 0.30);
  --text-main: #071526;
  --text-muted: #334155;
  --text-shadow: none;
  --input-bg: #ffffff;
  --input-focus: #ffffff;
  --file-btn-bg: #e0f2fe;
  --file-btn-active: #bae6fd;
  --header-bg: rgba(248, 250, 252, 0.92);
  --bg-grad-1: rgba(56, 189, 248, 0.34);
  --bg-grad-2: rgba(45, 212, 191, 0.24);
  --bg-grad-3: rgba(251, 113, 133, 0.18);
  --canvas-bg: #eef6fb;
  --slider-bg: rgba(15, 23, 42, 0.12);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

[data-theme="dark"] {
  --bg-deep: #020617;
  --bg-surface: #07111f;
  --card-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 13, 30, 0.86));
  --card-border: rgba(125, 211, 252, 0.24);
  --card-shadow: 0 22px 58px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255,255,255,0.08);
  --primary: #38bdf8;
  --secondary: #5eead4;
  --accent: #fb7185;
  --primary-glow: rgba(56, 189, 248, 0.26);
  --glass-border: rgba(125, 211, 252, 0.18);
  --text-main: #f8fafc;
  --text-muted: #dbeafe;
  --input-bg: rgba(15, 23, 42, 0.92);
  --input-focus: rgba(30, 41, 59, 0.96);
  --file-btn-bg: rgba(14, 165, 233, 0.18);
  --file-btn-active: rgba(14, 165, 233, 0.28);
  --header-bg: rgba(2, 6, 23, 0.88);
  --canvas-bg: #0f172a;
  --slider-bg: rgba(255,255,255,0.16);
}

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(56, 189, 248, 0.30), transparent 330px),
    radial-gradient(circle at 92% 12%, rgba(45, 212, 191, 0.22), transparent 310px),
    radial-gradient(circle at 48% 104%, rgba(251, 113, 133, 0.18), transparent 390px),
    linear-gradient(180deg, #040b1d 0%, var(--bg-deep) 54%, #020617 100%),
    var(--bg-deep);
}

input, textarea, select {
  user-select: text;
}

.bg {
  background:
    radial-gradient(circle at 18% 18%, var(--bg-grad-1), transparent 30%),
    radial-gradient(circle at 84% 20%, var(--bg-grad-2), transparent 28%),
    radial-gradient(circle at 50% 92%, var(--bg-grad-3), transparent 34%);
}

.bg::before,
.bg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg::before {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(186,230,253,0.78) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255,255,255,0.58) 0 0.8px, transparent 1.4px);
  background-size: 88px 88px, 132px 132px, 54px 54px;
  background-position: 0 0, 34px 22px, 18px 40px;
  opacity: 0.74;
}

.bg::after {
  background:
    radial-gradient(ellipse at 18% 24%, rgba(56,189,248,0.18), transparent 36%),
    radial-gradient(ellipse at 78% 70%, rgba(94,234,212,0.12), transparent 34%),
    linear-gradient(115deg, transparent 0 44%, rgba(255,255,255,0.08) 48%, transparent 56% 100%);
  opacity: 0.92;
}

.petals {
  display: none;
}

.app {
  max-width: 460px;
  min-height: 100vh;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

@media (min-width: 461px) {
  .app {
    max-width: 460px;
    margin: 18px auto;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 30px;
    background: rgba(8, 17, 32, 0.26);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
    height: calc(100vh - 36px);
  }

  [data-theme="dark"] .app {
    background: rgba(2, 6, 23, 0.32);
    border-color: rgba(255,255,255,0.10);
  }
}

.header-app {
  padding: 18px 58px 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.18);
}

.header-app h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--text-main);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.header-app h2::before {
  content: none;
}

.brand-title {
  position: relative;
  isolation: isolate;
  padding: 4px 6px 5px;
  border-radius: 16px;
}

.brand-title::after {
  content: "";
  position: absolute;
  inset: -5px -8px;
  z-index: -1;
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 50%, #facc15 0 3px, transparent 4px),
    radial-gradient(circle at 24% 50%, #38bdf8 0 3px, transparent 4px),
    radial-gradient(circle at 40% 50%, #fb7185 0 3px, transparent 4px),
    radial-gradient(circle at 56% 50%, #5eead4 0 3px, transparent 4px),
    radial-gradient(circle at 72% 50%, #a78bfa 0 3px, transparent 4px),
    radial-gradient(circle at 88% 50%, #f97316 0 3px, transparent 4px);
  filter: drop-shadow(0 0 9px rgba(125,211,252,0.75));
  opacity: 0.78;
  animation: brandLights 2.4s linear infinite;
}

.brand-rocket {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #ffffff, #38bdf8 38%, #0f172a 72%);
  box-shadow: 0 0 18px rgba(56,189,248,0.80), inset 0 1px 0 rgba(255,255,255,0.60);
  animation: rocketGlow 1.9s ease-in-out infinite alternate;
}

.brand-name {
  background: linear-gradient(90deg, #facc15, #38bdf8, #5eead4, #fb7185, #facc15);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 18px rgba(56,189,248,0.30);
  animation: brandTextFlow 3.2s linear infinite;
}

@keyframes brandLights {
  0% { background-position: 0 0; filter: drop-shadow(0 0 7px rgba(250,204,21,0.66)); }
  50% { background-position: 34px 0; filter: drop-shadow(0 0 12px rgba(94,234,212,0.82)); }
  100% { background-position: 68px 0; filter: drop-shadow(0 0 7px rgba(251,113,133,0.66)); }
}

@keyframes brandTextFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}

@keyframes rocketGlow {
  from { transform: translateY(0) rotate(-4deg); box-shadow: 0 0 14px rgba(56,189,248,0.70), inset 0 1px 0 rgba(255,255,255,0.60); }
  to { transform: translateY(-1px) rotate(4deg); box-shadow: 0 0 24px rgba(94,234,212,0.92), inset 0 1px 0 rgba(255,255,255,0.70); }
}

.header-app p {
  max-width: 310px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.header-note {
  margin-top: 7px !important;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.10);
  color: #0f766e !important;
}

[data-theme="dark"] .header-note {
  color: #99f6e4 !important;
  background: rgba(45, 212, 191, 0.12);
}

.theme-toggle-btn {
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--card-bg);
}

.app-card {
  margin: 12px 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border-color: var(--card-border);
  box-shadow: var(--card-shadow);
  outline: 1px solid rgba(255,255,255,0.04);
}

.section-title {
  margin-bottom: 14px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

.watermark-card {
  display: block;
}

.style-select-native {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.style-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.style-option {
  position: relative;
  width: 100%;
  min-height: 76px;
  padding: 11px 12px 12px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(224,242,254,0.72)),
    var(--input-bg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.style-option strong,
.style-option small {
  display: block;
}

.style-option strong {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.style-option small {
  max-width: 150px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
}

.style-option.active {
  border-color: rgba(14, 165, 233, 0.72);
  background:
    radial-gradient(circle at 88% 18%, rgba(20,184,166,0.22), transparent 34%),
    linear-gradient(135deg, rgba(14,165,233,0.16), rgba(20,184,166,0.10)),
    var(--card-bg);
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.16), inset 0 0 0 1px rgba(255,255,255,0.55);
  transform: translateY(-1px);
}

.style-option.active::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.style-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 950;
}

.style-badge.muted {
  background: #e0f2fe;
  color: #075985;
}

[data-theme="dark"] .style-option {
  background:
    linear-gradient(135deg, rgba(15,23,42,0.94), rgba(14,116,144,0.22)),
    var(--input-bg);
  border-color: rgba(125, 211, 252, 0.18);
}

[data-theme="dark"] .style-option.active {
  border-color: rgba(94, 234, 212, 0.70);
  background:
    radial-gradient(circle at 88% 18%, rgba(94,234,212,0.24), transparent 38%),
    linear-gradient(135deg, rgba(14,165,233,0.22), rgba(15,23,42,0.94));
  box-shadow: 0 16px 34px rgba(56, 189, 248, 0.20), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.upload-card input[type="file"] {
  min-height: 54px;
  padding: 10px;
  border: 1px dashed rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(14,165,233,0.08), rgba(20,184,166,0.06));
}

label {
  color: var(--text-main);
  font-weight: 800;
}

input:not([type="checkbox"]):not([type="range"]), select, textarea {
  min-height: 48px;
  height: 48px;
  border-radius: 15px;
  border-color: var(--glass-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 8px 18px rgba(2,6,23,0.08);
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
  opacity: 1;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #94a3b8;
}

textarea {
  min-height: 86px;
  padding-top: 12px;
}

.quick-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-secondary {
  min-height: 46px;
  height: auto;
  margin: 0;
  padding: 10px 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, #ecfeff, #dbeafe);
  border-color: rgba(14, 165, 233, 0.38);
  color: #075985;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(2, 132, 199, 0.14);
}

[data-theme="dark"] .btn-secondary {
  background: linear-gradient(135deg, rgba(14,165,233,0.24), rgba(45,212,191,0.14));
  border-color: rgba(125, 211, 252, 0.28);
  color: #e0f2fe;
}

.infoGrid {
  gap: 0 10px;
}

.note-add-btn {
  min-height: 46px;
  border-color: rgba(14, 165, 233, 0.42);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(45, 212, 191, 0.10));
  color: var(--primary);
  box-shadow: 0 10px 22px rgba(2, 132, 199, 0.10);
}

.preview-card {
  padding: 14px;
}

.canvas-wrap {
  min-height: 210px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgba(125,211,252,0.20), transparent 34%),
    linear-gradient(135deg, rgba(14,165,233,0.14), rgba(20,184,166,0.10)),
    var(--canvas-bg);
  box-shadow: inset 0 0 0 1px rgba(125,211,252,0.20), 0 18px 38px rgba(2,6,23,0.18);
}

canvas {
  max-height: 62vh;
  object-fit: contain;
  border-radius: 16px;
}

.settings-card {
  margin-bottom: 6px;
}

.scale-control {
  margin-bottom: 10px !important;
}

.scale-control .hint {
  text-align: left;
  color: var(--text-muted);
  font-weight: 650;
}

input[type="range"] {
  height: 6px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.btnToggle {
  margin-top: 2px;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.08);
  color: var(--primary);
}

.toggle-row {
  padding: 14px 2px;
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.action-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(460px, 100%);
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, 0.82);
  border-top: 1px solid rgba(125, 211, 252, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.28);
}

.btn-primary,
.btn-secondary-action {
  height: 56px;
  border-radius: 18px;
  font-weight: 900;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, var(--secondary) 28%, var(--primary) 72%, #60a5fa);
  color: #ffffff;
  box-shadow: 0 16px 30px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.28);
}

.btn-secondary-action {
  background: rgba(255,255,255,0.92);
  color: #071526;
  border: 1px solid rgba(125, 211, 252, 0.38);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.18);
}

[data-theme="dark"] .btn-secondary-action {
  background: rgba(15,23,42,0.94);
  color: #f8fafc;
  border-color: rgba(125, 211, 252, 0.24);
}

.tmFab {
  right: 18px;
  bottom: calc(94px + env(safe-area-inset-bottom));
}

.tmFabBtn {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--primary);
}

.lock {
  background: rgba(15, 23, 42, 0.54);
}

.lockBox {
  background: var(--card-bg);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
}

#btnActivate, #notifyBtn, .god-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

@media (max-width: 360px) {
  .quick-tool-row {
    grid-template-columns: 1fr;
  }

  .header-app {
    padding-right: 54px;
  }
}

/* ===================================================
   FINAL MOBILE POLISH
=================================================== */
html {
  background: #020617;
}

body {
  color: var(--text-main);
  background:
    radial-gradient(circle at 16% 8%, rgba(56, 189, 248, 0.30), transparent 260px),
    radial-gradient(circle at 92% 18%, rgba(94, 234, 212, 0.20), transparent 250px),
    radial-gradient(circle at 50% 100%, rgba(251, 113, 133, 0.16), transparent 360px),
    linear-gradient(180deg, #020617 0%, #07111f 52%, #020617 100%);
}

.bg {
  overflow: hidden;
}

.app {
  width: min(100%, 460px);
}

.header-app {
  top: 0;
  padding: 14px 58px 12px 14px;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.72));
  border-bottom-color: rgba(125, 211, 252, 0.20);
}

[data-theme="light"] .header-app {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(224, 242, 254, 0.82));
}

.brand-title {
  margin-bottom: 8px !important;
  max-width: calc(100vw - 88px);
}

.brand-name {
  font-size: clamp(20px, 5.6vw, 24px);
  line-height: 1.05;
}

.brand-rocket {
  flex: 0 0 auto;
}

.header-app p {
  max-width: 340px;
  color: var(--text-muted);
}

.header-note {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  border: 1px solid rgba(94, 234, 212, 0.18);
  background: rgba(14, 165, 233, 0.12) !important;
}

.theme-toggle-btn {
  right: 14px;
  top: 10px;
  transform: none;
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(125, 211, 252, 0.28);
  color: #f8fafc;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(255,255,255,0.90);
  color: #0f172a;
}

.app-card {
  margin: 10px 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
}

[data-theme="dark"] .app-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.82));
}

.section-title {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.055em;
  color: var(--text-main);
}

label {
  color: var(--text-main);
  font-size: 12px;
  letter-spacing: 0.01em;
}

input:not([type="checkbox"]):not([type="range"]),
select,
textarea {
  min-height: 46px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 10px 24px rgba(2, 6, 23, 0.10);
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(125, 211, 252, 0.20);
  color: #f8fafc;
}

textarea {
  min-height: 78px;
}

.upload-card input[type="file"] {
  min-height: 50px;
  border-color: rgba(125, 211, 252, 0.36);
  background:
    linear-gradient(135deg, rgba(14,165,233,0.14), rgba(94,234,212,0.10));
}

.style-picker {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.style-option {
  min-height: 64px;
  padding: 9px 10px 10px;
  border-radius: 15px;
}

.style-option strong {
  margin-top: 22px;
  font-size: 13px;
}

.style-option small {
  display: none;
}

.style-badge {
  top: 8px;
  left: 9px;
  min-height: 20px;
  font-size: 10px;
}

.style-option.active::after {
  width: 22px;
  height: 22px;
  right: 8px;
  top: 8px;
}

.quick-tool-row {
  gap: 8px;
  margin-bottom: 12px;
}

.btn-secondary,
.note-add-btn,
.btnToggle {
  min-height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.canvas-wrap {
  min-height: 190px;
  border-radius: 20px;
}

canvas {
  max-height: min(56vh, 520px);
}

.settings-card {
  margin-bottom: 4px;
}

.scale-control label {
  color: var(--text-main);
}

.scale-control .hint {
  font-size: 12px;
  line-height: 1.35;
}

.action-bar {
  width: min(460px, 100%);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.94));
}

.btn-primary,
.btn-secondary-action {
  height: 54px;
  border-radius: 17px;
  font-size: 15px;
}

.btn-primary {
  letter-spacing: 0.01em;
}

.tmFab {
  right: 14px;
  bottom: calc(88px + env(safe-area-inset-bottom));
}

.tmFabBtn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

.tmFabItem {
  background: var(--card-bg);
  border-color: var(--card-border);
}

@media (min-width: 461px) {
  .app {
    border-color: rgba(125, 211, 252, 0.18);
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 19px;
  }

  .brand-rocket {
    width: 30px;
    height: 30px;
  }

  .header-app {
    padding-left: 12px;
  }

  .style-option strong {
    font-size: 12px;
  }

  .app-card {
    margin-left: 10px;
    margin-right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-title::after,
  .brand-name,
  .brand-rocket,
  .god-ring,
  .god-ring2,
  .god-bar span {
    animation: none !important;
  }
}

/* ===================================================
   COMMAND CENTER COCKPIT SKIN
=================================================== */
.header-app {
  position: sticky;
  overflow: hidden;
}

.header-app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(125,211,252,0.10) 14%, transparent 16% 100%),
    repeating-linear-gradient(90deg, rgba(125,211,252,0.08) 0 1px, transparent 1px 42px);
  opacity: 0.45;
}

.header-app > * {
  position: relative;
  z-index: 1;
}

.command-status {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 2px;
}

.command-status span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.58);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(2,6,23,0.20);
}

[data-theme="light"] .command-status span {
  background: rgba(255,255,255,0.72);
  color: #075985;
}

.command-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.key-expiry-line {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-height: 28px;
  margin: 3px 0 0 !important;
  padding: 5px 10px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #e0f2fe !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(2,6,23,0.16);
}

.key-expiry-line::before {
  content: "⏳";
  margin-right: 6px;
}

.key-expiry-line.warning {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a !important;
}

[data-theme="light"] .key-expiry-line {
  background: rgba(224, 242, 254, 0.84);
  color: #075985 !important;
  border-color: rgba(14, 165, 233, 0.28);
}

[data-theme="light"] .key-expiry-line.warning {
  background: rgba(254, 243, 199, 0.88);
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.32);
}

.app-card {
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(94,234,212,0.72), transparent 22%) top left / 46% 1px no-repeat,
    linear-gradient(180deg, rgba(94,234,212,0.42), transparent 30%) top left / 1px 52% no-repeat,
    linear-gradient(270deg, rgba(56,189,248,0.52), transparent 20%) bottom right / 42% 1px no-repeat,
    linear-gradient(0deg, rgba(56,189,248,0.30), transparent 30%) bottom right / 1px 48% no-repeat;
  opacity: 0.85;
}

.app-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(125,211,252,0.08), transparent);
  animation: cockpitScan 6s linear infinite;
}

.app-card > * {
  position: relative;
  z-index: 1;
}

.section-title {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.46);
  color: #e0f2fe;
  width: fit-content;
  max-width: 100%;
}

[data-theme="light"] .section-title {
  background: rgba(255,255,255,0.72);
  color: #075985;
}

.section-title::after {
  content: "";
  width: 28px;
  height: 1px;
  margin-left: 8px;
  background: linear-gradient(90deg, rgba(94,234,212,0.8), transparent);
}

.upload-card,
.watermark-card,
.form-card,
.preview-card,
.settings-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.70));
}

[data-theme="light"] .upload-card,
[data-theme="light"] .watermark-card,
[data-theme="light"] .form-card,
[data-theme="light"] .preview-card,
[data-theme="light"] .settings-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(224,242,254,0.82));
}

.style-option {
  overflow: hidden;
}

.style-option::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(125,211,252,0.16), transparent 48%),
    repeating-linear-gradient(90deg, rgba(125,211,252,0.08) 0 1px, transparent 1px 18px);
  opacity: 0.48;
}

.style-option > * {
  position: relative;
  z-index: 1;
}

.canvas-wrap::before {
  content: "LIVE PREVIEW";
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(94, 234, 212, 0.28);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.canvas-wrap::after {
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(125,211,252,0.22),
    inset 0 0 42px rgba(14,165,233,0.12);
}

.btn-primary,
.btn-secondary-action,
.btn-secondary,
.btnToggle,
.note-add-btn {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-secondary-action::after,
.btn-secondary::after,
.btnToggle::after,
.note-add-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255,255,255,0.26) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  transition: transform 0.42s ease;
}

.btn-primary:active::after,
.btn-secondary-action:active::after,
.btn-secondary:active::after,
.btnToggle:active::after,
.note-add-btn:active::after {
  transform: translateX(120%);
}

@keyframes cockpitScan {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(380%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app-card::after {
    animation: none !important;
  }
}

/* Header compact controls */
.header-app .theme-toggle-btn {
  position: absolute !important;
  top: 8px !important;
  right: 10px !important;
  transform: none !important;
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 13px !important;
  z-index: 10;
}

.header-app .theme-toggle-btn:active {
  transform: scale(0.94) !important;
}

.key-expiry-line {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 11px !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.key-expiry-line::before {
  margin-right: 5px;
}
