/* QuickQR shared styles (PWA + desktop). */
:root {
    --qq-bg: #fafafa;
    --qq-card: #ffffff;
    --qq-text: #1f2937;
    --qq-muted: #6b7280;
    --qq-border: #d4d4d8;
    --qq-accent: #2563eb;
    --qq-accent-hover: #1d4ed8;
    --qq-warn: #b45309;
    --qq-hover: #eef4fb;
}

html, body { margin: 0; background: var(--qq-bg); color: var(--qq-text); font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif; }
* { box-sizing: border-box; }

.qq { padding: 14px 16px 10px; max-width: 440px; margin: 0 auto; }
.qq.web { padding-top: 24px; }
.qq.desktop { max-width: none; }

.qq-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.qq-logo-mark { width: 22px; height: 22px; border: 4px solid var(--qq-text); border-radius: 5px; box-shadow: inset 0 0 0 3px var(--qq-card), inset 0 0 0 6px var(--qq-text); }

.qq-row { display: flex; align-items: center; gap: 10px; }
.qq-label-row { margin-bottom: 4px; }
.qq-label-row label { color: #555; flex: 1; }
.qq-muted { color: var(--qq-muted); font-size: 12px; }

textarea#InputBox {
    width: 100%; min-height: 36px; max-height: 120px; resize: vertical; padding: 7px 8px;
    border: 1px solid var(--qq-border); border-radius: 4px; font: inherit; background: var(--qq-card); color: inherit;
}
textarea#InputBox:focus { outline: 2px solid var(--qq-accent); outline-offset: -1px; border-color: transparent; }

.qq-preview {
    margin-top: 12px; height: 300px; border: 1px solid #e0e0e0; border-radius: 4px; padding: 8px;
    display: flex; align-items: center; justify-content: center;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; /* shows transparency */
}
.qq-svg { width: 100%; height: 100%; display: flex; justify-content: center; }
.qq-svg svg { width: auto; height: 100%; max-width: 100%; display: block; }
.qq-placeholder { background: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; color: #999; padding: 24px; }

.qq-warning { margin-top: 6px; color: var(--qq-warn); font-size: 12px; }

.qq-btn {
    display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px;
    border: 1px solid #b8b8b8; border-radius: 4px; background: #f3f3f3; color: inherit; font: inherit; cursor: pointer;
}
.qq-btn:hover:not(:disabled) { background: #e8e8e8; }
.qq-btn:disabled { opacity: .5; cursor: default; }
.qq-btn.qq-small { height: 24px; padding: 0 8px; font-size: 12px; }
.qq-btn.qq-primary { background: var(--qq-accent); border-color: var(--qq-accent); color: #fff; }
.qq-btn.qq-primary:hover:not(:disabled) { background: var(--qq-accent-hover); }

.qq-history { position: relative; }
.qq-menu {
    position: absolute; right: 0; top: calc(100% + 2px); z-index: 10; width: 320px; max-height: 360px; overflow: auto;
    background: var(--qq-card); border: 1px solid var(--qq-border); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 4px;
}
.qq-menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qq-menu-item:hover { background: var(--qq-hover); }
.qq-menu-empty { padding: 8px; color: var(--qq-muted); }
.qq-menu hr { border: 0; border-top: 1px solid #e5e5e5; margin: 4px 0; }

.qq-style { margin-top: 8px; }
.qq-toggle { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 6px; }
.qq-chevron { width: 12px; color: var(--qq-muted); }
.qq-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin: 6px 0 0 4px; }
.qq-grid > span { color: #555; }

.qq-seg { display: flex; }
.qq-seg button {
    flex: 1; min-width: 0; height: 28px; border: 1px solid #c8c8c8; margin-left: -1px; background: #fff;
    font: inherit; font-size: 12px; color: inherit; cursor: pointer; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qq-seg button:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.qq-seg button:last-child { border-radius: 0 4px 4px 0; }
.qq-seg button:hover { background: var(--qq-hover); }
.qq-seg button.on { background: var(--qq-accent); border-color: var(--qq-accent); color: #fff; position: relative; }

.qq-colours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.qq-swatch { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; border: 1px solid #b8b8b8; border-radius: 4px; background: #f3f3f3; cursor: pointer; }
.qq-swatch input[type=color] { width: 18px; height: 18px; padding: 0; border: 1px solid #888; background: none; cursor: pointer; }
.qq-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.qq-swatch input[type=color]::-webkit-color-swatch { border: 0; }
.qq-swatch.disabled { opacity: .5; cursor: default; }
.qq-check { display: flex; align-items: center; gap: 6px; }

.qq-logo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qq-file { flex: 1; min-width: 0; height: 28px; justify-content: flex-start; position: relative; overflow: hidden; }
.qq-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qq-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

select { height: 28px; border: 1px solid #b8b8b8; border-radius: 4px; background: #fff; font: inherit; color: inherit; padding: 0 4px; }
#EccSelect { width: 100%; }
.qq-hint { color: #777; font-size: 11.5px; margin-top: 2px; }
.qq-right { display: flex; justify-content: flex-end; }

.qq-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.qq-actions select { height: 32px; }
.qq-status { margin-top: 8px; color: #666; font-size: 12px; min-height: 17px; }
