.dialog-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: "Lexend Deca", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.edit-side-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 340px;
    height: 100%;
    min-width: 340px; 
    max-width: 300px; 
    flex-shrink: 0; 
    bottom: 0;
    background-color: var(--bg-light);
    border-right: 1px solid var(--bg-medium);
    z-index: 100;
    box-shadow: 2px 0 8px rgb(0 0 0 / 10%);
    overflow-y: auto;
}

.argument-to-link {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    border: 1px solid var(--bg-dark);
}

.link-to-argument-message {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.edit-side-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.edit-argument-content {
    width: 100%;
    height: 120px; 
    resize: none; 
    border: 1px solid var(--bg-very-light);
    border-radius: 4px;
    font-family: "Lexend Deca", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto; 
    background-color: var(--bg-very-light);
}


.edit-argument-content::placeholder {
    font-style: italic;
    color: #888;
    opacity: 1; 
}

.edit-source-field {
    margin-bottom: 12px;
}

.edit-source-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--standard-text);
    margin-bottom: 4px;
}

.edit-source-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--bg-medium);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family-main);
    box-sizing: border-box;
}

.edit-source-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.edit-author .edit-source-field {
    width: 100%;
}

.search-for-editable-author {
    flex: 1; 
    min-width: 0; 
    max-width: calc(100% - 44px); 
}


.edit-author input {
    width: 100%;
    max-width: 280px; 
    box-sizing: border-box;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.edit-source-field input {
    padding: 8px 12px;
    border: 1px solid var(--bg-light);
    border-radius: 6px;
    font-size: 14px;
    font-family: "Lexend Deca", sans-serif;
    transition: border-color 0.2s ease;
}

.tag-key-input,
.tag-value-input {
    padding: 8px 12px;
    border: 1px solid var(--bg-light);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family-main), serif;
    flex: 1;
    min-width: 120px; 
}

.tag-value-small-input {
    padding: 6px 10px;
    border: 1px solid var(--bg-light);
    border-radius: 4px;
    font-size: 13px;
    font-family: "Lexend Deca", sans-serif;
    flex: 1;
    background-color: var(--bg-light);
}


input:focus,
select:focus,
.tag-key-input:focus,
.tag-value-input:focus,
.tag-value-small-input:focus{
    outline: none;
    border-color: var(--bg-medium);
    box-shadow: 0 0 0 3px var(--neutral);
}

.edit-source-field input:focus {
    outline: none;
    border-color: var(--neutral);
    box-shadow: 0 0 0 3px rgb(86 100 245 / 10%);
}

.edit-source-field input[type="date"],
.edit-source-field input[type="datetime-local"] {
    color: var(--neutral-dark);
    cursor: pointer;
}

.edit-source-field input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.edit-source-field input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.edit-argument-container,
.edit-source-fields-container,
.edit-authors-container {
    border-radius: 6px; 
    background-color: var(--bg-light);

    
    padding: 16px 40px 16px 16px;
    border: 1px solid var(--bg-dark);
    position: relative;
}

.edit-source-field select {
    height: 32px;
    border: 1px solid var(--neutral-dark);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    background-color: var(--bg-light);
    cursor: pointer;
    font-family: "Lexend Deca", sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding: 0 0 0 12px;
}

.edit-source-field select:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--neutral-dark);
}

.edit-authors-fields,
.edit-source-fields {
    border-top: 1px solid var(--neutral-dark);
    border-top-style: dashed;
    display: flex;
    flex-direction: column;
    max-width: 540px;
    margin: 0 auto;
    gap: 16px;
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.edit-argument-properties {
    display: flex;
    flex-direction: column;
    max-width: 540px;
    gap: 16px;
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 32px; 
}


.edit-authors {
    margin-top: 24px;
    border-top: 1px solid var(--neutral-dark);
    padding-top: 24px;
}

.edit-authors-field {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-author {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-medium);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.edit-author > label {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: var(--standard-text);
    margin-bottom: 12px;
    padding: 4px 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-medium);
    max-width: calc(100% - 60px); 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-author .remove-button {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px;
    border: none;
    cursor: pointer;
    color: var(--neutral-light);
    background-color: var(--critical-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.author-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    margin-bottom: 16px;
}

.author-content {
    flex: 1;
}

.citation-block {
    margin-bottom: 12px;
}

.citation-block label {
    display: block;
    font-size: 12px;
    color: var(--standard-lighter-text);
    background-color: var(--bg-medium);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.empty-state-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.empty-state-message h2 {
    color: var(--standard-text);
    font-size: 24px;
    font-family: "Lexend Deca", sans-serif;
    font-weight: 500;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--neutral-light);
    box-shadow: 0 1px 3px var(--neutral);
    border: 1px solid var(--neutral-dark);
}


.edit-argument-list-item {
    background-color: var(--bg-light);
    border: 1px solid var(--bg-light);
    border-bottom: 1px dashed var(--neutral-dark); /* Thicker dashed bottom border */
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 60px;
    padding: 16px;
    position: relative;
}

.edit-argument-list-item:hover .copy-button {
    opacity: 1;
}


.edit-argument-list-items {
    display: flex;
    flex-direction: column;
    gap: 16px; 
}


.edit-argument-list {
    margin-bottom: 32px;
}


.edit-source-fields {
    margin-top: 32px;
}


.edit-side-panel-content > div:last-child {
    margin-bottom: 32px;
}


.edit-argument,
.edit-source-fields,
.edit-authors-container {
    margin-bottom: 32px;
}

.quote-toggle-container {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.quote-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.quote-toggle-checkbox {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.quote-toggle-text {
    font-size: 14px;
    color: var(--standard-text);
    font-family: "Lexend Deca", sans-serif;
}


.edit-argument-content.is-quote {
    border-left: 3px solid var(--primary-dark);
    background: linear-gradient(to right, rgb(86 100 245 / 5%), transparent);
}


.quote-toggle-checkbox:checked {
    accent-color: var(--checkbox-checked);
}

.date-picker-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    max-width: 600px;
    margin-bottom: 20px;
    background-color: var(--bg-very-light);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
    padding: 16px;
    border: 1px solid var(--bg-very-light);
}

.date-picker-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--standard-h2-text);
    font-size: 16px;
}

.date-picker-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.date-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 14px;
    color: var(--standard-h2-text);
    margin-bottom: 4px;
}

input.day-input,
input.year-input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--bg-very-light);
    border-radius: 4px;
    font-size: 14px;
    color: var(--standard-h2-text);
}

