/* JcoLabs Tools Store */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --green: #2A4538;
  --green-mid: #3d6152;
  --amber: #C8845A;
  --cream: #F5F0E8;
  --cream-dk: #ece5d8;
  --card: #fffdf9;
  --line: #dfd7c8;
  --text: #1c2a23;
  --muted: #6b7c73;
  --warn: #b84040;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(42, 69, 56, .06), 0 6px 20px rgba(42, 69, 56, .06);
}
[data-theme="dark"] {
  --green: #8fbfa6;
  --green-mid: #a7cfba;
  --cream: #141c18;
  --cream-dk: #1c2621;
  --card: #1a241f;
  --line: #2e3b34;
  --text: #e8e2d6;
  --muted: #9aa89f;
  --warn: #e07b7b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--text);
  font: 300 16px/1.55 'Jost', sans-serif;
}
h1, h2, h3 { font-family: 'Cormorant', serif; font-weight: 600; color: var(--green); margin: 0 0 .4em; line-height: 1.15; }
a { color: var(--green); }
[hidden] { display: none !important; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }

/* Header / footer */
.st-beta { background: var(--amber); color: #fff; text-align: center; font-size: .82rem; padding: 4px 16px; font-weight: 500; }
.st-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 32px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.st-brand { font-family: 'Cormorant', serif; font-size: 1.6rem; font-weight: 700; text-decoration: none; color: var(--green); }
.st-brand span { color: var(--amber); font-weight: 600; }
.st-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 400; color: var(--text); }
.st-nav a:hover { background: var(--cream-dk); }
.st-nav a.on { background: var(--green); color: var(--cream); }
.st-lang { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: 500 .8rem 'Jost', sans-serif; }
.st-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px; }
.st-footer { display: flex; gap: 20px; justify-content: center; padding: 20px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }
.st-footer a { color: var(--muted); }

