:root {
 --bg: #eef4ff;
 --surface: #ffffff;
 --surface-soft: #f6f9ff;
 --primary: #2f6fdf;
 --primary-dark: #1f56b7;
 --text: #1f2a3d;
 --muted: #5f6f8f;
 --border: #d8e3f8;
 --shadow: 0 8px 24px rgba(31, 86, 183, 0.08);
 --radius: 10px;
 --radius-soft: 8px;
}

* {
 box-sizing: border-box;
}

body {
 margin: 0;
 font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
 background: var(--bg);
 color: var(--text);
}

body.is-busy,
body.is-busy * {
 cursor: wait !important;
}

.login-overlay {
 position: fixed;
 inset: 0;
 z-index: 2000;
 display: grid;
 place-items: center;
 padding: 16px;
 background: rgba(31, 42, 61, 0.45);
}

.login-overlay[hidden] {
 display: none;
}

.login-dialog {
 width: min(420px, 100%);
 border: 1px solid #d8e3f8;
 border-radius: 12px;
 background: #ffffff;
 box-shadow: 0 20px 42px rgba(31, 42, 61, 0.24);
 padding: 20px;
 display: grid;
 gap: 10px;
}

.login-help {
 margin: 0;
 color: #4f6290;
 font-size: 0.92rem;
}

.login-label {
 font-weight: 700;
 color: #24457f;
}

.login-input {
 width: 100%;
 border: 1px solid #aac3ef;
 border-radius: 8px;
 background: #ffffff;
 color: #1f2a3d;
 font: inherit;
 padding: 10px 12px;
}

.login-input:focus {
 outline: 2px solid rgba(47, 111, 223, 0.25);
 outline-offset: 1px;
 border-color: #4f88ea;
}

.login-status {
 margin: 0;
 min-height: 1.1em;
 color: #35558f;
 font-size: 0.88rem;
}

.settings-overlay {
 position: fixed;
 inset: 0;
 z-index: 1900;
 display: grid;
 place-items: center;
 padding: 16px;
 background: rgba(31, 42, 61, 0.45);
}

.settings-overlay[hidden] {
 display: none;
}

.settings-dialog {
 width: min(420px, 100%);
 border: 1px solid #d8e3f8;
 border-radius: 12px;
 background: #ffffff;
 box-shadow: 0 20px 42px rgba(31, 42, 61, 0.24);
 padding: 20px;
 display: grid;
 gap: 12px;
}

.settings-line {
 margin: 0;
 color: #24457f;
}

.topbar {
 position: sticky;
 top: 0;
 z-index: 10;
 padding: 14px 20px;
 background: rgba(255, 255, 255, 0.92);
 border-bottom: 1px solid var(--border);
 backdrop-filter: blur(8px);
}

.topbar-inner {
 max-width: 1100px;
 margin: 0 auto;
 display: flex;
 justify-content: space-between;
 align-items: center;
}

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

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

.topnav a {
 text-decoration: none;
 color: var(--primary-dark);
 padding: 8px 12px;
 border-radius: 8px;
 font-weight: 600;
 transition: background-color 0.2s ease, color 0.2s ease;
}

.topnav a:hover {
 background-color: #e8f0ff;
}

