:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --color-blue: #00F0FF;
  --color-cyan: #00F0FF;
  --color-pink: #FF2A5F;
  --color-purple: #8a2be2;
  --color-emerald: #10b981;
  --color-amber: #FACC15;

  --bg-body: #F4F0EB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F4F0EB;
  --border-card: #050505;
  --text-main: #050505;
  --text-muted: #333333;
  --nav-bg: #F4F0EB;
  --input-bg: #FFFFFF;

  --shadow-sm: 4px 4px 0px #050505;
  --shadow-md: 6px 6px 0px #050505;
  --shadow-lg: 8px 8px 0px #050505;
}

[data-theme="dark"], html.dark {
  --bg-body: #050505;
  --bg-card: #0a0a0f;
  --bg-card-hover: #11111a;
  --border-card: #F4F0EB;
  --text-main: #F4F0EB;
  --text-muted: #cccccc;
  --nav-bg: #050505;
  --input-bg: #0a0a0f;

  --shadow-sm: 4px 4px 0px #FACC15;
  --shadow-md: 6px 6px 0px #FF2A5F;
  --shadow-lg: 8px 8px 0px #00F0FF;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
}

/* Global Brutalist Overrides */
* { border-color: var(--border-card) !important; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.btn-primary, .btn-secondary, button, .btn-ms-blue {
  border: 2px solid var(--border-card) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: 0 !important;
  text-transform: uppercase;
  font-weight: 900 !important;
  font-family: var(--font-sans) !important;
}
.btn-primary:hover, .btn-secondary:hover, button:hover, .btn-ms-blue:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: var(--shadow-md) !important;
}

input, textarea, select {
  border: 2px solid var(--border-card) !important;
  border-radius: 0 !important;
  background-color: var(--input-bg) !important;
  color: var(--text-main) !important;
  font-family: var(--font-mono) !important;
  box-shadow: var(--shadow-sm) !important;
}

.card-tilt, .stat-box, .faq-card, .katalog-slide-card, .ms-product-card, .katalog-sidebar, .katalog-item-card {
  border: 3px solid var(--border-card) !important;
  border-radius: 0 !important;
  box-shadow: var(--shadow-md) !important;
  background-color: var(--bg-card) !important;
}

.hologram-tag, .hologram-val, .katalog-price-tag, .stat-num { font-family: var(--font-mono) !important; }
.ms-card-price, .badge-pill-cat, .badge-pill-status, .katalog-price, .changelog-version {
  font-family: var(--font-mono) !important;
  text-transform: uppercase;
  border: 2px solid var(--border-card) !important;
  box-shadow: 2px 2px 0px var(--border-card) !important;
  border-radius: 0 !important;
}

