* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.token-container {
    display: table;
    margin: 10px 20px 0;
    width: calc(100% - 40px);
    border-collapse: separate;
    border-spacing: 0;
}

#token {
    display: table-cell;
    width: 100%;
    border: 1px solid #ccc;
    padding: 10px;
    border-right: none;
    border-radius: 5px 0 0 5px;
    margin: 0;
}

.value-container {
    position: relative;
    margin: 10px 20px;
    width: calc(100vw - 40px);
    height: calc(100vh - 200px);
}

#value {
    width: 100%;
    height: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    padding-top: 30px;
}

.value-btns {
    position: absolute;
    top: 0px;
    right: 0px;
    display: flex;
}

.value-btns>.btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    margin-left: -1px;
    padding: 3px 6px;
    cursor: pointer;
}

.value-btns>.btn:first-child {
    border-radius: 0 0 0 5px;
}

.value-btns>.btn:last-child {
    border-radius: 0 5px 0 0;
}


.btn {
    padding: 3px 6px;
    display: inline-block;
    cursor: pointer;
}

.btns>.btn {
    background: #f0f0f0;
    border: black solid 1px;
}

.btns {
    margin-top: 5px;
}

/* Special styles for the buttons next to the token input */
.token-container>.btn {
    display: table-cell;
    width: 1%;
    /* Shrink to content */
    margin: 0;
    border: 1px solid #ccc;
    border-left-width: 0;
    padding: 10px;
    background: #f0f0f0;
    white-space: nowrap;
    /* prevent text wrapping */
    padding-top: 1px;
    padding-bottom: 1px;
}

.token-container>.btn:last-child {
    border-radius: 0 5px 5px 0;
}

.token-container>.warnBtn {
    border-top-color: red;
    border-bottom-color: red;
}

.token-container>.warnBtn:last-child {
    border-right-color: red;
}

#value:focus,
#token:focus {
    outline: none;
    border-color: green;
}

.value-btns>.warnBtn {
    border-top-color: red;
}

.value-btns>.warnBtn:last-child {
    border-right-color: red;
}

.value-btns>.selected {
    background-color: #70c261ff;
}

.value-container:focus-within .btn {
    border-top-color: green;
}

.value-container:focus-within .btn:last-child {
    border-right-color: green;
}

.value-container:focus-within .warnBtn {
    border-top-color: red;
}

.value-container:focus-within .warnBtn:last-child {
    border-right-color: red;
}

.token-container:focus-within .btn {
    border-top-color: green;
    border-bottom-color: green;
}

.token-container:focus-within .btn:last-child {
    border-right-color: green;
}

.token-container:focus-within .warnBtn {
    border-top-color: red;
    border-bottom-color: red;
}

.token-container:focus-within .warnBtn:last-child {
    border-right-color: red;
}

/* Dialog Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 300px;
}

.dialog-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.token-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#dialogTokenValue {
    font-family: monospace;
    font-size: 1.2em;
    margin-right: 10px;
    font-weight: bold;
}

#dialogCloseBtn {
    margin-top: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 3px;
}

#dialogCloseBtn:hover {
    background-color: #e0e0e0;
}

.link-group {
    margin: 15px 0;
    text-align: left;
}

.link-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.link-label {
    font-weight: bold;
    margin-right: 10px;
    width: 80px;
    text-align: right;
}

.link-url {
    flex-grow: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 3px;
    background: #f9f9f9;
}

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