body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f7f7f7;
    color: #111;
  }
  
  .app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .top-nav {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: white;
    border-bottom: 1px solid #e5e5e5;
  }
  
  .nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .nav-button {
    border: none;
    background: transparent;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
  }
  
  .nav-button:hover {
    background: #f1f1f1;
    color: #111;
  }
  
  .nav-button.active {
    background: #111;
    color: white;
  }
  
  .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #666;
  }

  .nav-link {
    color: #333;
    text-decoration: none;
  }

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

  .nav-right .nav-button {
    border: 1px solid #ddd;
    background: white;
    color: #111;
  }
  
  .page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
  }
  
  .card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
  
  h1 {
    margin-top: 0;
    font-size: 28px;
  }
  
  h2 {
    margin-top: 0;
    font-size: 20px;
  }
  
  h3 {
    margin-top: 24px;
    font-size: 18px;
  }
  
  label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
  }
  
  input[type="datetime-local"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
  }
  
  button.primary-button {
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: #111;
    color: white;
    font-size: 14px;
    cursor: pointer;
  }
  
  button.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .query-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  
  .query-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 18px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    position: sticky;
    top: 78px;
  }
  
  .query-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }
  
  .query-sidebar-header h2 {
    margin: 0;
    font-size: 16px;
  }
  
  .sidebar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .icon-button:hover {
    background: #f1f1f1;
  }
  
  .confirm-box {
    border: 1px solid #f0c2c2;
    background: #fff6f6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
  }
  
  .confirm-box p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #7a1111;
    line-height: 1.35;
  }
  
  .confirm-actions {
    display: flex;
    gap: 8px;
  }
  
  .danger-button {
    border: none;
    background: #b00020;
    color: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
  }
  
  .danger-button:hover {
    background: #8e001a;
  }
  
  .danger-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .secondary-button {
    border: 1px solid #ddd;
    background: white;
    color: #111;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
  }
  
  .secondary-button:hover {
    background: #f1f1f1;
  }
  
  .query-run-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .query-run-button {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 9px;
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
  }
  
  .query-run-button:hover {
    background: #f1f1f1;
  }
  
  .query-run-button.active {
    border-color: #111;
    background: #111;
    color: white;
  }
  
  .query-run-title {
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  .query-run-meta {
    font-size: 12px;
    opacity: 0.75;
    line-height: 1.35;
  }
  
  .query-main {
    min-width: 0;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 28px;
    box-sizing: border-box;
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
  }
  
  .model-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
  }
  
  .model-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    font-size: 14px;
  }
  
  .query-actions {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .selected-query-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
  }
  
  .filter-panel {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fafafa;
  }
  
  .filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }
  
  .filter-chip {
    border: 1px solid #d5d5d5;
    background: white;
    color: #111;
    border-radius: 999px;
    padding: 8px 11px;
    cursor: pointer;
    font-size: 13px;
  }
  
  .filter-chip:hover {
    background: #f1f1f1;
  }
  
  .filter-chip.active {
    border-color: #111;
    background: #111;
    color: white;
  }
  
  .filter-chip.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
  }
  
  .model-board-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-top: 24px;
  }
  
  .model-board-header h3 {
    margin-bottom: 4px;
  }
  
  .model-board-header .success {
    white-space: nowrap;
    margin-top: 24px;
  }
  
  .model-columns-board {
    width: 100%;
    margin-top: 14px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 320px;
    gap: 14px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 12px;
    align-items: start;
  }
  
  .model-column {
    width: 320px;
    min-width: 320px;
    height: auto;
    min-height: 0;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  
  .model-column.inactive {
    opacity: 0.45;
  }
  
  .model-column-header {
    width: 100%;
    flex: 0 0 auto;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    padding: 12px;
    cursor: pointer;
    text-align: left;
    border-radius: 12px 12px 0 0;
  }
  
  .model-column-header:hover {
    background: #f1f1f1;
  }
  
  .model-column-header.active {
    background: #111;
    color: white;
  }
  
  .model-column-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .model-column-meta {
    font-size: 12px;
    opacity: 0.75;
  }
  
  .model-column-messages {
    flex: 0 0 auto;
    min-height: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
  }
  
  .empty-column {
    font-size: 13px;
    color: #777;
    padding: 12px;
  }
  
  .recipient-group-card {
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #fafafa;
    overflow: hidden;
    flex: 0 0 auto;
  }
  
  .recipient-group-header-button {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: #f3f3f3;
    padding: 11px 12px;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
  }
  
  .recipient-group-header-button:hover {
    background: #eeeeee;
  }
  
  .recipient-group-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  
  .recipient-group-title {
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    user-select: text;
    cursor: text;
  }
  
  .recipient-group-expand-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: white;
    color: #333;
    font-size: 14px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
  }
  
  .recipient-group-meta {
    margin-top: 4px;
    font-size: 11px;
    color: #666;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
  }
  
  .recipient-group-preview {
    margin-top: 8px;
    font-size: 12px;
    color: #333;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
  }
  
  .recipient-chat-history {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .grouped-message-card {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 9px;
    background: white;
    flex: 0 0 auto;
  }
  
  .grouped-message-card.outbound {
    margin-left: 14px;
  }
  
  .grouped-message-card.inbound {
    margin-right: 14px;
    background: #f8f8f8;
  }
  
  .grouped-message-meta {
    font-size: 10.5px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
  }
  
  .grouped-message-body {
    font-size: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }
  
  .muted {
    color: #666;
    font-size: 14px;
  }
  
  .success {
    color: #0a7a28;
    font-size: 14px;
  }
  
  .error {
    color: #b00020;
    font-size: 14px;
    margin-top: 12px;
  }
  
  .hidden {
    display: none;
  }
  
  @media (max-width: 850px) {
    .query-layout {
      grid-template-columns: 1fr;
    }
  
    .query-sidebar {
      position: static;
      max-height: none;
    }
  
    .selected-query-header {
      flex-direction: column;
    }
  
    .model-board-header {
      flex-direction: column;
    }
  
    .model-board-header .success {
      margin-top: 0;
    }
  
    .model-columns-board {
        grid-auto-columns: 280px;
        overflow-x: auto;
        overflow-y: visible;
        align-items: start;
      }
  
      .model-column {
        width: 280px;
        min-width: 280px;
        height: auto;
        min-height: 0;
      }
  
    .model-column-messages {
      min-height: 0;
      overflow-y: visible;
    }
  
    .form-grid {
      grid-template-columns: 1fr;
    }
  
    .top-nav {
      padding: 0 14px;
    }
  
    .page {
      padding: 14px;
    }
  }

  .recipient-group-card.single-message .recipient-group-header-button {
    cursor: default;
  }
  
  .recipient-group-card.single-message .recipient-group-header-button:hover {
    background: #f3f3f3;
  }

  .inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
  }
  
  .inline-checkbox input {
    margin: 0;
    cursor: pointer;
  }