.header-two-tier { border-bottom: 3px solid var(--border-card) !important; background: var(--nav-bg) !important; }
.top-header-row { border-bottom: 2px solid var(--border-card) !important; padding: 10px 20px; }
.header-subnav-row { display: flex; border-bottom: 3px solid var(--border-card) !important; }
.subnav-tab { border-right: 2px solid var(--border-card) !important; padding: 15px 25px !important; font-weight: 900 !important; text-transform: uppercase; color: var(--text-main) !important; }
.subnav-tab:hover { background-color: var(--color-pink) !important; color: #fff !important; }
.brand-logo { font-size: 2rem !important; font-weight: 900 !important; text-transform: uppercase; letter-spacing: -1px; }
.brand-dot, .brand-badge-tag { display: none !important; }
.header-search-wrap input { border: 3px solid var(--border-card) !important; box-shadow: 4px 4px 0px var(--border-card) !important; font-family: var(--font-mono) !important; }


[data-theme="dark"] {
--bg-page: #0b0f19;
--text-color: #e2e8f0;
--text-muted: #94a3b8;
--text-light: #64748b;
--link-color: #60a5fa;
--link-hover: #93c5fd;
--box-bg: rgba(17, 24, 39, 0.75);
--box-bg-hover: rgba(24, 33, 53, 0.9);
--box-border: #2d3748;
--box-border-strong: #4f46e5;
--btn-submit-bg: #4f46e5;
--btn-submit-border: #4338ca;
--btn-submit-hover: #3730a3;
--btn-submit-text: #ffffff;
--panel-border: rgba(55, 65, 81, 0.7);
--input-bg: rgba(15, 23, 42, 0.85);
--input-border: #334155;
--mascot-color: #cbd5e1;
--mascot-opacity: 0.22;
--petal-color: rgba(244, 114, 182, 0.35);
--sky-grad: linear-gradient(135deg, #090d16 0%, #1e1b4b 50%, #180d2b 100%);
--grid-color: rgba(99, 102, 241, 0.05);
--kanji-color: rgba(255, 255, 255, 0.03);
--progress-track: rgba(30, 41, 59, 0.8);
--progress-bar: linear-gradient(90deg, #818cf8, #6366f1);
}

*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
background-color: var(--bg-page);
color: var(--text-color);
font-family: var(--font-base);
font-size: 13px;
line-height: 1.6;
min-height: 100vh;
display: flex;
justify-content: center;
position: relative;
overflow-x: hidden;
}

.sky-bg {
position: fixed;
inset: 0;
background: var(--sky-grad);
background-size: 200% 200%;
animation: skyShift 18s ease infinite;
z-index: 0;
pointer-events: none;
}

.grid-overlay {
position: fixed;
inset: 0;
background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                  linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
background-size: 32px 32px;
z-index: 0;
pointer-events: none;
}

.kanji-bg {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: var(--font-heading);
font-size: clamp(8rem, 20vw, 18rem);
font-weight: 800;
color: var(--kanji-color);
user-select: none;
pointer-events: none;
z-index: 0;
letter-spacing: 0.1em;
white-space: nowrap;
}

.petal-layer {
position: fixed;
inset: 0;
pointer-events: none;
overflow: hidden;
z-index: 1;
}

.petal {
position: absolute;
top: -5%;
border-radius: 12px 1px 12px 1px;
background: var(--petal-color);
box-shadow: 0 0 6px var(--petal-color);
animation-name: fallPetal;
animation-timing-function: linear;
animation-iteration-count: infinite;
}

.p1 { left: 5%; width: 10px; height: 14px; animation-duration: 9s; animation-delay: 0s; }
.p2 { left: 16%; width: 8px; height: 11px; animation-duration: 12s; animation-delay: 2s; }
.p3 { left: 28%; width: 12px; height: 16px; animation-duration: 8s; animation-delay: 4s; }
.p4 { left: 39%; width: 7px; height: 10px; animation-duration: 14s; animation-delay: 1s; }
.p5 { left: 51%; width: 11px; height: 15px; animation-duration: 10s; animation-delay: 3s; }
.p6 { left: 63%; width: 9px; height: 13px; animation-duration: 11s; animation-delay: 5s; }
.p7 { left: 74%; width: 8px; height: 12px; animation-duration: 13s; animation-delay: 2.5s; }
.p8 { left: 82%; width: 12px; height: 15px; animation-duration: 9.5s; animation-delay: 0.5s; }
.p9 { left: 91%; width: 7px; height: 9px; animation-duration: 15s; animation-delay: 3.5s; }
.p10 { left: 96%; width: 10px; height: 13px; animation-duration: 10.5s; animation-delay: 1.5s; }

@keyframes fallPetal {
0% {
transform: translateY(0vh) translateX(0) rotate(0deg);
opacity: 0;
}
10% {
opacity: 0.8;
}
85% {
opacity: 0.8;
}
100% {
transform: translateY(108vh) translateX(65px) rotate(420deg);
opacity: 0;
}
}

@keyframes skyShift {
0%, 100% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
}

a {
color: var(--link-color);
text-decoration: none;
transition: color 0.15s ease;
}

a:hover {
color: var(--link-hover);
text-decoration: underline;
}

.catbox-layout {
width: 100%;
max-width: 580px;
padding: 24px 16px 64px;
margin: 0 auto;
text-align: center;
position: relative;
z-index: 2;
}

.top-nav-bar {
display: flex;
justify-content: flex-start;
margin-bottom: 20px;
}

.btn-back-dashboard {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 6px 12px;
background: var(--box-bg);
border: 1px solid var(--panel-border);
border-radius: 6px;
font-size: 0.78rem;
font-family: var(--font-base);
color: var(--text-color);
backdrop-filter: blur(6px);
transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.btn-back-dashboard:hover {
border-color: var(--box-border-strong);
background: var(--box-bg-hover);
text-decoration: none;
transform: translateX(-2px);
}

.catbox-header {
margin-bottom: 24px;
}

.catbox-logo {
font-family: var(--font-heading);
font-size: 2.8rem;
font-weight: 800;
letter-spacing: -1px;
line-height: 1.1;
margin-bottom: 2px;
}

.catbox-logo a {
color: var(--text-color);
text-decoration: none;
}

.catbox-logo b {
color: var(--btn-submit-bg);
}

.catbox-sublogo {
font-size: 0.85rem;
font-weight: 700;
color: var(--text-muted);
letter-spacing: 1.5px;
margin-bottom: 2px;
}

.catbox-project {
font-size: 0.75rem;
font-weight: 500;
color: var(--text-light);
margin-bottom: 8px;
}

.catbox-notice {
font-size: 0.8rem;
color: var(--text-muted);
}

.catbox-tabs {
display: inline-flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
font-size: 0.85rem;
}

.mode-btn {
background: none;
border: none;
color: var(--link-color);
font-family: var(--font-base);
font-size: 0.85rem;
cursor: pointer;
padding: 2px 4px;
text-decoration: none;
transition: color 0.15s ease;
}

.mode-btn:hover {
text-decoration: underline;
}

.mode-btn.active {
font-weight: 700;
color: var(--text-color);
text-decoration: none;
cursor: default;
}

.tab-divider {
color: var(--text-light);
font-size: 0.75rem;
}

.catbox-uploader {
margin-bottom: 24px;
}

.catbox-dropzone {
background-color: var(--box-bg);
border: 2px dashed var(--box-border);
border-radius: 10px;
padding: 36px 20px;
cursor: pointer;
backdrop-filter: blur(6px);
transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.catbox-dropzone:hover,
.catbox-dropzone.dragover {
background-color: var(--box-bg-hover);
border-color: var(--box-border-strong);
box-shadow: 0 0 16px rgba(96, 165, 250, 0.25);
transform: translateY(-2px);
}

.catbox-upload-icon {
font-size: 2.3rem;
color: var(--btn-submit-bg);
margin-bottom: 8px;
transition: transform 0.2s ease;
}

.catbox-dropzone:hover .catbox-upload-icon {
transform: translateY(-3px);
}

.main-prompt {
font-size: 0.95rem;
font-weight: 700;
color: var(--text-color);
}

.sub-prompt {
font-size: 0.75rem;
color: var(--text-muted);
margin-top: 4px;
}

.hidden-input {
display: none;
}

.catbox-preview {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}

.catbox-preview img {
max-width: 100%;
max-height: 160px;
border: 1px solid var(--box-border);
border-radius: 6px;
background: #000000;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.preview-details {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
font-size: 0.8rem;
color: var(--text-color);
flex-wrap: wrap;
}

.file-name {
font-weight: 700;
word-break: break-all;
}

.file-size {
color: var(--text-muted);
}

.btn-cancel {
background: none;
border: none;
color: #ef4444;
cursor: pointer;
font-size: 0.75rem;
font-family: var(--font-base);
transition: opacity 0.15s ease;
}

.btn-cancel:hover {
text-decoration: underline;
opacity: 0.8;
}

.catbox-url-box {
background-color: var(--box-bg);
border: 2px solid var(--box-border);
border-radius: 8px;
padding: 18px;
display: flex;
flex-direction: column;
gap: 6px;
text-align: left;
backdrop-filter: blur(6px);
}

.url-label {
font-size: 0.8rem;
font-weight: 700;
color: var(--text-color);
}

.catbox-url-box input {
width: 100%;
padding: 9px 12px;
font-family: var(--font-code);
font-size: 0.85rem;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 5px;
color: var(--text-color);
outline: none;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.catbox-url-box input:focus {
border-color: var(--box-border-strong);
box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

.upload-progress-box {
margin-top: 14px;
padding: 12px 14px;
background: var(--box-bg);
border: 1px solid var(--panel-border);
border-radius: 8px;
backdrop-filter: blur(6px);
text-align: left;
}

.progress-info {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.78rem;
margin-bottom: 6px;
}

.progress-status-text {
color: var(--text-muted);
font-family: var(--font-base);
}

.progress-percent-text {
font-family: var(--font-code);
font-weight: 700;
color: var(--link-color);
}

.progress-track {
width: 100%;
height: 7px;
background: var(--progress-track);
border-radius: 10px;
overflow: hidden;
}

.progress-bar-fill {
width: 0%;
height: 100%;
background: var(--progress-bar);
border-radius: 10px;
transition: width 0.08s linear;
}

.catbox-action {
margin-top: 14px;
}

.catbox-btn-upload {
width: 100%;
background: var(--btn-submit-bg);
border: 1px solid var(--btn-submit-border);
color: var(--btn-submit-text);
padding: 12px 16px;
font-family: var(--font-heading);
font-size: 0.95rem;
font-weight: 700;
border-radius: 6px;
cursor: pointer;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.catbox-btn-upload:hover {
background: var(--btn-submit-hover);
transform: translateY(-1px);
box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35);
}

.catbox-btn-upload:active {
transform: translateY(0);
}

.catbox-btn-upload:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
box-shadow: none;
}

.catbox-result {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 24px;
padding: 18px;
border: 1px solid var(--panel-border);
border-radius: 8px;
background: var(--box-bg);
backdrop-filter: blur(6px);
}

.result-badge {
font-size: 0.9rem;
font-weight: 700;
color: #10b981;
margin-bottom: 12px;
}

.result-thumb-box {
margin-bottom: 12px;
}

.result-thumb-box img {
max-width: 100%;
max-height: 180px;
border: 1px solid var(--box-border);
border-radius: 6px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.result-input-line {
display: flex;
align-items: stretch;
gap: 8px;
width: 100%;
margin-bottom: 14px;
}

.result-input-line input {
flex: 1;
min-width: 0;
padding: 9px 12px;
font-family: var(--font-code);
font-size: 0.85rem;
border: 1px solid var(--input-border);
background: var(--input-bg);
color: var(--text-color);
border-radius: 5px;
outline: none;
}

.catbox-btn-copy {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
flex-shrink: 0;
white-space: nowrap;
background: var(--input-bg);
border: 1px solid var(--input-border);
color: var(--text-color);
font-family: var(--font-base);
font-size: 0.8rem;
padding: 0 16px;
border-radius: 5px;
cursor: pointer;
font-weight: 700;
transition: border-color 0.15s ease, background-color 0.15s ease;
}

.catbox-btn-copy:hover {
border-color: var(--box-border-strong);
background: var(--box-bg-hover);
}

.result-links {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
font-size: 0.8rem;
width: 100%;
}

.catbox-link-btn {
background: none;
border: none;
color: var(--link-color);
font-size: 0.8rem;
cursor: pointer;
font-family: var(--font-base);
transition: color 0.15s ease;
}

.catbox-link-btn:hover {
text-decoration: underline;
}

.catbox-footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid var(--panel-border);
font-size: 0.75rem;
color: var(--text-muted);
}

.footer-nav {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 8px;
}

.footer-nav .sep {
color: var(--text-light);
}

.footer-theme-toggle {
background: none;
border: none;
color: var(--link-color);
font-size: 0.75rem;
cursor: pointer;
font-family: var(--font-base);
display: inline-flex;
align-items: center;
gap: 4px;
transition: color 0.15s ease;
}

.footer-theme-toggle:hover {
text-decoration: underline;
}

.footer-copy {
color: var(--text-light);
}

.anime-mascot-left {
position: fixed;
bottom: 10px;
left: 18px;
width: 125px;
height: 150px;
pointer-events: none;
z-index: 1;
color: var(--mascot-color);
opacity: var(--mascot-opacity);
animation: mascotFloatLeft 6s ease-in-out infinite;
}

.anime-mascot {
position: fixed;
bottom: 10px;
right: 18px;
width: 135px;
height: 162px;
pointer-events: none;
z-index: 1;
color: var(--mascot-color);
opacity: var(--mascot-opacity);
animation: mascotFloat 5s ease-in-out infinite;
}

@keyframes mascotFloat {
0%, 100% {
transform: translateY(0px) rotate(0deg);
}
50% {
transform: translateY(-8px) rotate(1deg);
}
}

@keyframes mascotFloatLeft {
0%, 100% {
transform: translateY(0px) rotate(0deg);
}
50% {
transform: translateY(-7px) rotate(-1.5deg);
}
}

.mascot-svg {
width: 100%;
height: 100%;
display: block;
}

@media (max-width: 640px) {
.anime-mascot-left {
display: none;
}
.anime-mascot {
width: 85px;
height: 102px;
opacity: 0.18;
right: 8px;
bottom: 6px;
}
}

.toast-container {
position: fixed;
top: 16px;
right: 16px;
z-index: 9999;
display: flex;
flex-direction: column;
gap: 8px;
}

.toast {
background: var(--box-bg);
backdrop-filter: blur(8px);
border: 1px solid var(--box-border);
color: var(--text-color);
padding: 9px 14px;
border-radius: 6px;
font-size: 0.8rem;
display: flex;
align-items: center;
gap: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toast-error {
border-color: #ef4444;
color: #ef4444;
}


/* Additional Brutalist UI Overrides for Admin & Modals */
table, th, td {
  border: 2px solid var(--border-card) !important;
  font-family: var(--font-mono) !important;
}

th {
  background-color: var(--text-main) !important;
  color: var(--bg-body) !important;
  text-transform: uppercase;
}

.modal-content, .modal, .admin-card, .dashboard-card {
  border: 4px solid var(--border-card) !important;
  box-shadow: 8px 8px 0px var(--border-card) !important;
  border-radius: 0 !important;
  background-color: var(--bg-card) !important;
}

.admin-sidebar {
  border-right: 4px solid var(--border-card) !important;
}

/* BUG 4 FIX: CDN LAYOUT */
body {
  background-color: #050505 !important;
  color: #F4F0EB !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.catbox-layout {
  position: relative !important;
  z-index: 10 !important;
  max-width: 680px !important;
  margin: 40px auto !important;
  padding: 20px !important;
}
.catbox-dropzone {
  background: #0d0d12 !important;
  border: 3px dashed var(--color-yellow, #e5ff00) !important;
  box-shadow: 8px 8px 0px #000 !important;
  padding: 40px 20px !important;
  color: #fff !important;
}
.catbox-tabs {
  display: flex !important;
  justify-content: center !important;
  gap: 15px !important;
  margin-bottom: 20px !important;
}
.mode-btn {
  background: #111 !important;
  color: #fff !important;
  border: 2px solid #333 !important;
  padding: 8px 16px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.mode-btn.active {
  background: var(--color-yellow, #e5ff00) !important;
  color: #000 !important;
  border-color: #000 !important;
  box-shadow: 4px 4px 0px #000 !important;
}
.catbox-btn-upload {
  background: var(--color-yellow, #e5ff00) !important;
  color: #000 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  border: 3px solid #000 !important;
  box-shadow: 6px 6px 0px #000 !important;
  padding: 16px !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  width: 100% !important;
  margin-top: 20px !important;
  transition: all 0.2s !important;
}
.catbox-btn-upload:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: 8px 8px 0px #000 !important;
  background: var(--color-pink, #ff0055) !important;
  color: #fff !important;
}

/* DROPZONE FIX */
.catbox-dropzone {
  z-index: 10 !important;
  position: relative !important;
  background: #0a0a0f !important;
  border: 3px dashed #FACC15 !important;
}
