/* ClipMelo v1 - Main Shell & Base Styles */
@import "./workbench.css?v=4f2edfb9";
@import "./lang-menu.css?v=394e685b";

:root {
  --bg-page: #fbf9f5;
  --bg-panel: #ffffff;
  --bg-inset: #f4f1e8;
  --border-line: #e6e2d6;
  --text-primary: #181614;
  --text-secondary: #58534c;
  --text-muted: #8c867d;
  --accent-coral: #ff542e;
  --accent-coral-hover: #e0431f;
  --accent-coral-subtle: #fff1ed;
  --state-danger: #dc2626;
  --state-success: #15803d;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(24, 22, 20, 0.05);
  --shadow-card: 0 4px 16px rgba(24, 22, 20, 0.04), 0 1px 2px rgba(24, 22, 20, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.clipmelo-body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

/* Header */
.site-header {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-nav {
  display: flex;
  align-items: center;
  background-color: var(--bg-inset);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.nav-tab {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background-color: var(--bg-panel);
  color: var(--accent-coral);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Error Banner */
.error-banner {
  max-width: 1240px;
  margin: 1rem auto 0;
  padding: 0.875rem 1.25rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: var(--state-danger);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Page Article */
.page-article-container {
  max-width: 860px;
  margin: 2.5rem auto 2rem;
  padding: 0 1.25rem;
  width: 100%;
}

.prose-content {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.prose-content h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.lead-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.guide-card {
  background-color: var(--bg-inset);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
}

.guide-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.guide-card p, .prose-content p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.limits-notice, .policy-section, .about-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-line);
}

.limits-notice h3, .policy-section h3, .about-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.specs-table th, .specs-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-line);
  text-align: left;
}

.specs-table th {
  background-color: var(--bg-inset);
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-line);
  background-color: var(--bg-panel);
  padding: 1.5rem 1.25rem;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.footer-link:hover {
  color: var(--accent-coral);
}

/* Language switcher (footer details; every language keeps a real link) */
.lang-switch {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.lang-switch summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-switch summary::-webkit-details-marker { display: none; }

.lang-switch summary:hover,
.lang-switch[open] summary {
  border-color: var(--accent-coral);
  color: var(--accent-coral);
}

.lang-switch-globe { flex-shrink: 0; }

.lang-switch-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.lang-switch-list a {
  display: inline-block;
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.lang-switch-list a:hover {
  color: var(--accent-coral);
  background-color: var(--bg-inset);
}

.lang-switch-list a[aria-current="true"] {
  color: var(--accent-coral);
  font-weight: 700;
  text-decoration: underline;
}

/* On RTL pages the waveform and its range inputs stay left-to-right; the other
   time/number controls carry dir="ltr" in the template. */
[dir="rtl"] .waveform-viewport {
  direction: ltr;
  text-align: left;
}

.footer-notice {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Page Mode Display */
html[data-page="privacy"] #workbench,
html[data-page="about"] #workbench {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .tool-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
}

.prose-content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