.topnav .primary-link {
 background: linear-gradient(180deg, #4f88ea 0%, var(--primary) 100%);
 color: #ffffff;
 border: 1px solid #2b66ce;
 box-shadow: 0 8px 18px rgba(47, 111, 223, 0.22);
}

.topnav .primary-link:hover {
 background: linear-gradient(180deg, #447dde 0%, #285fc5 100%);
 color: #ffffff;
}

.topnav .icon-link {
 font-size: 30px;
 line-height: 1;
 padding: 7px 10px;
}

.icon-btn {
 border: none;
 background: transparent;
 color: var(--primary-dark);
 cursor: pointer;
}

.icon-btn:hover {
 background-color: #e8f0ff;
}

.page-content {
 max-width: 1100px;
 margin: 24px auto;
 padding: 0 20px 24px;
 display: grid;
 gap: 18px;
}

.row {
 display: grid;
 gap: 18px;
}

.row-top {
 grid-template-columns: minmax(320px, 1fr);
}

.row-style {
 grid-template-columns: 7fr 13fr;
}

.row-actions {
 grid-template-columns: 3fr 1fr;
}

.row-feedback {
 grid-template-columns: 1fr 1fr;
}

.row-history {
 grid-template-columns: 1fr;
}

@media (min-width: 901px) {
 .row-top > .card:first-child,
 .row-style > .card:first-child,
 .row-feedback > .card:first-child,
 .row-actions > .card:first-child,
 .row-history > .card:first-child {
  margin-left: -20px;
 }

 .row-top > .card:last-child,
 .row-style > .card:last-child,
 .row-feedback > .card:last-child,
 .row-actions > .card:last-child,
 .row-history > .card:last-child {
  margin-right: -20px;
 }
}

.card {
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 box-shadow: var(--shadow);
 padding: 18px;
}

.record-card {
 display: grid;
 place-items: center;
 gap: 0px;
 background: var(--surface-soft);
 min-height: 260px;
}

.record-wrap {
 position: relative;
 width: 96px;
 height: 96px;
 display: flex;
 align-items: center;
 justify-content: center;
 margin-top: 1px;
}

.pulse-ring {
 position: absolute;
 width: 104px;
 height: 104px;
 border-radius: 999px;
 background: #4B6791;
 opacity: 0;
}

.record-wrap.is-recording .pulse-ring-2 {
 animation: pulse-ring 2.1s ease-out infinite;
}

.record-wrap.is-recording .pulse-ring-3 {
 animation: pulse-ring 2.1s ease-out 0.7s infinite;
}

.record-btn {
 position: relative;
 z-index: 10;
 width: 96px;
 height: 96px;
 border: none;
 border-radius: 999px;
 background: #1151bd;
 color: #fff;
 display: flex;
 align-items: center;
 justify-content: center;
 box-shadow: 0 10px 18px rgba(17, 81, 189, 0.28);
 cursor: pointer;
 transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.record-wrap.is-recording .record-btn {
 background: #C62828;
 box-shadow: 0 10px 18px rgba(198, 40, 40, 0.32);
}

.record-btn:hover {
 transform: scale(1.05);
}

.record-btn:active {
 transform: scale(0.9);
}

@keyframes pulse-ring {
 0% {
  transform: scale(0.9);
  opacity: 0.4;
 }
 70% {
  transform: scale(1.35);
  opacity: 0;
 }
 100% {
  transform: scale(1.35);
  opacity: 0;
 }
}

.record-label {
 margin: 0;
 font-weight: 700;
 color: var(--primary-dark);
}

.shortcut-chip {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 padding: 3px 10px;
 border-radius: 999px;
 border: 1px solid #bfd4f7;
 background: #e9f1ff;
 color: #234e9b;
 font-size: 0.82rem;
 font-weight: 700;
 line-height: 1;
 margin-top: -24px;
}

.record-wrap.is-recording + .record-label,
.record-wrap.is-recording ~ .shortcut-chip {
 color: #C62828;
}

.shortcut-icon {
 font-size: 1rem;
 line-height: 1;
 vertical-align: middle;
}

.style-card {
 display: grid;
 gap: 10px;
 padding: 16px 18px;
}

.style-head-row {
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 16px;
}

.style-label {
 font-weight: 700;
 color: #24457f;
}

.style-toggle-row {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 font-size: 0.9rem;
 color: #35558f;
}

.md-switch {
 position: relative;
 width: 52px;
 height: 32px;
 display: inline-block;
}

.md-switch-input {
 position: absolute;
 inset: 0;
 margin: 0;
 opacity: 0;
 z-index: 3;
 cursor: pointer;
}

.md-switch-track {
 position: absolute;
 top: 8px;
 left: 0;
 width: 52px;
 height: 16px;
 border-radius: 999px;
 background: #c2d4f5;
 transition: background-color 0.2s ease;
}

.md-switch-thumb {
 position: absolute;
 top: 4px;
 left: 2px;
 width: 24px;
 height: 24px;
 border-radius: 50%;
 background: #ffffff;
 border: 1px solid #9fb9ea;
 box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
 transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.md-switch-input:checked + .md-switch-track {
 background: rgba(47, 111, 223, 0.45);
}

.md-switch-input:checked + .md-switch-track + .md-switch-thumb {
 transform: translateX(24px);
 background: #2f6fdf;
 border-color: #2f6fdf;
}

.md-switch-input:focus-visible + .md-switch-track {
 outline: 2px solid rgba(47, 111, 223, 0.25);
 outline-offset: 2px;
}

.style-select {
 width: 100%;
 border: 1px solid #aac3ef;
 border-radius: 8px;
 background: #ffffff;
 color: #1f2a3d;
 font: inherit;
 padding: 10px 12px;
}

.style-select:focus {
 outline: 2px solid rgba(47, 111, 223, 0.25);
 outline-offset: 1px;
 border-color: #4f88ea;
}

.style-description {
 margin: 0;
 color: #4a5f86;
 line-height: 1.4;
}

.level-card {
 display: grid;
 gap: 12px;
 align-content: start;
}

.level-chips {
 display: flex;
 flex-wrap: nowrap;
 gap: 6px;
}

.level-chip {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 padding: 6px 8px;
 border-radius: 999px;
 border: 1px solid #ccd7ea;
 background: #f1f4fa;
 color: #7f8da6;
 font-size: 0.82rem;
 font-weight: 600;
 white-space: nowrap;
}

.level-chip .material-symbols-outlined {
 font-size: 1rem;
 line-height: 1;
}

.level-chip-active {
 border-color: #b7e5c6;
 background: #e4f6ea;
 color: #1f6a38;
}

.level-chip-disabled {
 border-color: #d4dce9;
 background: #f3f5f9;
 color: #8b97ab;
}

h2 {
 margin: 0 0 12px;
 font-size: 1.1rem;
 color: #24457f;
}

.card-subtitle {
 margin: -20px 0 0px;
 font-size: 0.76rem;
 color: #6c7a92;
}

.transcript-list,
.list-card ul {
 list-style: none;
 margin: 0;
 padding: 0;
 display: grid;
 gap: 10px;
}

.transcript-card {
 display: flex;
 flex-direction: column;
}

.transcript-head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 10px;
 margin-bottom: 12px;
}

.transcript-head h2 {
 margin: 0;
}

.transcript-language-select {
 border: 1px solid #aac3ef;
 border-radius: 8px;
 background: #ffffff;
 color: #1f2a3d;
 font: inherit;
 font-size: 0.9rem;
 padding: 6px 10px;
}

.transcript-language-select:focus {
 outline: 2px solid rgba(47, 111, 223, 0.25);
 outline-offset: 1px;
 border-color: #4f88ea;
}

.notes-fields {
 display: grid;
 gap: 12px;
}

.notes-textarea {
 width: 100%;
 min-height: 220px;
 border: 1px solid #aac3ef;
 border-radius: 8px;
 background: #ffffff;
 color: #1f2a3d;
 font: inherit;
 line-height: 1.45;
 padding: 12px;
 resize: vertical;
}

.notes-textarea:focus {
 outline: 2px solid rgba(47, 111, 223, 0.25);
 outline-offset: 1px;
 border-color: #4f88ea;
}

.notes-submit-btn {
 width: 100%;
 min-width: 180px;
 margin-top: 10px;
}

.transcript-list {
 overflow-y: auto;
 overflow-x: hidden;
 flex: 1;
 min-height: 0;
}

.transcript-list li,
.list-card li {
 display: grid;
 gap: 4px;
 padding: 10px 12px;
 background: #f7faff;
 border: 1px solid #e3ebfa;
 border-radius: var(--radius-soft);
}

.transcript-list time {
 font-size: 0.82rem;
 font-weight: 700;
 color: var(--muted);
}

.list-card li {
 color: #314466;
 grid-template-columns: 1fr auto;
 align-items: start;
 gap: 10px;
}

.item-text {
 line-height: 1.45;
}

.badge {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 white-space: nowrap;
 font-size: 0.74rem;
 font-weight: 700;
 border-radius: 999px;
 padding: 4px 10px;
}

.badge-positive,
.badge-ontrack {
 color: #1f6a38;
 background: #e4f6ea;
 border: 1px solid #b7e5c6;
}

.badge-constructive {
 color: #5c2d91;
 background: #efe6fb;
 border: 1px solid #d7c1f4;
}

.badge-suggestion {
 color: #9a4f00;
 background: #fff0df;
 border: 1px solid #f3d0a8;
}

.summary-card {
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.summary-block {
 flex: 1;
 padding: 10px 12px;
 background: #f7faff;
 border: 1px solid #e3ebfa;
 border-radius: var(--radius-soft);
 color: #314466;
}

.action-row {
 display: grid;
 gap: 12px;
 align-content: start;
}

.export-options {
 display: grid;
 gap: 8px;
}

.export-option,
.export-checkbox {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 padding: 9px 12px;
 border: 1px solid #d5e2f8;
 border-radius: 8px;
 background: #f7faff;
 color: #314466;
 font-weight: 500;
}

.export-option input,
.export-checkbox input {
 accent-color: #2f6fdf;
 margin: 0;
}

.history-card {
 display: grid;
 gap: 14px;
}

.history-table-wrap {
 overflow-x: auto;
}

.history-table {
 width: 100%;
 border-collapse: separate;
 border-spacing: 0;
 min-width: 980px;
}

.history-table th,
.history-table td {
 vertical-align: top;
 text-align: left;
 padding: 12px;
 border-bottom: 1px solid #e3ebfa;
}

.history-table th {
 font-size: 0.82rem;
 text-transform: uppercase;
 letter-spacing: 0.03em;
 color: #4f6290;
 background: #f7faff;
}

.history-overview {
 display: grid;
 gap: 8px;
 min-width: 220px;
}

.history-overview-row {
 display: grid;
 gap: 4px;
}

.history-overview-label {
 font-size: 0.8rem;
 font-weight: 700;
 color: #6b7da2;
 text-transform: uppercase;
 letter-spacing: 0.03em;
}

.history-overview-value {
 font-weight: 600;
 color: #233d70;
}

.history-meta-sub {
 margin-top: 2px;
 font-size: 0.82rem;
 color: #6b7da2;
}

.history-empty {
 color: #90a0bc;
}

.history-points {
 list-style: none;
 margin: 0;
 padding: 0;
 display: grid;
 gap: 8px;
}

.history-points li {
 display: grid;
 grid-template-columns: 1fr auto;
 gap: 8px;
 padding: 8px 10px;
 border: 1px solid #e3ebfa;
 border-radius: 8px;
 background: #f7faff;
}

.history-points .badge {
 max-height: 24px;
 align-self: center;
}

.history-point-extra[hidden] {
 display: none;
}

.history-more {
 border: none;
 background: transparent;
 padding: 0;
}

.history-more-btn {
 color: #35558f;
 font-size: 0.82rem;
 font-weight: 700;
 border: none;
 background: transparent;
 padding: 0;
 cursor: pointer;
 text-decoration: underline;
}

.history-more-btn:hover {
 color: #1f56b7;
}

.action-btn {
 width: 100%;
 border: 1px solid #aac3ef;
 border-radius: 8px;
 background: linear-gradient(180deg, #f1f6ff 0%, #e7efff 100%);
 color: #1f56b7;
 font-weight: 700;
 font-size: 1rem;
 padding: 12px 16px;
 cursor: pointer;
 transition: background-color 0.2s ease, border-color 0.2s ease;
}

.action-btn:hover {
 background: #dfeaff;
 border-color: #94b3e8;
}

.action-btn-primary {
 background: linear-gradient(180deg, #4f88ea 0%, var(--primary) 100%);
 color: #ffffff;
 border: 1px solid #2b66ce;
 box-shadow: 0 8px 18px rgba(47, 111, 223, 0.22);
}

.action-btn-primary:hover {
 background: linear-gradient(180deg, #447dde 0%, #285fc5 100%);
 color: #ffffff;
 border-color: #2458b8;
}

@media (max-width: 900px) {
 .row-top,
 .row-style,
 .row-feedback,
 .row-actions,
 .row-history {
  grid-template-columns: 1fr;
 }

 .style-head-row {
  flex-direction: column;
  align-items: flex-start;
 }

 .action-row {
  grid-template-columns: 1fr;
 }

 .topbar {
  padding: 12px 14px;
 }

 .topbar-inner {
  width: 100%;
 }

 .page-content {
  padding: 0 14px 18px;
 }

 .history-table {
  min-width: 760px;
 }
}

.text-4xl {
 font-size: 2.25rem;
 line-height: 2.5rem;
}