/* Buttons & bits */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--green); background: var(--green); color: var(--cream); padding: 10px 20px; border-radius: 999px; font: 500 .95rem 'Jost', sans-serif; cursor: pointer; text-decoration: none; transition: filter .15s; }
.st-btn:hover { filter: brightness(1.1); }
.st-btn:disabled { opacity: .6; cursor: wait; }
.st-btn-ghost { background: transparent; color: var(--green); }
.st-btn-danger { border-color: var(--warn); color: var(--warn); }
.st-btn.st-btn-danger:not(.st-btn-ghost) { background: var(--warn); color: #fff; }
.st-btn-block { width: 100%; margin-top: 12px; }
.st-link { background: none; border: none; color: var(--amber); cursor: pointer; font: 500 .9rem 'Jost', sans-serif; padding: 0; }
.st-muted { color: var(--muted); }
.st-badge { display: inline-block; font-size: .75rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--cream-dk); color: var(--muted); white-space: nowrap; }
.st-badge-on { background: rgba(42, 69, 56, .12); color: var(--green); }
.st-badge-warn { background: rgba(200, 132, 90, .18); color: var(--amber); }
.st-cat, .st-tag { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 6px; background: var(--cream-dk); color: var(--muted); }
.st-cat { color: var(--green); font-weight: 500; }
.st-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--cream-dk); font-size: 1.4rem; flex: none; }
.st-icon-lg { width: 64px; height: 64px; font-size: 2rem; margin-bottom: 12px; }
.st-error { color: var(--warn); font-size: .9rem; }
.st-empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Catalogue */
.st-hero { text-align: center; padding: 16px 0 28px; }
.st-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.st-hero p { color: var(--muted); margin: 0 0 22px; }
.st-search { position: relative; max-width: 620px; margin: 0 auto; }
.st-search input { width: 100%; padding: 16px 52px 16px 22px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: 400 1.05rem 'Jost', sans-serif; box-shadow: var(--shadow); outline: none; }
.st-search input:focus { border-color: var(--green); }
.st-search kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); border-radius: 5px; padding: 0 7px; color: var(--muted); font-size: .8rem; }
.st-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.st-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.st-chip { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 6px 14px; border-radius: 999px; cursor: pointer; font: 400 .9rem 'Jost', sans-serif; }
.st-chip.on { background: var(--green); border-color: var(--green); color: var(--cream); }
.st-toolbar select { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 7px 12px; border-radius: 8px; font: 400 .9rem 'Jost', sans-serif; }
.st-count { min-height: 1.4em; color: var(--muted); font-size: .9rem; margin: 4px 0 10px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.st-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.st-card:hover { transform: translateY(-2px); border-color: var(--amber); }
.st-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.st-card h3 { font-size: 1.45rem; }
.st-tagline { color: var(--muted); font-size: .95rem; margin: 0 0 16px; flex: 1; }
.st-card-foot { display: flex; justify-content: space-between; align-items: center; }
.st-price { font-weight: 500; color: var(--green); }
.st-price small, .st-plan-price small { font-weight: 300; color: var(--muted); }

/* Product */
.st-back { display: inline-block; margin-bottom: 20px; text-decoration: none; color: var(--muted); }
.st-product { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.st-product h1 { font-size: 2.6rem; }
.st-lead { font-size: 1.15rem; margin: 0 0 16px; }
.st-desc { color: var(--muted); white-space: pre-line; }
.st-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.st-buy { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); position: sticky; top: 20px; }
.st-buy h2 { font-size: 1.5rem; }
.st-plans { display: grid; gap: 10px; }
.st-plan { display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.st-plan:has(input:checked) { border-color: var(--green); background: rgba(42, 69, 56, .05); }
.st-plan input { accent-color: var(--green); grid-row: span 2; }
.st-plan-name { font-weight: 500; }
.st-plan-price { text-align: right; font-weight: 500; color: var(--green); }
.st-plan-note { grid-column: 2 / 4; font-size: .82rem; color: var(--muted); }
.st-save { color: var(--amber); font-weight: 500; }
.st-assure { list-style: none; padding: 0; margin: 16px 0 0; font-size: .85rem; color: var(--muted); }
.st-assure li::before { content: '✓ '; color: var(--green); font-weight: 600; }

/* Account */
.st-page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.st-page-head h1 { font-size: 2.3rem; }
.st-subs { display: grid; gap: 14px; }
.st-sub { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr auto; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.st-sub-new { border-color: var(--amber); }
.st-sub-main { display: flex; gap: 14px; align-items: center; }
.st-sub h3 { font-size: 1.3rem; margin: 0; }
.st-sub h3 a { text-decoration: none; }
.st-sub p { margin: 0; font-size: .9rem; }
.st-sub-status, .st-sub-key { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; align-items: flex-start; }
.st-sub-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.st-history { margin-top: 28px; color: var(--muted); }
.st-history summary { cursor: pointer; }
.st-history li { margin: 6px 0; }

/* Admin */
.st-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.st-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.st-table th, .st-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.st-table th { font-weight: 500; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.st-table tr:last-child td { border-bottom: none; }
.st-off td { opacity: .55; }
.st-form { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.st-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.st-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.st-form input, .st-form select, .st-form textarea { border: 1px solid var(--line); background: var(--cream); color: var(--text); padding: 9px 11px; border-radius: 8px; font: 400 .95rem 'Jost', sans-serif; }
.st-form .st-span2 { grid-column: span 2; }
.st-form .st-check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }

/* Auth & account */
.st-auth { max-width: 420px; margin: 24px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.st-auth h1 { font-size: 2.2rem; }
.st-auth-form { display: grid; gap: 14px; margin-top: 18px; }
.st-auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.st-auth-form input { border: 1px solid var(--line); background: var(--cream); color: var(--text); padding: 11px 12px; border-radius: 8px; font: 400 1rem 'Jost', sans-serif; }
.st-auth .st-btn-block { margin-top: 4px; }
.st-small { font-size: .85rem; }
.st-ok { color: var(--green); font-weight: 500; }
.st-logout { display: inline; margin: 0 4px 0 8px; }
.st-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.st-profile .st-form { margin-top: 0; }
.st-form-grid.st-form-1 { grid-template-columns: 1fr; }
.st-form input:disabled { opacity: .7; }
.st-section { margin-top: 36px; }
.st-actions-cell { white-space: nowrap; }
.st-actions-cell .st-link { margin-right: 10px; }
.st-link-danger { color: var(--warn); }
.st-copy-input { width: 100%; border: 1px solid var(--line); background: var(--cream); color: var(--text); padding: 9px 11px; border-radius: 8px; font: 400 .85rem ui-monospace, Menlo, monospace; }

/* Modal & toast */
.st-modal-bg { position: fixed; inset: 0; background: rgba(20, 28, 24, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.st-modal { background: var(--card); border-radius: var(--radius); padding: 26px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.st-modal h2 { font-size: 1.6rem; }
.st-modal-body p { margin: 0 0 10px; }
.st-modal-body p:first-child { font-weight: 500; }
.st-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.st-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: var(--cream); padding: 10px 20px; border-radius: 999px; z-index: 60; box-shadow: var(--shadow); }

/* Responsive */
@media (max-width: 820px) {
  .st-product { grid-template-columns: 1fr; }
  .st-buy { position: static; }
  .st-sub { grid-template-columns: 1fr 1fr; }
  .st-sub-actions { justify-content: flex-start; }
  .st-profile { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .st-header, .st-main { padding: 16px; }
  .st-nav { width: 100%; }
  .st-sub { grid-template-columns: 1fr; }
  .st-form-grid { grid-template-columns: 1fr; }
  .st-form .st-span2 { grid-column: auto; }
  .st-product h1 { font-size: 2rem; }
}
