/* Change Freeze Tracker. No inline styles anywhere (CSP style-src 'self'). */

:root {
  --text: #1b1f24;
  --muted: #4a5560;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #c5ccd3;
  --primary: #0b5cad;
  --primary-dark: #08457f;
  --focus: #c2410c;
  --error: #b00020;
  --active-bg: #e6f4ea;
  --active-border: #1e7b34;
  --active-text: #145523;
  --planned-text: #0b4f8a;
  --planned-bg: #e8f1fb;
  --ended-text: #4a5560;
  --ended-bg: #eef0f2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--panel);
  color: var(--primary-dark);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #10263d;
  color: #ffffff;
}

.site-title {
  margin: 0;
  font-size: 1.35rem;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

main:focus {
  outline: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.narrow {
  max-width: 26rem;
  margin: 2rem auto;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.notice:empty,
.alert:empty {
  display: none;
}

.notice {
  padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--primary);
  background: var(--planned-bg);
}

.alert {
  color: var(--error);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.field-row .field {
  flex: 1 1 14rem;
}

label {
  font-weight: 600;
}

.required {
  font-weight: 400;
  color: var(--muted);
}

input,
textarea {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid #6b7680;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border: 2px solid var(--error);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-error {
  margin: 0;
  color: var(--error);
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

.error-summary {
  border: 3px solid var(--error);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-summary a {
  color: var(--error);
  font-weight: 600;
}

button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button-secondary {
  background: #ffffff;
  color: var(--primary-dark);
}

.button-secondary:hover {
  background: var(--planned-bg);
  color: var(--primary-dark);
}

.site-header .button-secondary {
  border-color: #ffffff;
}

.button-danger {
  border-color: var(--error);
  background: #ffffff;
  color: var(--error);
}

.button-danger:hover {
  background: #fdecee;
  border-color: var(--error);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.filter-form .field {
  margin-bottom: 0;
}

.filter-actions,
.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.list-header h2 {
  margin: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-weight: 600;
  padding: 0.25rem 0 0.5rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--bg);
}

tr.row-active td:first-child {
  border-left: 6px solid var(--active-border);
}

tr.row-active .name-cell {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active {
  color: var(--active-text);
  background: var(--active-bg);
}

.badge-planned {
  color: var(--planned-text);
  background: var(--planned-bg);
}

.badge-ended {
  color: var(--ended-text);
  background: var(--ended-bg);
}

.active-panel {
  border-left: 6px solid var(--active-border);
}

#active-summary {
  margin: 0;
}
