:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --text: #17201d;
  --muted: #65706a;
  --line: #d9e1dc;
  --accent: #1f6f5b;
  --accent-strong: #164c40;
  --warn: #a35700;
  --shadow: 0 14px 36px rgba(20, 35, 30, 0.12);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow,
.label,
.site-tag {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 1;
  margin-bottom: 0;
}

h2 {
  font-size: 1.15rem;
  margin: 0;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.icon-button {
  align-items: center;
  border-radius: 50%;
  display: inline-grid;
  font-size: 1.5rem;
  height: 48px;
  padding: 0;
  place-items: center;
  width: 48px;
}

.status-panel,
.input-section,
.toolbar,
.work-list-section {
  margin-bottom:16px;
}

.status-panel,
.input-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.status-panel strong {
  display: block;
  font-size: 1.15rem;
}

.input-section {
  padding: 16px;
}

.work-form label,
.toolbar label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

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

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  min-height: auto;
  width: auto;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 111, 91, 0.18);
}

.favorite-field,
.favorite-filter {
  align-items: center;
  display: flex;
  gap: 8px;
}

.favorite-field {
  min-height: 44px;
}

.form-message {
  color: var(--warn);
  min-height: 1.4em;
  margin: 10px 0 0;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto auto;
}

.toolbar label {
  margin-bottom: 0;
}

.toolbar button,
.toolbar select {
  min-height: 44px;
}

.toolbar button:last-child,
.remove-button {
  background: #e8efeb;
  color: var(--accent-strong);
}

.toolbar button:last-child:hover,
.remove-button:hover {
  background: #d7e4de;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.95rem;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  margin-bottom: 0;
}

.work-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.work-main {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.favorite-button,
.remove-button {
  flex: 0 0 auto;
  font-size: 1.25rem;
  height: 40px;
  min-height: 40px;
  padding: 0;
  width: 40px;
}

.favorite-button {
  background: #f4ead2;
  color: #7b5200;
}

.favorite-button.is-active {
  background: #e9b44c;
  color: #17201d;
}

.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 14px;
}

.meta-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.read-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.read-link:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .app-shell {
    padding-top: 18px;
  }

  .status-panel,
  .form-grid,
  .toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
