/* =====================================================================
 * shadcn/ui design language, hand-ported to plain CSS.
 *
 * This is not the React package - a static PWA can't run a build step -
 * but the tokens, the radius scale, the variant names and the component
 * anatomy are shadcn's, so anything here drops into a real shadcn app
 * with the class names it already expects.
 * Base: "new-york", neutral. Tokens are HSL triplets consumed through
 * hsl(var(--token)), which is how shadcn's Tailwind preset wires them.
 * ===================================================================== */

:root{
  --background:0 0% 100%;
  --foreground:240 10% 3.9%;
  --card:0 0% 100%;
  --card-foreground:240 10% 3.9%;
  --popover:0 0% 100%;
  --popover-foreground:240 10% 3.9%;
  --primary:240 5.9% 10%;
  --primary-foreground:0 0% 98%;
  --secondary:240 4.8% 95.9%;
  --secondary-foreground:240 5.9% 10%;
  --muted:240 4.8% 95.9%;
  --muted-foreground:240 3.8% 46.1%;
  --accent:240 4.8% 95.9%;
  --accent-foreground:240 5.9% 10%;
  --destructive:0 72.2% 50.6%;
  --destructive-foreground:0 0% 98%;
  --success:142 71% 29%;
  --warning:38 92% 40%;
  --border:240 5.9% 90%;
  --input:240 5.9% 90%;
  --ring:240 10% 3.9%;
  --radius:0.5rem;
  color-scheme:light;
}
.dark{
  --background:240 10% 3.9%;
  --foreground:0 0% 98%;
  --card:240 10% 3.9%;
  --card-foreground:0 0% 98%;
  --popover:240 10% 3.9%;
  --popover-foreground:0 0% 98%;
  --primary:0 0% 98%;
  --primary-foreground:240 5.9% 10%;
  --secondary:240 3.7% 15.9%;
  --secondary-foreground:0 0% 98%;
  --muted:240 3.7% 15.9%;
  --muted-foreground:240 5% 64.9%;
  --accent:240 3.7% 15.9%;
  --accent-foreground:0 0% 98%;
  --destructive:0 62.8% 45%;
  --destructive-foreground:0 0% 98%;
  --success:142 60% 55%;
  --warning:38 92% 62%;
  --border:240 3.7% 15.9%;
  --input:240 3.7% 15.9%;
  --ring:240 4.9% 83.9%;
  color-scheme:dark;
}

*{box-sizing:border-box;border-color:hsl(var(--border))}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:hsl(var(--background));
  color:hsl(var(--foreground));
  font-family:"Geist",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  font-size:14px;line-height:1.5;
  -webkit-font-smoothing:antialiased;
  font-feature-settings:"rlig" 1,"calt" 1;
}
:root{--mono:"Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace}

h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.02em;text-wrap:balance}
p{margin:0}
a{color:inherit;text-underline-offset:4px}
:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ---------------------------------------------------------- button */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  white-space:nowrap;border-radius:calc(var(--radius) - 2px);
  font-size:.875rem;font-weight:500;line-height:1.25rem;
  height:2.25rem;padding:0 1rem;border:1px solid transparent;
  background:none;cursor:pointer;
  transition:background-color .15s,color .15s,border-color .15s,opacity .15s;
  -webkit-tap-highlight-color:transparent;
}
.btn:disabled{pointer-events:none;opacity:.5}
.btn svg{width:1rem;height:1rem;flex:none}

.btn-default{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}
.btn-default:hover{background:hsl(var(--primary)/.9)}
.btn-secondary{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground))}
.btn-secondary:hover{background:hsl(var(--secondary)/.8)}
.btn-outline{border-color:hsl(var(--input));background:hsl(var(--background))}
.btn-outline:hover{background:hsl(var(--accent));color:hsl(var(--accent-foreground))}
.btn-ghost:hover{background:hsl(var(--accent));color:hsl(var(--accent-foreground))}
.btn-destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}
.btn-destructive:hover{background:hsl(var(--destructive)/.9)}
.btn-link{color:hsl(var(--primary));text-decoration:underline;height:auto;padding:0}

.btn-sm{height:2rem;padding:0 .75rem;font-size:.8125rem;border-radius:calc(var(--radius) - 2px)}
.btn-lg{height:2.5rem;padding:0 2rem}
.btn-icon{height:2.25rem;width:2.25rem;padding:0}