input.year-input {
    width: 100px;
}

.month-select,
.era-select {
    padding: 8px 12px;
    border: 1px solid var(--bg-very-light);
    border-radius: 4px;
    background-color: var(--bg-very-light);
    font-size: 14px;
    color: var(--standard-h2-text);
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}

.era-select {
    min-width: 80px;
}

.date-preview {
    margin-top: 10px;
    font-size: 14px;
    color: var(--standard-h2-text);
    background-color: var(--bg-very-light);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--bg-very-light);
}


@media (width <= 480px) {
    .date-picker-inputs {
        flex-direction: column;
    }

    .date-field {
        width: 100%;
    }

    .month-select,
    .year-input {
        width: 100%;
    }
}


.edit-tags-section {
    margin-top: 20px;
    background-color: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
}

.add-tag-form {
    padding: 16px;
    border-bottom: 1px solid var(--neutral-dark);
}

.tag-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap; 
}

.tags-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tag-category {
    background-color: var(--bg-light);
    border: 1px solid var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
}

.tag-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--neutral-light);
    border-bottom: 1px solid var(--neutral-light);
}

.tag-category-name {
    font-weight: 600;
    color: var(--standard-text);
    font-size: 14px;
}

.tag-values {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-light);
    padding: 6px 10px;
    border-radius: 4px;
}

.tag-value {
    font-size: 14px;
    color: var(--standard-text);
}


.add-to-category {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    border-top: 1px dashed var(--neutral-dark);
    padding-top: 8px;
}

.map-title-container {
    display: flex;
    justify-content: flex-start;
    max-width: 400px;
    min-height: 34px; 
    position: relative;
    order: 1;
    margin-top: -8px;
    margin-right: 100px;
    align-items: flex-start; 
}

.map-title-display {
    padding: 12px 16px;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-family-main);
    color: var(--primary-dark);
    width: 100%;
    text-align: left;
    display: flex;
    align-items: flex-start; 
    justify-content: flex-start;
    transition: all 0.3s ease;
    border-radius: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2; 
    
}

.map-title-display.editable {
    cursor: pointer;
}

.map-title-display.editable:hover {
    background-color: var(--bg-very-light);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.map-title-display.empty {
    color: var(--standard-lighter-text);
    font-style: italic;
    font-weight: 400;
    font-size: 16px;
}


.map-title-input {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-family: var(--font-family-main);
    background-color: transparent;
    color: var(--standard-text);
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    text-align: left; 
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; 
    opacity: 0;
    pointer-events: none;
}

.map-title-input:focus {
    opacity: 1;
    pointer-events: auto;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    background-color: var(--bg-very-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    outline: none;
    z-index: 3; 
}

.map-title-container:focus-within .map-title-display {
    opacity: 0;
    pointer-events: none;
}

.map-title-input::placeholder {
    color: var(--standard-lighter-text);
    font-style: italic;
    text-align: left; 
}


.authors-section {
    margin-bottom: 24px;
}

.add-element-button {
    padding: 8px 16px;
    margin-top: 16px;
    background-color: var(--bg-light);
    color: var(--neutral-dark);
    border: 1px dashed var(--neutral-dark);
    border-radius: 6px;
    font-family: var(--font-family-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.add-element-button:hover {
    background-color: var(--bg-medium);
    border-style: solid;
}

.add-element-button svg {
    width: 16px;
    height: 16px;
}

.add-source-with-tooltip {
    display: flex;
    align-items: center;
    gap: 8px;
}