:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef1f4;
  color: #202124;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.ideas-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.ideas-header,
.ideas-toolbar,
.idea-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ideas-header {
  justify-content: space-between;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(27px, 4vw, 38px);
}

.ideas-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.md-reminders-dialog {
  width: min(92vw, 620px);
  max-width: none;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: #fff;
  color: #202124;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.md-reminders-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.md-reminders-content {
  padding: 20px;
}

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

.md-reminders-table {
  width: 100%;
  border-collapse: collapse;
}

.md-reminders-table th,
.md-reminders-table td {
  border-bottom: 1px solid #d4d8dc;
  padding: 9px 8px;
  text-align: left;
}

.md-reminders-table code {
  overflow-wrap: anywhere;
  color: #315f91;
}

.md-reminders-content p {
  margin: 16px 0 0;
  color: #5f6368;
  line-height: 1.4;
}

.card {
  margin-bottom: 20px;
  border: 1px solid #d4d8dc;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.idea-form-grid {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.6fr)
    minmax(280px, 1.4fr)
    minmax(110px, auto)
    auto;
  align-items: end;
  gap: 14px;
  margin-top: 16px;
}

.idea-title-fields {
  display: grid;
  gap: 10px;
}

.idea-text-editor {
  min-width: 0;
}

.idea-editor-mode {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.idea-editor-mode button {
  border: 1px solid #aeb4ba;
  border-radius: 0;
  padding: 5px 10px;
  background: #fff;
  color: #315f91;
  font-size: 12px;
}

.idea-editor-mode button:first-child {
  border-radius: 6px 0 0 6px;
}

.idea-editor-mode button:last-child {
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.idea-editor-mode button[aria-pressed="true"] {
  background: #315f91;
  color: #fff;
}

.screenshot-paste-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 400;
}

.screenshot-paste-mode select {
  width: auto;
  padding: 5px 8px;
  font-size: 13px;
}

.screenshot-paste-status {
  display: block;
  min-height: 1.3em;
  margin-top: 4px;
  color: #5f6368;
  font-size: 12px;
}

.idea-voice-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
  color: #5f6368;
  font-size: 12px;
}

.idea-voice-controls button {
  padding: 6px 9px;
}

.idea-autosave-status {
  color: #5f6368;
  font-size: 12px;
  line-height: 1.3;
}

