:root {
  --primary: #057a42;
  --primary-hover: #046235;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --bg: #f6f8fa;
  --card: #ffffff;
  --code-bg: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --on-primary: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --code-bg: #0f172a;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: #334155;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 84px 16px 56px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color .2s ease, color .2s ease;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  text-decoration: underline;
}

[data-theme="dark"] a,
[data-theme="dark"] .result-label,
[data-theme="dark"] .language-name,
[data-theme="dark"] .knowledge-card h3,
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .input-box input,
[data-theme="dark"] .brand-accent,
[data-theme="dark"] .share-msg,
[data-theme="dark"] .live-badge {
  color: var(--text);
}

button {
  font-family: inherit;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.none {
  display: none !important;
}

/* Header - Frosted Glass */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  transition: opacity .15s ease;
}

.brand-link:hover {
  opacity: .88;
}

.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}

.bookmark-hint {
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.bookmark-hint:hover {
  border-color: var(--primary);
  color: var(--text);
}

.bookmark-hint strong, .bookmark-hint font {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-dropdown {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px;
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease;
}

.lang-toggle:hover {
  border-color: var(--primary);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 184px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 1100;
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-menu.show {
  display: grid;
  gap: 2px;
}

.lang-option {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.lang-option:hover, .lang-option.active {
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  font-weight: 600;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.theme-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
}

/* Main */
.main-container {
  max-width: 960px;
  margin: 0 auto;
}

.hero-header {
  text-align: center;
  margin: 8px 0 24px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: tsPulse 2s ease-in-out infinite;
}

@keyframes tsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

.page-h1 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0 0 20px;
  color: var(--text);
}

.section-heading {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 44px 0 18px;
  color: var(--text);
}

.section-heading-left {
  text-align: left;
  margin: 0 0 14px;
}

/* Live Clock Dashboard Card */
.time-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 28px;
  display: grid;
  gap: 16px;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-row-primary {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.time-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.time-label {
  width: 112px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.code-example2, .code-example {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  background: var(--code-bg);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  word-break: break-all;
  cursor: pointer;
  transition: border-color .15s ease;
}

.code-example2:hover, .code-example:hover {
  border-color: var(--primary);
}

.code-hero {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 14px 18px;
  text-align: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.icon-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.icon-btn:active {
  transform: scale(.96);
}

.timer-btn {
  min-width: 84px;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .15s ease, transform .1s ease;
}

.timer-btn:active {
  transform: scale(.97);
}

.timer-btn.stop {
  background: var(--danger);
}

.timer-btn.stop:hover {
  background: var(--danger-hover);
}

.timer-btn.start {
  background: var(--primary);
}

.timer-btn.start:hover {
  background: var(--primary-hover);
}

/* Segmented Tabs */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.nav-item {
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

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

.nav-item.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

/* Input Box */
.input-container {
  margin-bottom: 22px;
}

.input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.input-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  padding: 12px 6px;
}

.input-box input:focus {
  outline: none;
}

.input-box input::placeholder {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}

.clear-btn:hover {
  color: var(--on-primary);
  background: var(--danger);
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.result-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.result-span-full {
  grid-column: 1 / -1;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary);
}

.result-featured .result-value {
  font-size: 17px;
  font-weight: 600;
}

.inline-ad-slot {
  display: flex;
  justify-content: center;
  margin: 22px 0;
  overflow: hidden;
}

/* Code Snippets Card */
.language-methods {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 6px;
}

.method-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color .15s ease;
}

.method-item:hover {
  background: var(--code-bg);
}

.language-name {
  width: 96px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
}

/* Knowledge & Doc Cards */
.guides-wrap {
  display: grid;
  gap: 28px;
  margin-top: 48px;
}

.knowledge-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  line-height: 1.75;
}

.knowledge-card p {
  margin: 0 0 14px;
  max-width: 70ch;
}

.knowledge-card p:last-child {
  margin-bottom: 0;
}

.knowledge-card h3 {
  margin: 20px 0 8px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
}

.knowledge-card ul {
  margin: 8px 0 16px;
  padding-left: 20px;
}

.knowledge-card code.code-example {
  display: inline;
  padding: 3px 7px;
  font-size: 14px;
  border-radius: 6px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 12px;
  font-size: 14px;
  color: var(--muted);
}

/* Engage Bar */
.engage-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 40px 0 12px;
  flex-wrap: wrap;
}

.engage-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.engage-btn:hover, .engage-btn[data-gf-liked] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.share-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* Sidebar Ads */
.sidebar-ad {
  position: fixed;
  top: 88px;
  width: 160px;
  height: 600px;
  z-index: 90;
  display: none;
}

.sidebar-ad-left { left: 10px; }
.sidebar-ad-right { right: 10px; }

@media (min-width: 1400px) {
  .sidebar-ad { display: block; }
}

/* Footer */
.site-footer {
  max-width: 960px;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  font-weight: 500;
}

.footer-langs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}

.footer-langs a {
  color: var(--muted);
}

.footer-langs a.current, .footer-langs a:hover {
  color: var(--text);
  font-weight: 600;
}

.brand-accent {
  color: var(--primary);
}

.footer-brand-marks {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

/* Floating Actions & Share Dialog & Toast */
.floating-actions {
  position: fixed;
  right: 18px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 950;
}

.fab-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.fab-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.fab-top {
  display: none;
}

.fab-top.show {
  display: inline-flex;
}

.share-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(4px);
  z-index: 1200;
}

.share-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 1210;
  display: grid;
  gap: 4px;
}

.share-dialog[hidden], .share-backdrop[hidden] {
  display: none;
}

.share-option {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.share-option:hover {
  background: var(--primary);
  color: var(--on-primary);
}

.share-close {
  text-align: center;
  font-size: 20px;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--card);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  display: none;
}

.not-found-card {
  text-align: center;
  padding: 56px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  margin-top: 16px;
  transition: background-color .15s ease;
}

.primary-btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .time-subgrid {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .bookmark-hint {
    display: none;
  }
  .page-h1 {
    font-size: 28px;
  }
  .code-hero {
    font-size: 22px;
  }
  .time-row, .method-item {
    flex-wrap: wrap;
  }
  .time-label, .language-name {
    width: 100%;
  }
  .nav-item {
    padding: 10px 8px;
    font-size: 14px;
  }
  .timer-btn {
    width: 100%;
  }
  .knowledge-card {
    padding: 20px;
  }
}



/* Discord Timestamp Generator */
.hero-subtitle {
  max-width: 64ch;
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 16px;
}

.dtg-inputs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dtg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dtg-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.dtg-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
}

