:root {
      --primary: #0f766e;
      --primary-dark: #115e59;
      --accent: #10b981;
      --nav-bg: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
      --surface-bg: #f1f5f9;
      --card-border: #e2e8f0;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', 'Noto Sans Gurmukhi', 'Noto Sans Devanagari', Arial, sans-serif; }
    body { background: var(--surface-bg); color: #1e293b; }

    .navbar { background: var(--nav-bg); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22); border-bottom: 1px solid rgba(255,255,255,0.12); }
    .nav-inner { max-width: 1280px; margin: 0 auto; padding: 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
    .brand { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; font-weight: 800; font-size: 1.12rem; letter-spacing: 0.4px; }
    .brand-top { display: flex; align-items: center; justify-content: center; gap: 8px; }
    .brand-badge { background: linear-gradient(135deg, #10b981, #059669); color: #fff; padding: 3px 9px; border-radius: 6px; font-weight: 800; font-size: 0.82rem; box-shadow: 0 2px 6px rgba(16,185,129,0.4); }
    .brand-sub { font-size: 0.74rem; font-weight: 500; color: #99f6e4; display: block; line-height: 1.2; text-align: center; }
    .menu { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; }
    .menu-btn { text-decoration: none; display: inline-block; background: rgba(255,255,255,0.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.18); padding: 6px 11px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .81rem; transition: 0.18s; }
    .menu-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
    .menu-btn.active { background: #10b981; color: #062825; border-color: #10b981; font-weight: 700; box-shadow: 0 2px 8px rgba(16,185,129,0.35); }

    .container { max-width: 1280px; margin: 20px auto; padding: 0 14px; }
    .pdf-editor-launch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; padding: 15px 18px; border: 1px solid #99f6e4; border-radius: 10px; background: linear-gradient(110deg, #f0fdfa, #fff); color: #134e4a; text-decoration: none; box-shadow: 0 3px 10px rgba(15, 118, 110, .08); }
    .pdf-editor-launch-copy { display: flex; flex-direction: column; gap: 4px; }
    .pdf-editor-launch-copy strong { font-size: .98rem; }
    .pdf-editor-launch-copy span { color: #475569; font-size: .84rem; }
    .pdf-editor-launch-action { flex: 0 0 auto; padding: 8px 12px; border-radius: 7px; background: #059669; color: #fff; font-size: .84rem; font-weight: 700; }
    .pdf-editor-launch:hover { border-color: #0f766e; box-shadow: 0 5px 14px rgba(15, 118, 110, .15); }
    .panel { display: none; background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 22px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05); }
    .panel.active { display: block; }
    h1 { text-align: center; font-size: 1.38rem; margin-bottom: 16px; color: #0f172a; font-weight: 800; }

    .dim-bar { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
    .seg-group { display: inline-flex; background: #e2e8f0; padding: 3px; border-radius: 7px; }
    .seg { border: none; background: transparent; padding: 5px 12px; border-radius: 5px; cursor: pointer; font-weight: 600; color: #334155; }
    .seg.active { background: var(--primary); color: #fff; }

    .inputs-row, .controls-row, .presets-row, .tool-selector { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
    .inputs-row label, .controls-row label { display: flex; align-items: center; gap: 6px; font-size: .85rem; background: #f8fafc; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; }
    input[type="number"], input[type="text"], input[type="password"], select, textarea { padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: .87rem; }
    input[type="number"] { width: 84px; }
    input[type="range"] { width: 112px; cursor: pointer; accent-color: var(--primary); }
    textarea { width: 100%; max-width: 640px; min-height: 90px; }

    .drop-box { border: 2px dashed #94a3b8; border-radius: 10px; padding: 24px 16px; text-align: center; background: #f8fafc; margin-bottom: 14px; cursor: pointer; transition: 0.2s; }
    .drop-box.drag, .drop-box:hover { border-color: var(--primary); background: #f0fdfa; }
    .file-info { margin-top: 8px; font-size: .84rem; color: #64748b; }

    .btn-green { background: #059669; color: #fff; border: none; padding: 9px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: .88rem; transition: 0.15s; }
    .btn-green:hover { background: #047857; }
    .btn-blue { background: var(--primary); color: #fff; border: none; padding: 9px 22px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: .88rem; transition: 0.15s; }
    .btn-blue:hover { background: var(--primary-dark); }
    .btn-red { background: #dc2626; color: #fff; border: none; padding: 7px 14px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: .82rem; }

    .chip { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 5px 11px; border-radius: 14px; font-size: .81rem; cursor: pointer; font-weight: 600; color: #334155; }
    .chip:hover, .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

    .canvas-box { text-align: center; margin: 12px 0; overflow-x: auto; }
    .pdf-crop-preview-wrap { margin: 14px auto; padding: 12px; max-width: 1000px; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; }
    .pdf-crop-preview-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
    .pdf-crop-preview-toolbar label { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; font-size: .84rem; }
    .pdf-crop-hint { color: #475569; font-size: .8rem; text-align: center; }
    .pdf-crop-status { min-height: 1.3em; margin: 4px 0 8px; color: #0f766e; text-align: center; font-size: .84rem; font-weight: 600; }
    .pdf-crop-scroll { max-height: 72vh; overflow: auto; padding: 8px; border: 1px solid #dbe3ef; border-radius: 8px; background: #e2e8f0; text-align: center; }
    .pdf-crop-stage { position: relative; display: inline-block; max-width: 100%; vertical-align: top; line-height: 0; background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.16); }
    .pdf-crop-stage canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 68vh; }
    .pdf-crop-overlay { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
    .pdf-crop-selection { position: absolute; min-width: 1%; min-height: 1%; border: 2px solid #059669; background: rgba(16,185,129,.08); box-shadow: 0 0 0 9999px rgba(15,23,42,.40); cursor: move; }
    .pdf-crop-handle { position: absolute; z-index: 1; width: 12px; height: 12px; border: 2px solid #047857; border-radius: 50%; background: #fff; transform: translate(-50%,-50%); }
    .pdf-crop-handle.nw { left: 0; top: 0; cursor: nwse-resize; }
    .pdf-crop-handle.ne { left: 100%; top: 0; cursor: nesw-resize; }
    .pdf-crop-handle.sw { left: 0; top: 100%; cursor: nesw-resize; }
    .pdf-crop-handle.se { left: 100%; top: 100%; cursor: nwse-resize; }
    canvas.interactive { border: 1px solid #94a3b8; background: #fff; border-radius: 6px; max-width: 100%; cursor: crosshair; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
    canvas.live-preview {
      border: 2px solid #94a3b8;
      border-radius: 8px;
      max-width: 100%;
      max-height: 430px;
      box-shadow: 0 4px 12px rgba(0,0,0,.1);
      background-color: #ffffff;
      background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
      background-size: 16px 16px;
      background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    }
    .hidden { display: none !important; }
    .status-note { text-align: center; font-size: .9rem; color: var(--primary); margin: 10px 0; font-weight: 700; }

    .editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; background: #f1f5f9; padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; margin-bottom: 12px; }
    .form-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 14px 0; }
    .field-card { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
    .field-card label { font-size: .82rem; font-weight: 700; color: #334155; }

    .bg-box-highlight { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px; padding: 9px 12px; margin: 0 auto 12px; max-width: 980px; }
    .hair-box-highlight { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 9px 12px; margin: 0 auto 14px; max-width: 980px; }

    .frame-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px auto 14px; max-width: 1060px; max-height: 340px; overflow-y: auto; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
    .frame-thumb { width: 82px; padding: 5px; border: 2px solid #cbd5e1; border-radius: 6px; text-align: center; cursor: pointer; background: #fff; transition: 0.15s; }
    .frame-thumb:hover { border-color: var(--primary); }
    .frame-thumb.selected { border-color: #059669; background: #ecfdf5; box-shadow: 0 0 0 2px rgba(5,150,105,0.2); }
    .frame-thumb canvas { width: 58px; height: 68px; display: block; margin: 0 auto 3px; background: #f1f5f9; }
    .frame-thumb span { display: block; font-size: .68rem; font-weight: 700; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .output-area { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
    .card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; text-align: center; background: #fff; overflow: hidden; }
    .card img {
      max-width: 100%; max-height: 220px; object-fit: contain; border: 1px solid #e2e8f0; margin-bottom: 8px;
      background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
      background-size: 14px 14px;
      background-position: 0 0, 0 7px, 7px -7px, -7px 0;
    }
    .card-title { padding: 14px 6px; font-weight: bold; word-break: break-word; overflow-wrap: anywhere; font-size: .88rem; }
    .dl-btn { display: inline-block; margin-top: 8px; background: #059669; color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 5px; font-size: .85rem; font-weight: 700; }

    .ed-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin: 14px 0; }
    .ed-pane { min-width: 0; border: 1px solid #dbe3ef; border-radius: 10px; padding: 12px; background: #f8fafc; }
    .ed-pane h3 { text-align: center; font-size: 1rem; margin: 2px 0 5px; color: #0f766e; }
    .ed-hint { text-align: center; color: #64748b; font-size: .8rem; margin-bottom: 8px; }
    #edCanvas, #edPreviewCanvas { max-width: 100%; height: auto; background: #fff; border: 1px solid #94a3b8; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
    #edPreviewCanvas { cursor: default; }

    @media (max-width: 850px) {
      .ed-workspace { grid-template-columns: 1fr; }
      .pdf-editor-launch { align-items: flex-start; flex-direction: column; }
    }
    .docx-nav-account { color: #fff; background: #059669; border-color: #34d399; font: inherit; }
    .docx-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(15, 23, 42, .65); overflow-y: auto; }
    .docx-modal-card { position: relative; width: min(100%, 620px); max-height: calc(100vh - 36px); overflow-y: auto; padding: 24px; border-radius: 14px; background: #fff; box-shadow: 0 18px 60px rgba(15, 23, 42, .3); }
    .docx-modal-card h2 { margin: 0 38px 14px 0; color: #0f172a; font-size: 1.3rem; }
    .docx-modal-card h3 { margin: 14px 0 8px; color: #134e4a; font-size: 1rem; }
    .docx-modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; color: #475569; font-size: 1.8rem; cursor: pointer; }
    .docx-modal-status { min-height: 1.4em; margin: 0 0 8px; color: #0f766e; font-size: .86rem; font-weight: 700; }
    .docx-modal-status.error { color: #b91c1c; }
    .docx-switch-row, .docx-social-row { display: flex; gap: 8px; margin: 10px 0; }
    .docx-tab, .docx-social { flex: 1; padding: 9px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #334155; font-weight: 700; cursor: pointer; }
    .docx-tab.active { border-color: #0f766e; background: #ccfbf1; color: #115e59; }
    .docx-field { display: flex; flex-direction: column; gap: 5px; margin: 9px 0; color: #334155; font-size: .83rem; font-weight: 700; }
    .docx-field input, .docx-field select { width: 100%; min-height: 38px; padding: 8px 10px; }
    .docx-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .docx-wide-btn { width: 100%; margin-top: 8px; }
    .docx-divider { display: flex; align-items: center; gap: 10px; margin: 15px 0 6px; color: #64748b; font-size: .78rem; }
    .docx-divider::before, .docx-divider::after { content: ""; height: 1px; flex: 1; background: #e2e8f0; }
    .docx-social { background: #fff; }
    .docx-balance-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 14px; border: 1px solid #99f6e4; border-radius: 9px; background: #f0fdfa; color: #134e4a; }
    .docx-balance-card strong { grid-row: span 2; font-size: 1.5rem; }
    .docx-balance-card small, .docx-topup small { color: #64748b; font-size: .76rem; }
    .docx-topup { margin: 16px 0; padding: 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; }
    .docx-ledger-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .docx-ledger-heading h3 { margin-bottom: 6px; }
    .docx-link-btn { border: 0; background: transparent; color: #0f766e; font-weight: 700; cursor: pointer; }
    .docx-ledger { max-height: 210px; overflow-y: auto; border-top: 1px solid #e2e8f0; }
    .docx-ledger-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #f1f5f9; font-size: .77rem; }
    .docx-ledger-row strong { flex: 0 0 auto; color: #047857; }
    .docx-ledger-row strong.negative { color: #b91c1c; }
    .docx-pricing-note { margin: 8px auto 14px; padding: 10px 12px; border: 1px solid #99f6e4; border-radius: 8px; background: #f0fdfa; color: #134e4a; text-align: center; font-size: .86rem; }
    @media (max-width: 520px) {
      .docx-modal-card { padding: 20px 16px; }
      .docx-two-col { grid-template-columns: 1fr; gap: 0; }
      .docx-nav-account { width: 100%; }
    }
