/* Gionth tools design system — linked separately until Tailwind rebuild */

.tools-page {
  position: relative;
  min-height: 100vh;
  background-color: #f8fafc;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(37, 99, 235, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(14, 165, 233, 0.06), transparent);
}
.tools-wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}
.tools-wrap-wide {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}
@media (min-width: 640px) {
  .tools-wrap, .tools-wrap-wide { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .tools-wrap, .tools-wrap-wide { padding-left: 2rem; padding-right: 2rem; }
}

.tools-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}
.tools-crumb a {
  color: #64748b;
  font-weight: 500;
  text-decoration: none;
}
.tools-crumb a:hover { color: #1d4ed8; }

.tools-hero { margin-bottom: 2rem; }
.tools-hero-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}
.tools-hero-badge.is-det { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.tools-hero-badge.is-ai { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.tools-hero-badge.is-util { background: #f0f9ff; color: #075985; border-color: #bae6fd; }
.tools-hero h1 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}
.tools-hero p {
  font-size: 1.0625rem;
  color: #475569;
  max-width: 40rem;
  margin: 0;
  line-height: 1.625;
}

.tool-panel {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.12);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .tool-panel { padding: 2rem; } }
.tool-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #22d3ee);
}

.tool-field {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.tool-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.9);
  padding: 0.875rem 1rem;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s, background .15s;
}
.tool-input::placeholder { color: #94a3b8; }
.tool-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}
.tool-input-lg {
  font-size: 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
@media (min-width: 640px) { .tool-input-lg { font-size: 1.5rem; } }

.tool-select {
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background: #fff;
  padding: 0.75rem 0.75rem;
  color: #0f172a;
  font-weight: 600;
}
.tool-select:focus { outline: none; border-color: #3b82f6; }

.tool-btn-primary,
.tool-btn-secondary,
.tool-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  border-radius: 0.75rem;
  transition: all .15s;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.tool-btn-primary {
  background: #2563eb;
  color: #fff;
  padding: 0.875rem 1.5rem;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.tool-btn-primary:hover { background: #1d4ed8; color: #fff; }
.tool-btn-secondary {
  background: #fff;
  color: #334155;
  border: 2px solid #e2e8f0;
  padding: 0.875rem 1.5rem;
}
.tool-btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.tool-btn-ghost {
  color: #475569;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  background: transparent;
}
.tool-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

.tool-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .15s;
}
.tool-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.tool-result {
  display: none;
  margin-top: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #1e293b;
  background: #0f172a;
  padding: 1.25rem 1.5rem;
}
.tool-result.active,
.tool-result.is-open { display: block; }
.tool-result-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}
.tool-result-value {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #34d399;
  word-break: break-all;
  line-height: 1.2;
}
.tool-result-body {
  color: #e2e8f0;
  line-height: 1.7;
  font-size: 1rem;
}

.tool-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .tool-keypad { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.tool-key-num,
.tool-key-op,
.tool-key-fn,
.tool-key-del {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s, background .15s;
  user-select: none;
  background: #fff;
  color: #334155;
}
.tool-key-num:active,
.tool-key-op:active,
.tool-key-fn:active,
.tool-key-del:active { transform: scale(0.95); }
.tool-key-num { background: #f8fafc; color: #0f172a; }
.tool-key-num:hover { background: #f1f5f9; }
.tool-key-op {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 800;
}
.tool-key-op:hover { background: #dbeafe; }
.tool-key-fn:hover { background: #f8fafc; }
.tool-key-del {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.tool-key-del:hover { background: #fee2e2; }
@media (min-width: 640px) {
  .tool-keypad .sm\:col-span-3 { grid-column: span 3 / span 3; }
}

.tool-mode {
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.75);
  padding: 1rem 1.25rem;
}
.tool-mode + .tool-mode { margin-top: 1rem; }
.tool-mode h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem;
}
.tool-mode-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .tool-mode-row {
    flex-direction: row;
    align-items: flex-end;
  }
}
.tool-join {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .tool-join { padding-bottom: 0.875rem; }
}

.tool-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 5.5rem;
}
.tool-frac input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.5rem;
}
.tool-frac-bar {
  height: 2px;
  background: #94a3b8;
  border-radius: 9999px;
}
.tool-frac-result {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  padding: 0 0.75rem;
}
.tool-frac-result .num,
.tool-frac-result .den {
  font-size: 1.875rem;
  font-weight: 800;
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1;
}
.tool-frac-result .bar {
  width: 100%;
  height: 4px;
  background: #2563eb;
  border-radius: 9999px;
  margin: 0.375rem 0;
}

.tool-meta {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tool-meta dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}
@media (min-width: 640px) {
  .tool-meta dl { grid-template-columns: 1fr 1fr; }
}
.tool-meta dt {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 0.25rem;
}
.tool-meta dd {
  font-size: 0.875rem;
  color: #334155;
  margin: 0;
  line-height: 1.55;
}

.tool-workflow {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(145deg, #f8fafc, #fff);
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.tool-workflow ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-workflow a {
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  transition: all .15s;
}
.tool-workflow a:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.tool-seo {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
@media (min-width: 640px) { .tool-seo { padding: 2rem; } }
.tool-seo h2 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  margin: 0 0 0.75rem !important;
  padding: 0 !important;
  border: 0 !important;
}
.tool-seo h3 {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 1.5rem 0 0.5rem !important;
}
.tool-seo p, .tool-seo li { color: #475569; line-height: 1.7; }
.tool-seo a { color: #2563eb; font-weight: 600; }

.tools-dir-card {
  position: relative;
  display: block;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.25rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tools-dir-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px -12px rgba(37, 99, 235, 0.25);
  transform: translateY(-2px);
}
.tools-dir-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  transition: color .15s;
}
.tools-dir-card:hover h3 { color: #1d4ed8; }
.tools-dir-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-thinking {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}
.ai-thinking-dots { display: flex; gap: 0.375rem; }
.ai-thinking-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #3b82f6;
  animation: tool-bounce 1s infinite;
}
.ai-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tool-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-badge { /* legacy fallback used by older tool pages */
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  margin-bottom: 1rem;
}

/* utility helpers used in tool markup */
.tool-panel .w-full { width: 100%; }
.tool-panel .mb-4 { margin-bottom: 1rem; }
.tool-panel .mb-6 { margin-bottom: 1.5rem; }
.tool-panel .mt-5 { margin-top: 1.25rem; }
.tool-panel .flex { display: flex; }
.tool-panel .flex-1 { flex: 1 1 0%; }
.tool-panel .flex-wrap { flex-wrap: wrap; }
.tool-panel .items-center { align-items: center; }
.tool-panel .justify-center { justify-content: center; }
.tool-panel .gap-2 { gap: 0.5rem; }
.tool-panel .gap-3 { gap: 0.75rem; }
.tool-panel .gap-4 { gap: 1rem; }
.tool-panel .gap-5 { gap: 1.25rem; }
.tool-panel .shrink-0 { flex-shrink: 0; }
.tool-panel .min-w-0 { min-width: 0; }
.tool-panel .text-center { text-align: center; }
.tool-panel .hidden { display: none !important; }
.tool-panel .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.tool-btn-primary.\!px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.tool-btn-primary.\!text-xl { font-size: 1.25rem; }
.tool-btn-primary.\!py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.tool-result.\!mt-4 { margin-top: 1rem; }
.tools-hero-badge.\!mb-0 { margin-bottom: 0 !important; }
.tools-hero-badge.\!text-\[10px\] { font-size: 10px !important; }
.tools-hero-badge.\!px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.tools-hero-badge.\!py-0\.5 { padding-top: 0.125rem !important; padding-bottom: 0.125rem !important; }
.tool-select.w-16 { width: 4rem; }
.tool-select.text-center { text-align: center; }
.tool-select.text-xl { font-size: 1.25rem; }

/* Writing tools */
.tool-textarea {
  width: 100%;
  min-height: 11rem;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.9);
  padding: 1rem 1.125rem;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.tool-textarea::placeholder { color: #94a3b8; }
.tool-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}
.tool-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (min-width: 640px) {
  .tool-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}
.tool-stat {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.tool-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.tool-stat-label {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.tool-stat.is-primary {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}
.tool-stat.is-primary .tool-stat-value { color: #2563eb; }
.tool-reading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
}
.tool-form-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .tool-form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.tool-cite-out {
  margin-top: 0.75rem;
  padding: 1rem 1.125rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.75;
  word-break: break-word;
}
.tool-cite-out.is-dark {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
.tool-field-hint {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: #94a3b8;
}
.tool-mt-4 { margin-top: 1rem; }
.tool-select.w-full { width: 100%; }
.tool-panel .mb-4 { margin-bottom: 1rem; }
.tool-panel .mb-5 { margin-bottom: 1.25rem; }
.tool-panel .mt-5 { margin-top: 1.25rem; }
.tool-panel .pt-5 { padding-top: 1.25rem; }
.tool-panel .border-t { border-top: 1px solid #f1f5f9; }
.tool-panel .justify-between { justify-content: space-between; }
.tool-panel .text-xs { font-size: 0.75rem; }
.tool-panel .text-sm { font-size: 0.875rem; }
.tool-panel .text-slate-400 { color: #94a3b8; }
.tool-panel .m-0 { margin: 0; }
.tool-btn-secondary.\!py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tool-btn-secondary.\!px-4 { padding-left: 1rem; padding-right: 1rem; }

/* Grades tools — dynamic rows */
.tool-rows { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.tool-row-head {
  display: none;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
@media (min-width: 640px) {
  .tool-row-head { display: flex; }
}
.tool-dyn-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
@media (min-width: 640px) {
  .tool-dyn-row {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    background: transparent;
  }
}
.tool-dyn-row .grow { flex: 2 1 0%; min-width: 0; }
.tool-dyn-row .mid { flex: 1 1 0%; min-width: 0; }
.tool-dyn-row .sm { flex: 0.7 1 0%; min-width: 0; }
.tool-dyn-row .tool-input,
.tool-dyn-row .tool-select {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  font-size: 0.95rem;
}
.tool-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
}
@media (min-width: 640px) {
  .tool-row-remove { align-self: center; }
}
.tool-row-remove:hover { background: #fef2f2; color: #dc2626; }
.tool-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .tool-actions { flex-direction: row; }
}
.tool-result-split {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) {
  .tool-result-split {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.tool-result-meta {
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  line-height: 1.6;
}
.tool-result-meta strong { color: #f1f5f9; font-weight: 600; }
.tool-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.75rem 0;
}
.tool-mode-note {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 1rem;
  line-height: 1.5;
}
.tool-result-details {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

/* Grade planner */
.gc-privacy {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid #bae6fd;
  border-radius: .85rem;
  background: #f0f9ff;
  color: #334155;
  font-size: .875rem;
}
.gc-privacy div { flex: 1; }
.gc-link-button {
  border: 0;
  background: transparent;
  color: #0369a1;
  font-weight: 700;
  white-space: nowrap;
}
.gc-link-button:hover { text-decoration: underline; }
.gc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  margin-bottom: 1.75rem;
  padding: .3rem;
  border-radius: .85rem;
  background: #f1f5f9;
}
.gc-tab {
  padding: .7rem .85rem;
  border: 0;
  border-radius: .65rem;
  color: #64748b;
  font-weight: 700;
}
.gc-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.gc-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gc-section-heading h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.gc-section-heading p { margin: 0; color: #64748b; font-size: .9rem; }
.gc-table-head,
.gc-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(5rem, .8fr) minmax(5rem, .8fr) 2.25rem;
  gap: .65rem;
  align-items: center;
}
.gc-table-head {
  padding: 0 .35rem .45rem;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.gc-entry-row {
  margin-bottom: .65rem;
  padding: .7rem;
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
  background: #f8fafc;
}
.gc-entry-row:focus-within { border-color: #93c5fd; background: #fff; }
.gc-entry-row .tool-row-remove {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.4rem;
  line-height: 1;
}
.gc-calculate-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.gc-calculate-row label { color: #334155; font-size: .85rem; font-weight: 700; }
.gc-input-affix { position: relative; display: block; margin-top: .35rem; width: 9rem; }
.gc-input-affix input { padding-right: 2rem; }
.gc-input-affix span { position: absolute; top: 50%; right: .8rem; color: #64748b; transform: translateY(-50%); }
.gc-error {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border: 1px solid #fecaca;
  border-radius: .75rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: .9rem;
}
.gc-results { margin-top: 1.25rem; }
.gc-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.gc-metric {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  background: #fff;
}
.gc-metric-primary { border-color: #93c5fd; background: #eff6ff; }
.gc-metric span, .gc-metric small { display: block; color: #64748b; font-size: .75rem; }
.gc-metric strong { display: block; margin: .2rem 0; color: #0f172a; font-size: 1.65rem; }
.gc-metric-primary strong { color: #1d4ed8; }
.gc-guidance {
  margin-top: .85rem;
  padding: .85rem 1rem;
  border-radius: .75rem;
  background: #f1f5f9;
  color: #334155;
  font-size: .9rem;
}
.gc-guidance.is-possible, .gc-guidance.is-secured { background: #ecfdf5; color: #047857; }
.gc-guidance.is-impossible { background: #fff7ed; color: #c2410c; }
.gc-study-next {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: .85rem;
  padding: 1rem;
  border: 1px solid #dbeafe;
  border-radius: .8rem;
  background: #f8fbff;
}
.gc-study-next strong, .gc-study-next span { display: block; }
.gc-study-next strong { margin-bottom: .25rem; color: #0f172a; font-size: .9rem; }
.gc-study-next span { color: #64748b; font-size: .8rem; line-height: 1.5; }
.gc-study-next nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .4rem; }
.gc-study-next a {
  padding: .35rem .55rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.gc-study-next a:hover { border-color: #60a5fa; background: #eff6ff; }
.gc-breakdown, .gc-targets {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.gc-breakdown h3, .gc-targets h3 { margin: 0; font-size: 1rem; }
.gc-targets p { margin: .2rem 0 .8rem; color: #64748b; font-size: .82rem; }
.gc-breakdown-head,
#gc-breakdown-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .2rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .85rem;
}
.gc-breakdown-head { color: #64748b; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
#gc-breakdown-rows > div span:last-child { color: #475569; text-align: right; }
.gc-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}
.gc-target-card {
  padding: .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .7rem;
  background: #fff;
}
.gc-target-card strong, .gc-target-card span { display: block; font-size: .78rem; }
.gc-target-card span { margin-top: .15rem; color: #475569; }
.gc-target-card.is-possible { border-color: #bbf7d0; background: #f0fdf4; }
.gc-target-card.is-impossible { border-color: #fed7aa; background: #fff7ed; }
.gc-target-card.is-secured { border-color: #bae6fd; background: #f0f9ff; }
.gc-final-panel { margin-top: 1.25rem; }
.gc-final-grid { align-items: end; }
.gc-final-grid .tool-btn-primary { min-height: 46px; }
@media (max-width: 639px) {
  .gc-privacy { align-items: flex-start; flex-wrap: wrap; }
  .gc-link-button { margin-left: 1.8rem; }
  .gc-section-heading { display: block; }
  .gc-section-heading .gc-add-row { width: 100%; margin-top: .8rem; }
  .gc-table-head { display: none; }
  .gc-entry-row { grid-template-columns: 1fr 1fr 2.25rem; }
  .gc-entry-row .gc-name { grid-column: 1 / -1; }
  .gc-calculate-row { display: block; }
  .gc-input-affix { width: 100%; }
  .gc-calculate-row .tool-btn-primary { width: 100%; margin-top: .8rem; }
  .gc-metric-grid { grid-template-columns: 1fr; }
  .gc-study-next { grid-template-columns: 1fr; }
  .gc-target-grid { grid-template-columns: 1fr 1fr; }
}

.tool-actions .flex-1 { flex: 1 1 0%; }
.tool-btn-primary.flex-1 { flex: 1 1 0%; }

/* Study timer */
.tool-timer-panel { text-align: center; }
.tool-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.tool-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  transition: all .15s;
}
.tool-preset:hover { border-color: #cbd5e1; background: #fff; color: #0f172a; }
.tool-preset.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.tool-timer-stage {
  margin: 0 auto 1.75rem;
  max-width: 22rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(37, 99, 235, 0.1), transparent 70%),
    #f8fafc;
  border: 1px solid #e2e8f0;
  transition: background .25s, border-color .25s;
}
.tool-timer-stage.is-break {
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%),
    #f0fdf4;
  border-color: #bbf7d0;
}
.tool-timer-stage.is-running .tool-timer-display {
  color: #1d4ed8;
}
.tool-timer-stage.is-break.is-running .tool-timer-display {
  color: #047857;
}
.tool-timer-mode {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.tool-timer-stage.is-break .tool-timer-mode { color: #059669; }
.tool-timer-display {
  font-size: clamp(3.25rem, 12vw, 4.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 1.25rem;
}
.tool-timer-progress {
  height: 0.375rem;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}
.tool-timer-stage.is-break .tool-timer-progress { background: #d1fae5; }
.tool-timer-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width .2s linear;
}
.tool-timer-stage.is-break .tool-timer-progress-bar {
  background: linear-gradient(90deg, #059669, #34d399);
}
.tool-timer-actions {
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}
.tool-timer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 22rem;
  margin: 0 auto;
}
.tool-timer-stat {
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.tool-timer-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tool-timer-stat-label {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

/* Unit converter */
.tool-convert {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}
@media (min-width: 640px) {
  .tool-convert {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
  }
}
.tool-convert-side {
  flex: 1 1 0%;
  min-width: 0;
}
.tool-convert-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto;
  border-radius: 9999px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
  align-self: center;
}
@media (min-width: 640px) {
  .tool-convert-swap {
    margin-top: 2.25rem;
  }
}
.tool-convert-swap:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.tool-result.tool-convert-result.is-open {
  margin: 0;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tool-convert-result .tool-result-value {
  font-size: clamp(1.5rem, 4vw, 2rem);
  word-break: break-all;
}

@media (min-width: 640px) {
  .tool-panel .sm\:flex-row { flex-direction: row; }
  .tool-panel .sm\:gap-5 { gap: 1.25rem; }
  .tool-panel .sm\:col-span-3 { grid-column: span 3 / span 3; }
}

/* Subject icons (SVG, not emoji) */
.subject-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subject-icon svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}
.subject-icon--tile svg {
  width: 1.5rem;
  height: 1.5rem;
}
.subject-icon--card svg,
.subject-icon--hero svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* ============================================================
   Sign-up gate (blurred answer + free-account CTA)
   ============================================================ */
[x-cloak] { display: none !important; }

.answer-gate {
  position: relative;
  margin-top: 0.5rem;
  border-radius: 1rem;
  overflow: hidden;
  min-height: 340px;
}
.answer-gate-blur {
  position: absolute;
  inset: 0;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #ffffff;
  filter: blur(7px);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}
.answer-gate-blur .agl {
  display: block;
  height: 0.85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #cbd5e1, #e2e8f0);
}
.answer-gate-blur .agl-0 { width: 92%; }
.answer-gate-blur .agl-1 { width: 78%; }
.answer-gate-blur .agl-2 { width: 85%; }
.answer-gate-card {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 24px 60px -22px rgba(15, 23, 42, 0.35);
}
.answer-gate-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 999px;
}
.answer-gate-icon svg { width: 1.5rem; height: 1.5rem; }
.answer-gate-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.answer-gate-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 1.25rem;
}
.answer-gate-cta {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.answer-gate-cta:hover { background: #1d4ed8; transform: translateY(-1px); }
.answer-gate-signin {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: #475569;
  font-size: 0.85rem;
  cursor: pointer;
}
.answer-gate-signin span { color: #2563eb; font-weight: 700; text-decoration: underline; }
.answer-gate-perks {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
}
.answer-gate-perks li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}
.answer-gate-perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 800;
}

/* ============================================================
   In-context auth modal (OTP)
   ============================================================ */
.g-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.g-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.g-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.5);
  animation: gModalIn 0.2s ease;
}
@keyframes gModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.g-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.g-modal-close:hover { color: #475569; }
.g-modal-badge {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 999px;
}
.g-modal-badge svg { width: 1.6rem; height: 1.6rem; }
.g-modal-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.4rem;
}
.g-modal-sub {
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}
.g-modal-alert {
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
}
.g-modal-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.g-modal-alert--ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.g-modal-form { display: block; }
.g-modal-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 0.35rem;
}
.g-modal-optional { font-weight: 400; color: #94a3b8; }
.g-modal-input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  color: #0f172a;
  transition: border-color 0.15s ease;
}
.g-modal-input:focus { outline: none; border-color: #2563eb; }
.g-modal-otp {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  font-weight: 800;
}
.g-modal-submit {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.g-modal-submit:hover { background: #1d4ed8; }
.g-modal-submit:disabled { opacity: 0.6; cursor: default; }
.g-modal-fine {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin: 0.85rem 0 0;
  line-height: 1.5;
}
.g-modal-row {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}
.g-modal-row button {
  background: none;
  border: none;
  font-size: 0.83rem;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
}
.g-modal-row button:disabled { opacity: 0.5; }

/* ============================================================
   Onboarding flow
   ============================================================ */
.onb-wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}
.onb-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 24px 60px -30px rgba(15, 23, 42, 0.3);
}
.onb-dots {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.onb-dot {
  width: 2.25rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.2s ease;
}
.onb-dot.is-active { background: #2563eb; }
.onb-dot.is-done { background: #93c5fd; }
.onb-step-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 0.4rem;
}
.onb-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.onb-sub {
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
  margin: 0 0 1.5rem;
}
.onb-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.onb-options--single { grid-template-columns: 1fr; }
.onb-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.onb-option:hover { border-color: #bfdbfe; transform: translateY(-1px); }
.onb-option.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.onb-option .onb-emoji { font-size: 1.15rem; line-height: 1; }
.onb-detail {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}
.onb-detail:focus { outline: none; border-color: #2563eb; }
.onb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}
.onb-next {
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: 0.75rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.onb-next:hover { background: #1d4ed8; }
.onb-next:disabled { opacity: 0.5; cursor: default; }
.onb-skip {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.onb-skip:hover { color: #64748b; }
.onb-back {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 480px) {
  .onb-options { grid-template-columns: 1fr; }
}
