/* CGS Card Cutter v1.1.0 - Navy / Gold / Ivory */
:root {
  --navy: #13203C;
  --navy-2: #1d2f57;
  --gold: #B8902E;
  --gold-2: #d2ab4d;
  --ivory: #F6F1E6;
  --ink: #1b2233;
  --muted: #6b7280;
  --line: #e2dccb;
  --card: #ffffff;
  --err: #b42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.cgscc-body {
  background: var(--ivory);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Malayalam", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.cgscc-app { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.cgscc-top {
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 3px solid var(--gold);
}
.cgscc-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.cgscc-logo { font-size: 22px; }
.cgscc-site { color: var(--gold-2); text-decoration: none; font-size: 13px; }
.cgscc-site:hover { text-decoration: underline; }

/* Hero */
.cgscc-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 38px 24px 54px;
  text-align: center;
}
.cgscc-hero-badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px; letter-spacing: .6px; text-transform: uppercase;
  margin-bottom: 14px;
}
.cgscc-hero h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; }
.cgscc-hero p { margin: 0 auto; max-width: 640px; color: #cdd5e6; }
.cgscc-privacy {
  display: inline-block; margin-top: 16px;
  background: rgba(255,255,255,.08); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: #e9eefb;
}

/* Main */
.cgscc-main { width: 100%; max-width: 1180px; margin: -30px auto 0; padding: 0 16px 40px; flex: 1; }
.cgscc-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(19,32,60,.08);
  margin-bottom: 16px;
}
.cgscc-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.cgscc-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.cgscc-field.cgscc-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; padding-bottom: 8px; }
.cgscc-input {
  font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; background: #fff; width: 100%;
}
.cgscc-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Drop zone */
.cgscc-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cgscc-drop {
  display: block; cursor: pointer; text-align: center;
  border: 2px dashed var(--gold); border-radius: 14px;
  background: #fffdf7; padding: 34px 16px;
  transition: background .15s, transform .15s;
}
.cgscc-drop:hover, .cgscc-drop.over { background: #fff6dc; transform: translateY(-1px); }
.cgscc-drop-ico { font-size: 30px; color: var(--gold); line-height: 1; }
.cgscc-drop-t { font-weight: 700; margin-top: 8px; color: var(--navy); }
.cgscc-drop-s { font-size: 13px; color: var(--muted); margin-top: 2px; }

.cgscc-status { min-height: 22px; margin: 10px 2px; font-size: 13px; color: var(--navy); }
.cgscc-log { margin-top: 12px; font-size: 13px; }
.cgscc-log-line.err { color: var(--err); }

.cgscc-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.cgscc-count { font-size: 13px; color: var(--muted); }
.cgscc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.cgscc-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block;
  transition: transform .1s, box-shadow .15s;
}
.cgscc-btn:hover { box-shadow: 0 4px 12px rgba(19,32,60,.12); transform: translateY(-1px); }
.cgscc-btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.cgscc-btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.cgscc-btn-ghost { background: transparent; }

/* Rows */
.cgscc-list { display: flex; flex-direction: column; gap: 14px; }
.cgscc-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cgscc-row.skipped { opacity: .5; }
.cgscc-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #faf7ef; border-bottom: 1px solid var(--line); }
.cgscc-row-head .cgscc-input { width: auto; flex: 1 1 160px; max-width: 260px; }
.cgscc-badge { background: var(--navy); color: var(--gold-2); border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.cgscc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.cgscc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.cgscc-tile { min-width: 0; }
.cgscc-tile-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cgscc-side { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--muted); }
.cgscc-warn { font-size: 11px; background: #fff1d6; color: #8a5a00; border-radius: 6px; padding: 1px 6px; }
.cgscc-thumb { background: #f1efe8; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; justify-content: center; }
.cgscc-card-canvas { max-width: 100%; max-height: 260px; width: auto; height: auto; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.cgscc-empty { border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; padding: 40px 8px; }
.cgscc-tile-actions { display: flex; gap: 6px; margin-top: 8px; }
.cgscc-ico { font: inherit; font-size: 16px; width: 36px; height: 34px; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 8px; cursor: pointer; }
.cgscc-ico:hover { background: var(--navy); color: #fff; }

/* Footer */
.cgscc-foot { background: var(--navy); color: #cdd5e6; text-align: center; padding: 18px 16px; font-size: 13px; border-top: 3px solid var(--gold); }
.cgscc-foot-s { color: var(--gold-2); margin-top: 4px; font-size: 12px; }

/* Modal */
.cgscc-modal { position: fixed; inset: 0; background: rgba(10,16,30,.65); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.cgscc-modal-box { background: #fff; border-radius: 14px; max-width: min(96vw, 1100px); max-height: 94vh; overflow: auto; padding: 16px; }
.cgscc-modal-box h3 { margin: 0 0 6px; color: var(--navy); }
.cgscc-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.cgscc-stage { position: relative; display: inline-block; line-height: 0; border: 1px solid var(--line); max-width: 100%; }
.cgscc-base, .cgscc-ov { max-width: 100%; height: auto; display: block; }
.cgscc-ov { position: absolute; left: 0; top: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.cgscc-modal-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Login gate */
.cgscc-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.cgscc-gate-card { background: var(--ivory); border-top: 4px solid var(--gold); border-radius: 16px; padding: 32px; max-width: 420px; text-align: center; }
.cgscc-gate-card h1 { margin: 6px 0 8px; color: var(--navy); font-size: 24px; }
.cgscc-gate-icon { font-size: 40px; }

@media (max-width: 720px) {
  .cgscc-tiles { grid-template-columns: 1fr; }
  .cgscc-top { padding: 10px 14px; }
  .cgscc-hero { padding: 28px 16px 46px; }
}
