* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #f4f7fc; color: #0b1a33; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #8ec7ff; outline-offset: 4px; }
.tool-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; flex-shrink: 0; min-height: 66px; padding: 10px 28px; background: #fff; border-bottom: 1px solid #e7edf5; }
.tool-plan { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; font-size: .8rem; font-weight: 500; }
.tool-plan strong { font-size: .85rem; font-style: italic; font-weight: 800; }
.tool-plan.is-free { color: #16803d; background: #eaf8ef; }
.tool-plan.is-paid { color: #9a6100; background: #fff4d9; }
.tool-plan img { width: 16px; height: 16px; object-fit: contain; }
.tool-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 1.325rem; font-weight: 700; line-height: 1.4; }
.tool-title-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #006acd; font-size: 1.5rem; }
.tool-title-icon > i { display: flex; align-items: center; justify-content: center; line-height: 1; }
.tool-open-link { display: inline-flex; align-items: center; gap: 6px; justify-self: end; color: #69798d; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.tool-open-link:hover { color: #006acd; text-decoration: none; }
.tool-main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 28px; width: 100%; padding: 32px 24px 16px; }
.tool-wrapper { display: flex; flex: 1 0 auto; align-items: center; justify-content: center; width: 100%; min-width: 0; }
.mic-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 24px; width: 100%; max-width: 1000px; }
.mic-card { min-width: 0; padding: 26px; background: #fff; border: 1px solid #e5ebf3; border-radius: 24px; box-shadow: 0 12px 40px rgba(18, 61, 107, .06); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-heading h2 { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.5; }
.status-badge { display: inline-flex; align-items: center; flex-shrink: 0; gap: 6px; padding: 5px 9px; border-radius: 7px; background: #f0f3f7; color: #69798d; font-size: .75rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.is-active { color: #16803d; background: #eaf8ef; }
.status-badge.is-pending { color: #9a6100; background: #fff4d9; }
.status-badge.is-error { color: #c74444; background: #fff1f1; }
.card-description { margin: 8px 0 22px; color: #69798d; font-size: .85rem; line-height: 1.8; }
.device-field > label { display: block; margin-bottom: 8px; color: #536277; font-size: .8rem; font-weight: 600; }
.device-controls { display: flex; align-items: center; gap: 8px; }
.device-controls select { flex: 1; min-width: 0; height: 44px; padding: 0 30px 0 12px; border: 1px solid #dce5f0; border-radius: 10px; color: #315d8d; background-color: #f8faff; font-size: .85rem; text-overflow: ellipsis; }
.icon-button { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #dce5f0; border-radius: 10px; color: #69798d; background: #fff; }
.icon-button:hover:not(:disabled) { color: #006acd; background: #f1f6ff; }
.device-field > p { margin: 8px 0 18px; color: #8895a7; font-size: .75rem; line-height: 1.7; }
.wave-panel { padding: 16px 18px 14px; overflow: hidden; border: 1px solid #e5edf8; border-radius: 16px; background: #f8faff; }
.wave-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #69798d; font-size: .75rem; }
.wave-heading > span:first-child { color: #315d8d; }
.wave-heading i { margin-right: 4px; }
.wave-panel canvas { display: block; width: 100%; height: 142px; margin-top: 8px; }
.wave-panel > p { min-height: 20px; margin: 3px 0 0; color: #8895a7; font-size: .75rem; line-height: 1.7; }
.level-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; font-size: .8rem; }
.level-heading > span { color: #69798d; }
.level-heading strong { color: #315d8d; font-variant-numeric: tabular-nums; font-weight: 600; }
.level-meter { height: 10px; overflow: hidden; border-radius: 10px; background: #edf1f7; }
.level-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #006acd, #289c78 65%, #d5a339 85%, #d95c58); transition: width .08s linear; }
.level-scale { display: flex; justify-content: space-between; margin-top: 7px; color: #98a5b5; font-size: .65rem; font-variant-numeric: tabular-nums; }
.test-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border: 1px solid #dce5f0; border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1.5; text-decoration: none; }
.primary-button { color: #fff; background: #006acd; border-color: #006acd; box-shadow: 0 4px 14px rgba(0, 106, 205, .17); }
.primary-button:hover:not(:disabled) { background: #0059b3; border-color: #0059b3; }
.secondary-button { color: #536277; background: #fff; }
.secondary-button:hover:not(:disabled) { color: #006acd; background: #f1f6ff; border-color: #c7ddf4; }
.mic-message { min-height: 24px; margin: 14px 0 16px; color: #69798d; font-size: .8rem; line-height: 1.8; }
.mic-message.is-error { color: #c74444; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; padding-top: 14px; border-top: 1px solid #eef2f8; color: #8895a7; font-size: .72rem; line-height: 1.8; }
.privacy-note i { color: #21824c; }
.mic-sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.info-card { min-width: 0; padding: 22px; border: 1px solid #d2dce9; border-radius: 22px; background: transparent; }
.info-card h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: #315d8d; font-size: .95rem; font-weight: 600; line-height: 1.6; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; margin: 22px 0 18px; }
.metrics-grid > div { min-width: 0; }
.metrics-grid dt { margin-bottom: 7px; color: #8895a7; font-size: .75rem; font-weight: 400; }
.metrics-grid dd { margin: 0; color: #0b1a33; font-size: 1.2rem; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; }
.metrics-grid dd small { color: #8895a7; font-size: .7rem; font-weight: 400; }
.metric-note { margin: 0; color: #8895a7; font-size: .73rem; line-height: 1.8; }
.record-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.record-heading > span { color: #8895a7; font-size: .7rem; font-variant-numeric: tabular-nums; }
.record-intro { margin: 14px 0 16px; color: #69798d; font-size: .8rem; line-height: 1.8; }
.record-button { width: 100%; background: #fff; }
.record-button.is-recording { color: #c74444; background: #fff1f1; border-color: #f1d6d6; }
.record-status { margin: 12px 0 0; color: #8895a7; font-size: .73rem; line-height: 1.8; }
.recording-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid #dfe7f1; }
.recording-result audio { display: block; width: 100%; min-width: 0; height: 40px; }
.recording-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: .75rem; }
.recording-links a { color: #006acd; text-decoration: none; }
.recording-links a:hover { text-decoration: underline; }
.recording-links button { padding: 3px 0; border: 0; color: #8895a7; background: transparent; font-size: inherit; }
.recording-links button:hover { color: #c74444; }
.tool-tips { flex-shrink: 0; width: 100%; max-width: 1000px; margin-top: auto; padding: 22px 4px 0; border-top: 1px solid #dfe7f1; color: #66758a; font-size: .8rem; line-height: 1.9; }
.tool-tips > h2 { display: flex; align-items: center; gap: 7px; margin: 0 0 16px; color: #315d8d; font-size: .9rem; font-weight: 600; }
.tips-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.tips-grid h3 { margin: 0 0 7px; color: #536277; font-size: .8rem; font-weight: 600; }
.tips-grid p { margin: 0; }
.tips-bottom { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #e7edf5; color: #8895a7; font-size: .72rem; }
@media (max-width: 767.98px) {
    .tool-header { padding: 8px 16px; gap: 10px; }
    .tool-plan { padding: 5px 8px; font-size: .72rem; }
    .tool-title { gap: 7px; font-size: 1.175rem; }
    .tool-title-icon { width: 32px; height: 32px; font-size: 1.3rem; }
    .tool-open-link { font-size: .8rem; }
    .tool-main { padding: 24px 16px 16px; gap: 24px; }
    .mic-layout { grid-template-columns: minmax(0, 1fr); max-width: 580px; gap: 18px; }
    .mic-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
    .info-card { padding: 18px; }
    .tips-grid { grid-template-columns: 1fr; gap: 16px; }
    .tool-tips { max-width: 580px; }
}
@media (max-width: 575.98px) {
    .tool-header { grid-template-columns: minmax(0, 1fr) auto; }
    .tool-title { grid-column: 1 / -1; grid-row: 1; }
    .tool-plan { grid-column: 1; grid-row: 2; }
    .tool-open-link { grid-column: 2; grid-row: 2; }
    .mic-card { padding: 20px 16px; border-radius: 22px; }
    .card-heading h2 { font-size: 1.075rem; }
    .card-description { font-size: .8rem; }
    .device-controls select { font-size: 16px; }
    .wave-panel { padding: 14px 12px; }
    .wave-panel canvas { height: 120px; }
    .wave-heading { font-size: .7rem; }
    .wave-panel > p { font-size: .7rem; }
    .test-actions { gap: 10px; }
    .test-actions > button { flex: 1; padding: 11px 12px; }
    .mic-sidebar { display: flex; }
    .info-card { border-radius: 20px; }
    .metrics-grid { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