/* ------------------------------------------------------------ card */
.card{
  border:1px solid hsl(var(--border));border-radius:var(--radius);
  background:hsl(var(--card));color:hsl(var(--card-foreground));
  box-shadow:0 1px 2px 0 rgb(0 0 0/.04);
}
.card-header{display:flex;flex-direction:column;gap:.375rem;padding:1.25rem 1.25rem .75rem}
.card-title{font-size:1rem;font-weight:600;line-height:1.2}
.card-description{font-size:.875rem;color:hsl(var(--muted-foreground));line-height:1.45}
.card-content{padding:.75rem 1.25rem 1.25rem}
.card-footer{display:flex;align-items:center;gap:.5rem;padding:0 1.25rem 1.25rem;flex-wrap:wrap}

/* ----------------------------------------------------------- input */
.label{
  display:block;font-size:.875rem;font-weight:500;line-height:1.2;
  margin-bottom:.5rem;
}
.label .muted{font-weight:400;color:hsl(var(--muted-foreground))}
.input,.textarea,.select{
  display:block;width:100%;border-radius:calc(var(--radius) - 2px);
  border:1px solid hsl(var(--input));background:hsl(var(--background));
  color:hsl(var(--foreground));
  font-size:.875rem;font-family:inherit;line-height:1.4;
  padding:.5rem .75rem;min-height:2.25rem;
  transition:border-color .15s,box-shadow .15s;
}
.input::placeholder,.textarea::placeholder{color:hsl(var(--muted-foreground))}
.input:focus-visible,.textarea:focus-visible,.select:focus-visible{
  outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 2px hsl(var(--ring)/.25);
}
.input:disabled,.textarea:disabled,.select:disabled{opacity:.5;cursor:not-allowed}
.textarea{min-height:5rem;resize:vertical;font-family:var(--mono);font-size:.8125rem;line-height:1.55}
.select{
  appearance:none;padding-right:2rem;cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .5rem center;background-size:1rem;
}
.field{margin-bottom:1rem}
.field:last-child{margin-bottom:0}
.hint{font-size:.8125rem;color:hsl(var(--muted-foreground));margin-top:.375rem;line-height:1.45}

/* ---------------------------------------------------------- switch */
.switch{display:inline-flex;align-items:center;gap:.625rem;cursor:pointer;font-size:.875rem}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch .track{
  width:2.25rem;height:1.25rem;border-radius:9999px;flex:none;
  background:hsl(var(--input));position:relative;transition:background-color .15s;
}
.switch .track::after{
  content:"";position:absolute;top:2px;left:2px;width:1rem;height:1rem;border-radius:9999px;
  background:hsl(var(--background));box-shadow:0 1px 2px rgb(0 0 0/.2);
  transition:transform .15s;
}
.switch input:checked + .track{background:hsl(var(--primary))}
.switch input:checked + .track::after{transform:translateX(1rem)}
.switch input:focus-visible + .track{outline:2px solid hsl(var(--ring));outline-offset:2px}

/* ----------------------------------------------------------- badge */
.badge{
  display:inline-flex;align-items:center;gap:.25rem;
  border-radius:9999px;border:1px solid transparent;
  padding:.125rem .625rem;font-size:.75rem;font-weight:500;line-height:1.25rem;
  white-space:nowrap;
}
.badge-default{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}
.badge-secondary{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground))}
.badge-outline{border-color:hsl(var(--border));color:hsl(var(--foreground))}
.badge-destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}
.badge-success{background:hsl(var(--success)/.14);color:hsl(var(--success));border-color:hsl(var(--success)/.3)}
.badge-warning{background:hsl(var(--warning)/.14);color:hsl(var(--warning));border-color:hsl(var(--warning)/.3)}