.dtg-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.dtg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dtg-preset-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.dtg-preset-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.dtg-formats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 24px;
}

.dtg-rows {
  display: grid;
  gap: 8px;
}

.dtg-row {
  display: grid;
  grid-template-columns: 180px 1fr 200px 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color .15s ease;
}

.dtg-row:hover {
  background: var(--code-bg);
}

.dtg-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dtg-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.dtg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dtg-preview {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.dtg-code {
  text-align: center;
  font-size: 14px;
}

.dtg-decode-card {
  margin-bottom: 20px;
}

.dtg-article {
  margin-top: 28px;
}

.dtg-article h2 {
  font-size: 22px;
  margin: 28px 0 12px;
  color: var(--text);
}

.dtg-article h2:first-child {
  margin-top: 0;
}

.dtg-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.dtg-article th, .dtg-article td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.dtg-article th {
  font-weight: 600;
  color: var(--muted);
}

.dtg-faq-list {
  display: grid;
  gap: 12px;
}

.dtg-faq-item {
  padding: 18px 22px;
}

.dtg-faq-q {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.dtg-faq-a {
  margin: 12px 0 0;
  color: var(--muted);
}

@media (max-width: 768px) {
  .dtg-inputs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dtg-row {
    grid-template-columns: 1fr 44px;
  }
  .dtg-row-meta, .dtg-preview, .dtg-code {
    grid-column: 1 / 2;
  }
  .dtg-row .icon-btn {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
  }
}

@media (max-width: 640px) {
  .dtg-inputs-grid {
    grid-template-columns: 1fr;
  }
}



/* Mobile Compatibility & Responsive Refinements */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.dtg-input {
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
}

.inline-ad-slot {
  max-width: 100%;
}

.inline-ad-slot ins {
  max-width: 100% !important;
}

.dtg-article table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dtg-article th, .dtg-article td {
  white-space: nowrap;
}

.knowledge-card, .knowledge-card p, .knowledge-card li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lang-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-menu {
  max-width: calc(100vw - 24px);
}

.share-dialog {
  width: min(320px, calc(100vw - 24px));
  min-width: 0;
}

@media (max-width: 640px) {
  body {
    padding: 68px 12px calc(76px + env(safe-area-inset-bottom));
    font-size: 15px;
  }

  .header-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-logo {
    height: 28px;
  }

  .header-right {
    gap: 6px;
    min-width: 0;
  }

  .lang-toggle {
    max-width: 128px;
    min-height: 36px;
    padding: 4px 10px;
    font-size: 13px;
  }

  .theme-btn {
    width: 30px;
    height: 30px;
  }

  .hero-header {
    margin: 4px 0 18px;
  }

  .live-badge {
    font-size: 12px;
    padding: 4px 10px;
    max-width: 100%;
  }

  .page-h1 {
    font-size: 26px;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .section-heading {
    font-size: 20px;
    margin: 32px 0 14px;
  }

  .time-card {
    padding: 16px 14px;
    gap: 12px;
  }

  .time-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
  }

  .time-label {
    grid-column: 1 / -1;
    width: auto;
    font-size: 12px;
  }

  .time-row .timer-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .code-hero {
    font-size: 22px;
    padding: 12px 10px;
  }

  .code-example2, .code-example {
    font-size: 14px;
    padding: 10px 12px;
  }

  .nav-tabs {
    padding: 4px;
    gap: 4px;
  }

  .nav-item {
    padding: 10px 8px;
    min-height: 44px;
    font-size: 14px;
    line-height: 1.25;
  }

  .input-box {
    padding: 6px 10px;
  }

  .input-box input {
    font-size: 18px;
    padding: 10px 4px;
  }

  .result-item {
    padding: 14px;
  }

  .method-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 10px 8px;
  }

  .language-name {
    grid-column: 1 / -1;
    width: auto;
  }

  .dtg-formats-card {
    padding: 8px;
  }

  .dtg-row {
    padding: 12px 10px;
    border: 1px solid var(--border);
    gap: 8px;
  }

  .dtg-preview {
    font-size: 14px;
  }

  .dtg-code {
    text-align: left;
    font-size: 13px;
  }

  .dtg-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dtg-preset-btn {
    padding: 0 8px;
    min-height: 42px;
    font-size: 13px;
  }

  .knowledge-card {
    padding: 18px 16px;
  }

  .dtg-faq-item {
    padding: 16px;
  }

  .floating-actions {
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .fab-btn {
    width: 44px;
    height: 44px;
  }
}