label {
  display: grid;
  gap: 7px;
  color: #444;
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid #aeb4ba;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: #202124;
  font-size: 16px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.idea-rich-editor {
  width: 100%;
  min-height: 92px;
  border: 1px solid #aeb4ba;
  border-radius: 7px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  background: #fff;
  color: #202124;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-wrap;
}

.edit-form .idea-rich-editor {
  min-height: 350px;
}

.idea-rich-editor:focus {
  border-color: #315f91;
  outline: 2px solid rgba(49, 95, 145, 0.2);
}

.idea-rich-editor:empty::before {
  color: #757575;
  content: attr(data-placeholder);
  pointer-events: none;
}

.idea-rich-editor h1,
.idea-rich-editor h2,
.idea-rich-editor h3,
.idea-text-content h1,
.idea-text-content h2,
.idea-text-content h3 {
  margin: 0.35em 0;
  font-size: 1.3em;
  line-height: 1.25;
}

.idea-rich-editor h2,
.idea-text-content h2 {
  font-size: 1.18em;
}

.idea-rich-editor h3,
.idea-text-content h3 {
  font-size: 1.08em;
}

.idea-rich-editor p,
.idea-text-content p {
  margin: 0 0 0.65em;
}

.idea-rich-editor p:last-child,
.idea-text-content p:last-child {
  margin-bottom: 0;
}

.idea-rich-editor ul,
.idea-rich-editor ol,
.idea-text-content ul,
.idea-text-content ol {
  margin: 0.35em 0 0.65em;
  padding-left: 1.6em;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: #3b6ea8;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  filter: brightness(0.92);
}

.button--neutral {
  background: #5f6368;
}

.button--success {
  background: #2e7d32;
}

.button--warning {
  background: #b26a00;
}

.button--danger {
  border: 1px solid #b3261e;
  background: #fff;
  color: #a5231c;
}

.ideas-toolbar {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ideas-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ideas-filter-form input[type="search"] {
  width: min(260px, 38vw);
}

.ideas-filter-form select {
  width: auto;
}

.clear-search {
  color: #39424c;
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.toggle {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  cursor: pointer;
}

.toggle input {
  width: 20px;
  height: 20px;
}

.ideas-grid {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.ideas-grid th,
.ideas-grid td {
  border-bottom: 1px solid #dfe2e5;
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

.ideas-grid th {
  background: #e3e7eb;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.idea-id {
  width: 70px;
  font-weight: 700;
}

.idea-priority {
  width: 90px;
}

.idea-priority form {
  margin: 0;
}

.priority-select {
  width: 48px;
  min-height: 38px;
  padding: 7px 8px;
  font-weight: 800;
  text-align: center;
}

.priority-select--U {
  border-color: #b3261e;
  color: #9f2019;
  background: #fff2f1;
}

.priority-select--N {
  border-color: #8a929a;
  color: #3f474f;
  background: #f5f6f7;
}

.priority-select--L {
  border-color: #58779a;
  color: #315b86;
  background: #f0f6fc;
}

.idea-title {
  width: 24%;
  font-weight: 700;
}

.idea-category-form {
  margin-top: 8px;
}

.idea-category-select {
  max-width: 100%;
  padding: 6px 8px;
  color: #444;
  font-size: 14px;
  font-weight: 400;
}

.idea-text {
  overflow-wrap: anywhere;
}

.idea-text-content {
  max-height: 7.25em;
  overflow-y: auto;
  line-height: 1.45;
  white-space: pre-wrap;
  scrollbar-width: thin;
}

[data-edit-target] {
  cursor: pointer;
}

[data-edit-target] a,
[data-edit-target] button {
  cursor: pointer;
}

.idea-text-content.is-expanded {
  max-height: none;
  overflow: visible;
}

.idea-text-content:has(.idea-screenshot-thumbnail) {
  max-height: 10.5em;
}

.idea-text-content.is-expanded:has(.idea-screenshot-thumbnail) {
  max-height: none;
}

.idea-screenshot-thumbnail {
  display: inline-flex;
  width: min(220px, 100%);
  height: 104px;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  border: 1px solid #d4d8dc;
  border-radius: 7px;
  padding: 3px;
  overflow: hidden;
  background: #f5f6f7;
  vertical-align: middle;
}

.idea-screenshot-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.idea-inline-attachment {
  position: relative;
  display: inline-flex;
  width: min(220px, 100%);
  flex-direction: column;
  align-items: stretch;
  margin: 8px 4px;
  vertical-align: middle;
}

.idea-inline-attachment .idea-screenshot-thumbnail {
  width: 100%;
  margin: 0;
}

.idea-inline-attachment-mode {
  padding: 4px 6px;
  color: #5f6368;
  font-size: 11px;
  font-weight: 400;
  text-align: center;
}

.idea-inline-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  min-height: 28px;
  border: 1px solid #aeb4ba;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  color: #8c1d18;
  font-size: 20px;
  line-height: 24px;
}

.idea-screenshot-dialog {
  width: min(96vw, 1500px);
  max-width: none;
  max-height: 96vh;
  border: 0;
  border-radius: 10px;
  padding: 0;
  overflow: visible;
  background: #111;
  color: #fff;
}

.idea-screenshot-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.idea-screenshot-dialog-content {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  padding: 48px 12px 12px;
}

.idea-screenshot-dialog-content > img {
  display: block;
  max-width: 100%;
  max-height: calc(96vh - 60px);
  object-fit: contain;
}

.idea-screenshot-dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 34px;
  padding: 7px 11px;
  background: #fff;
  color: #202124;
}

.idea-text-toggle {
  margin-top: 6px;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: #315f91;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.idea-actions {
  width: 286px;
  flex-wrap: nowrap;
  gap: 7px;
}

.idea-actions form {
  margin: 0;
}

.idea-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

.idea-actions > .button,
.idea-actions form button {
  width: 100%;
  min-height: 38px;
  padding: 9px 8px;
  font-size: 14px;
  line-height: 18px;
  white-space: nowrap;
}

.is-completed td:not(.idea-actions) {
  color: #686d72;
}

.is-completed .idea-title > div,
.is-completed .idea-text {
  text-decoration: line-through;
}

.empty-state {
  padding: 30px;
  color: #686d72;
  text-align: center;
}

.flash {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 11px 14px;
  background: #dff2e1;
  color: #185c1d;
}

.flash--error {
  background: #fce1df;
  color: #8c1d18;
}

.edit-form {
  display: grid;
  gap: 16px;
}

.challenge-form {
  margin-top: 24px;
}

.ideas-shell--narrow {
  max-width: 760px;
}

.category-add-form,
.category-rename-form,
.category-row {
  display: flex;
  align-items: end;
  gap: 10px;
}

.category-add-form {
  margin-top: 16px;
}

.category-add-form label,
.category-rename-form label {
  flex: 1 1 auto;
}

.category-guidance {
  margin: 0 0 14px;
  color: #5f6368;
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-row,
.category-rename-form {
  align-items: center;
}

.category-rename-form {
  flex: 1 1 auto;
}

.category-count {
  min-width: 64px;
  color: #5f6368;
  font-size: 14px;
  text-align: right;
}

button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.45;
}

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

@media (max-width: 760px) {
  .ideas-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .ideas-header {
    align-items: flex-start;
  }

  .ideas-header-actions {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .ideas-header-actions .button,
  .ideas-header-actions button {
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
  }

  .ideas-toolbar {
    display: grid;
    gap: 10px;
  }

  .ideas-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
  }

  .ideas-filter-form input[type="search"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ideas-filter-form .toggle {
    justify-self: end;
  }

  .ideas-filter-form button {
    justify-self: start;
  }

  .idea-form-grid {
    grid-template-columns: 1fr;
  }

  .ideas-grid thead {
    display: none;
  }

  .ideas-grid,
  .ideas-grid tbody {
    display: block;
    width: 100%;
  }

  .ideas-grid tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 6px;
    width: 100%;
    border-bottom: 6px solid #eef1f4;
    padding: 10px;
  }

  .ideas-grid td {
    display: block;
    width: auto;
    border: 0;
    padding: 6px;
  }

  .ideas-grid .idea-id {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .ideas-grid .idea-priority {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 2px 0;
  }

  .priority-select {
    width: 40px;
    min-height: 30px;
    padding: 4px;
    border-radius: 5px;
    font-size: 16px;
  }

  .idea-category-select {
    font-size: 16px;
  }

  .ideas-grid .idea-title,
  .ideas-grid .idea-text {
    grid-column: 1 / -1;
  }

  .ideas-grid td.idea-actions {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    width: auto;
    max-width: none;
    gap: 4px;
    padding: 2px 0;
  }

  .idea-actions > * {
    flex: 0 0 auto;
  }

  .idea-actions > .button,
  .idea-actions form button {
    width: auto;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 18px;
  }

  .category-add-form,
  .category-row,
  .category-rename-form {
    align-items: stretch;
  }

  .category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .category-rename-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .category-rename-form label {
    grid-column: 1 / -1;
  }
}