/* ------------------------------------------------------------ tabs */
.tabs-list{
  display:inline-flex;align-items:center;gap:.25rem;flex-wrap:wrap;max-width:100%;
  background:hsl(var(--muted));padding:.25rem;border-radius:calc(var(--radius) - 2px);
}
.tabs-trigger{
  display:inline-flex;align-items:center;justify-content:center;gap:.375rem;
  border:none;background:none;cursor:pointer;
  padding:.375rem .75rem;border-radius:calc(var(--radius) - 4px);
  font-size:.8125rem;font-weight:500;color:hsl(var(--muted-foreground));
  transition:background-color .15s,color .15s;white-space:nowrap;
}
.tabs-trigger:hover{color:hsl(var(--foreground))}
.tabs-trigger[data-state="active"]{
  background:hsl(var(--background));color:hsl(var(--foreground));
  box-shadow:0 1px 2px rgb(0 0 0/.08);
}
.tab-panel[hidden]{display:none}

/* ----------------------------------------------------------- alert */
.alert{
  position:relative;border:1px solid hsl(var(--border));border-radius:var(--radius);
  padding:.875rem 1rem;display:flex;gap:.75rem;align-items:flex-start;
  background:hsl(var(--background));
}
.alert svg{width:1rem;height:1rem;flex:none;margin-top:.15rem}
.alert-title{font-weight:600;font-size:.875rem;margin-bottom:.2rem;line-height:1.3}
.alert-description{font-size:.8125rem;color:hsl(var(--muted-foreground));line-height:1.5}
.alert-destructive{border-color:hsl(var(--destructive)/.5);color:hsl(var(--destructive))}
.alert-destructive .alert-description{color:hsl(var(--destructive)/.85)}
.alert-warning{border-color:hsl(var(--warning)/.5);background:hsl(var(--warning)/.07)}
.alert-warning .alert-title{color:hsl(var(--warning))}
.alert-success{border-color:hsl(var(--success)/.45);background:hsl(var(--success)/.07)}
.alert-success .alert-title{color:hsl(var(--success))}

/* -------------------------------------------------------- progress */
.progress{height:.5rem;width:100%;overflow:hidden;border-radius:9999px;background:hsl(var(--secondary))}
.progress-bar{height:100%;background:hsl(var(--primary));transition:width .35s ease;border-radius:9999px}

/* ------------------------------------------------------- separator */
.separator{height:1px;width:100%;background:hsl(var(--border));border:none;margin:1rem 0}

/* ------------------------------------------------------- accordion */
.accordion-item{border-bottom:1px solid hsl(var(--border))}
.accordion-trigger{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.875rem 0;font-size:.875rem;font-weight:500;text-align:left;
  background:none;border:none;cursor:pointer;color:inherit;
}
.accordion-trigger:hover{text-decoration:underline}
.accordion-trigger svg{width:1rem;height:1rem;transition:transform .2s;color:hsl(var(--muted-foreground))}
details[open] > .accordion-trigger svg{transform:rotate(180deg)}
.accordion-content{padding:0 0 1rem;font-size:.8125rem;color:hsl(var(--muted-foreground));line-height:1.6}
.accordion-content p{margin-bottom:.625rem}
.accordion-content ol,.accordion-content ul{margin:0 0 .625rem;padding-left:1.15rem}
.accordion-content li{margin-bottom:.35rem}
summary{list-style:none;cursor:pointer}
summary::-webkit-details-marker{display:none}

/* ------------------------------------------------------------ code */
code,kbd{
  font-family:var(--mono);font-size:.8125em;
  background:hsl(var(--muted));border-radius:calc(var(--radius) - 4px);
  padding:.1rem .3rem;
}
kbd{border:1px solid hsl(var(--border));font-size:.75em}
pre{
  font-family:var(--mono);font-size:.75rem;line-height:1.6;margin:0 0 .625rem;
  background:hsl(var(--muted));border-radius:calc(var(--radius) - 2px);
  padding:.625rem .75rem;overflow-x:auto;color:hsl(var(--foreground));
  white-space:pre;
}
pre code{background:none;padding:0}

/* -------------------------------------------------------- skeleton */
.skeleton{background:hsl(var(--muted));border-radius:calc(var(--radius) - 2px);animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}
@keyframes pulse{50%{opacity:.5}}

/* utilities used across the page */
.muted{color:hsl(var(--muted-foreground))}
.mono{font-family:var(--mono)}
.row{display:flex;gap:.75rem;flex-wrap:wrap}
.row>*{flex:1 1 12rem;min-width:0}
.stack{display:flex;flex-direction:column;gap:1rem}
.between{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.tiny{font-size:.75rem}
.tnum{font-variant-numeric:tabular-nums}
